diff options
| author | Lioncash <mathew1800@gmail.com> | 2018-07-31 08:53:13 -0400 |
|---|---|---|
| committer | Lioncash <mathew1800@gmail.com> | 2018-07-31 11:03:08 -0400 |
| commit | 369f6e58aa30fe48e8b1fc484192bfc5223b9ec5 (patch) | |
| tree | 7c01a5ea620eb6ac49f7b3121d7d34b1a56393bc /src/core/hle/kernel/object_address_table.h | |
| parent | bf9c62bc76a2296c1a81cfc1b83aaf4028578901 (diff) | |
kernel: Remove unused object_address_table.cpp/.h
These source files were entirely unused throughout the rest of the
codebase. This also has the benefit of getting rid of a global variable
as well.
Diffstat (limited to 'src/core/hle/kernel/object_address_table.h')
| -rw-r--r-- | src/core/hle/kernel/object_address_table.h | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/core/hle/kernel/object_address_table.h b/src/core/hle/kernel/object_address_table.h deleted file mode 100644 index a09004b32..000000000 --- a/src/core/hle/kernel/object_address_table.h +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2018 yuzu emulator team -// Licensed under GPLv2 or any later version -// Refer to the license.txt file included. - -#pragma once - -#include <map> -#include "common/common_types.h" -#include "core/hle/kernel/kernel.h" - -namespace Kernel { - -/** - * This class is used to keep a table of Kernel objects and their respective addresses in emulated - * memory. For certain Switch SVCs, Kernel objects are referenced by an address to an object the - * guest application manages, so we use this table to look these kernel objects up. This is similiar - * to the HandleTable class. - */ -class ObjectAddressTable final : NonCopyable { -public: - ObjectAddressTable() = default; - - /** - * Inserts an object and address pair into the table. - */ - void Insert(VAddr addr, SharedPtr<Object> obj); - - /** - * Closes an object by its address, removing it from the table and decreasing the object's - * ref-count. - * @return `RESULT_SUCCESS` or one of the following errors: - * - `ERR_INVALID_HANDLE`: an invalid handle was passed in. - */ - void Close(VAddr addr); - - /** - * Looks up an object by its address. - * @return Pointer to the looked-up object, or `nullptr` if the handle is not valid. - */ - SharedPtr<Object> GetGeneric(VAddr addr) const; - - /** - * Looks up an object by its address while verifying its type. - * @return Pointer to the looked-up object, or `nullptr` if the handle is not valid or its - * type differs from the requested one. - */ - template <class T> - SharedPtr<T> Get(VAddr addr) const { - return DynamicObjectCast<T>(GetGeneric(addr)); - } - - /// Closes all addresses held in this table. - void Clear(); - -private: - /// Stores the Object referenced by the address - std::map<VAddr, SharedPtr<Object>> objects; -}; - -extern ObjectAddressTable g_object_address_table; - -} // namespace Kernel |
