summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar bunnei2018-08-14 21:47:07 -0400
committerGravatar GitHub2018-08-14 21:47:07 -0400
commit409d2e07c22a2adfedb22087fafec76110acce3a (patch)
tree656cd16e65882edf86a093aafe731c678724ae13 /src/core
parentMerge pull request #1066 from lioncash/aarch64 (diff)
parentmm_u: Forward all old variants of functions to the new ones (diff)
downloadyuzu-409d2e07c22a2adfedb22087fafec76110acce3a.tar.gz
yuzu-409d2e07c22a2adfedb22087fafec76110acce3a.tar.xz
yuzu-409d2e07c22a2adfedb22087fafec76110acce3a.zip
Merge pull request #1056 from lioncash/mm
mm_u: Move interface class into the cpp file
Diffstat (limited to 'src/core')
-rw-r--r--src/core/hle/service/mm/mm_u.cpp83
-rw-r--r--src/core/hle/service/mm/mm_u.h15
2 files changed, 52 insertions, 46 deletions
diff --git a/src/core/hle/service/mm/mm_u.cpp b/src/core/hle/service/mm/mm_u.cpp
index 08f45b78a..7b91bb258 100644
--- a/src/core/hle/service/mm/mm_u.cpp
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -9,42 +9,63 @@
9 9
10namespace Service::MM { 10namespace Service::MM {
11 11
12void InstallInterfaces(SM::ServiceManager& service_manager) { 12class MM_U final : public ServiceFramework<MM_U> {
13 std::make_shared<MM_U>()->InstallAsService(service_manager); 13public:
14} 14 explicit MM_U() : ServiceFramework{"mm:u"} {
15 // clang-format off
16 static const FunctionInfo functions[] = {
17 {0, &MM_U::Initialize, "InitializeOld"},
18 {1, &MM_U::Finalize, "FinalizeOld"},
19 {2, &MM_U::SetAndWait, "SetAndWaitOld"},
20 {3, &MM_U::Get, "GetOld"},
21 {4, &MM_U::Initialize, "Initialize"},
22 {5, &MM_U::Finalize, "Finalize"},
23 {6, &MM_U::SetAndWait, "SetAndWait"},
24 {7, &MM_U::Get, "Get"},
25 };
26 // clang-format on
15 27
16void MM_U::Initialize(Kernel::HLERequestContext& ctx) { 28 RegisterHandlers(functions);
17 LOG_WARNING(Service_MM, "(STUBBED) called"); 29 }
18 IPC::ResponseBuilder rb{ctx, 2};
19 rb.Push(RESULT_SUCCESS);
20}
21 30
22void MM_U::SetAndWait(Kernel::HLERequestContext& ctx) { 31private:
23 IPC::RequestParser rp{ctx}; 32 void Initialize(Kernel::HLERequestContext& ctx) {
24 min = rp.Pop<u32>(); 33 LOG_WARNING(Service_MM, "(STUBBED) called");
25 max = rp.Pop<u32>(); 34 IPC::ResponseBuilder rb{ctx, 2};
26 current = min; 35 rb.Push(RESULT_SUCCESS);
36 }
27 37
28 LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max); 38 void Finalize(Kernel::HLERequestContext& ctx) {
29 IPC::ResponseBuilder rb{ctx, 2}; 39 LOG_WARNING(Service_MM, "(STUBBED) called");
30 rb.Push(RESULT_SUCCESS); 40 IPC::ResponseBuilder rb{ctx, 2};
31} 41 rb.Push(RESULT_SUCCESS);
42 }
32 43
33void MM_U::Get(Kernel::HLERequestContext& ctx) { 44 void SetAndWait(Kernel::HLERequestContext& ctx) {
34 LOG_WARNING(Service_MM, "(STUBBED) called"); 45 IPC::RequestParser rp{ctx};
35 IPC::ResponseBuilder rb{ctx, 3}; 46 min = rp.Pop<u32>();
36 rb.Push(RESULT_SUCCESS); 47 max = rp.Pop<u32>();
37 rb.Push(current); 48 current = min;
38}
39 49
40MM_U::MM_U() : ServiceFramework("mm:u") { 50 LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max);
41 static const FunctionInfo functions[] = { 51 IPC::ResponseBuilder rb{ctx, 2};
42 {0, nullptr, "InitializeOld"}, {1, nullptr, "FinalizeOld"}, 52 rb.Push(RESULT_SUCCESS);
43 {2, nullptr, "SetAndWaitOld"}, {3, nullptr, "GetOld"}, 53 }
44 {4, &MM_U::Initialize, "Initialize"}, {5, nullptr, "Finalize"}, 54
45 {6, &MM_U::SetAndWait, "SetAndWait"}, {7, &MM_U::Get, "Get"}, 55 void Get(Kernel::HLERequestContext& ctx) {
46 }; 56 LOG_WARNING(Service_MM, "(STUBBED) called");
47 RegisterHandlers(functions); 57 IPC::ResponseBuilder rb{ctx, 3};
58 rb.Push(RESULT_SUCCESS);
59 rb.Push(current);
60 }
61
62 u32 min{0};
63 u32 max{0};
64 u32 current{0};
65};
66
67void InstallInterfaces(SM::ServiceManager& service_manager) {
68 std::make_shared<MM_U>()->InstallAsService(service_manager);
48} 69}
49 70
50} // namespace Service::MM 71} // namespace Service::MM
diff --git a/src/core/hle/service/mm/mm_u.h b/src/core/hle/service/mm/mm_u.h
index 79eeedf9c..5439fa653 100644
--- a/src/core/hle/service/mm/mm_u.h
+++ b/src/core/hle/service/mm/mm_u.h
@@ -8,21 +8,6 @@
8 8
9namespace Service::MM { 9namespace Service::MM {
10 10
11class MM_U final : public ServiceFramework<MM_U> {
12public:
13 MM_U();
14 ~MM_U() = default;
15
16private:
17 void Initialize(Kernel::HLERequestContext& ctx);
18 void SetAndWait(Kernel::HLERequestContext& ctx);
19 void Get(Kernel::HLERequestContext& ctx);
20
21 u32 min{0};
22 u32 max{0};
23 u32 current{0};
24};
25
26/// Registers all MM services with the specified service manager. 11/// Registers all MM services with the specified service manager.
27void InstallInterfaces(SM::ServiceManager& service_manager); 12void InstallInterfaces(SM::ServiceManager& service_manager);
28 13