summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/nvdrv/devices/nvmap.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-02-08 03:53:31 +0100
committerbunnei <bunneidev@gmail.com>2018-02-08 04:55:12 +0100
commit196f8dff084b7229982af214617d55ca084dfed2 (patch)
tree0d2f60713d7a0035409640e88ff1c7d6b7762cbe /src/core/hle/service/nvdrv/devices/nvmap.h
parentnvhost_as_gpu: Add nvmap as a class member. (diff)
downloadyuzu-196f8dff084b7229982af214617d55ca084dfed2.tar
yuzu-196f8dff084b7229982af214617d55ca084dfed2.tar.gz
yuzu-196f8dff084b7229982af214617d55ca084dfed2.tar.bz2
yuzu-196f8dff084b7229982af214617d55ca084dfed2.tar.lz
yuzu-196f8dff084b7229982af214617d55ca084dfed2.tar.xz
yuzu-196f8dff084b7229982af214617d55ca084dfed2.tar.zst
yuzu-196f8dff084b7229982af214617d55ca084dfed2.zip
Diffstat (limited to '')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.h b/src/core/hle/service/nvdrv/devices/nvmap.h
index 1591ac8ff..4681e438b 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.h
+++ b/src/core/hle/service/nvdrv/devices/nvmap.h
@@ -26,8 +26,7 @@ public:
u32 ioctl(Ioctl command, const std::vector<u8>& input, std::vector<u8>& output) override;
-private:
- // Represents an nvmap object.
+ /// Represents an nvmap object.
struct Object {
enum class Status { Created, Allocated };
u32 id;
@@ -39,10 +38,19 @@ private:
Status status;
};
+ std::shared_ptr<Object> GetObject(u32 handle) const {
+ auto itr = handles.find(handle);
+ if (itr != handles.end()) {
+ return itr->second;
+ }
+ return {};
+ }
+
+private:
/// Id to use for the next handle that is created.
u32 next_handle = 1;
- // Id to use for the next object that is created.
+ /// Id to use for the next object that is created.
u32 next_id = 1;
/// Mapping of currently allocated handles to the objects they represent.