summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar bunnei2018-01-21 22:01:27 -0500
committerGravatar GitHub2018-01-21 22:01:27 -0500
commitfdbb039427b077ef92532f07e4b4e730457a1057 (patch)
tree5ededfe6efb510061f918331fd8974abca4ca32d /src
parentMerge pull request #130 from MerryMage/dynarmic (diff)
parentnvmap: Add a return 0 underneath the UNIMPLEMENTED macro (diff)
downloadyuzu-fdbb039427b077ef92532f07e4b4e730457a1057.tar.gz
yuzu-fdbb039427b077ef92532f07e4b4e730457a1057.tar.xz
yuzu-fdbb039427b077ef92532f07e4b4e730457a1057.zip
Merge pull request #131 from lioncash/enum
nvmap: Make IoctlCommands an enum class
Diffstat (limited to 'src')
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.cpp13
-rw-r--r--src/core/hle/service/nvdrv/devices/nvmap.h12
2 files changed, 13 insertions, 12 deletions
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.cpp b/src/core/hle/service/nvdrv/devices/nvmap.cpp
index d37b5b159..74ee7e154 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.cpp
+++ b/src/core/hle/service/nvdrv/devices/nvmap.cpp
@@ -22,20 +22,21 @@ VAddr nvmap::GetObjectAddress(u32 handle) const {
22} 22}
23 23
24u32 nvmap::ioctl(u32 command, const std::vector<u8>& input, std::vector<u8>& output) { 24u32 nvmap::ioctl(u32 command, const std::vector<u8>& input, std::vector<u8>& output) {
25 switch (command) { 25 switch (static_cast<IoctlCommand>(command)) {
26 case IocCreateCommand: 26 case IoctlCommand::Create:
27 return IocCreate(input, output); 27 return IocCreate(input, output);
28 case IocAllocCommand: 28 case IoctlCommand::Alloc:
29 return IocAlloc(input, output); 29 return IocAlloc(input, output);
30 case IocGetIdCommand: 30 case IoctlCommand::GetId:
31 return IocGetId(input, output); 31 return IocGetId(input, output);
32 case IocFromIdCommand: 32 case IoctlCommand::FromId:
33 return IocFromId(input, output); 33 return IocFromId(input, output);
34 case IocParamCommand: 34 case IoctlCommand::Param:
35 return IocParam(input, output); 35 return IocParam(input, output);
36 } 36 }
37 37
38 UNIMPLEMENTED(); 38 UNIMPLEMENTED();
39 return 0;
39} 40}
40 41
41u32 nvmap::IocCreate(const std::vector<u8>& input, std::vector<u8>& output) { 42u32 nvmap::IocCreate(const std::vector<u8>& input, std::vector<u8>& output) {
diff --git a/src/core/hle/service/nvdrv/devices/nvmap.h b/src/core/hle/service/nvdrv/devices/nvmap.h
index 6954c0324..42e00f370 100644
--- a/src/core/hle/service/nvdrv/devices/nvmap.h
+++ b/src/core/hle/service/nvdrv/devices/nvmap.h
@@ -48,12 +48,12 @@ private:
48 /// Mapping of currently allocated handles to the objects they represent. 48 /// Mapping of currently allocated handles to the objects they represent.
49 std::unordered_map<u32, std::shared_ptr<Object>> handles; 49 std::unordered_map<u32, std::shared_ptr<Object>> handles;
50 50
51 enum IoctlCommands { 51 enum class IoctlCommand : u32 {
52 IocCreateCommand = 0xC0080101, 52 Create = 0xC0080101,
53 IocFromIdCommand = 0xC0080103, 53 FromId = 0xC0080103,
54 IocAllocCommand = 0xC0200104, 54 Alloc = 0xC0200104,
55 IocParamCommand = 0xC00C0109, 55 Param = 0xC00C0109,
56 IocGetIdCommand = 0xC008010E 56 GetId = 0xC008010E
57 }; 57 };
58 58
59 struct IocCreateParams { 59 struct IocCreateParams {