summaryrefslogtreecommitdiff
path: root/src/core/hle/service/mm
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-13 18:52:23 -0400
committerGravatar Lioncash2018-08-13 18:59:07 -0400
commit9d09d92c56c96a82bb9a5c7c2990bee1576ff780 (patch)
tree37b2571ca58ea12b29b0bfad6c8aabb9d690e521 /src/core/hle/service/mm
parentMerge pull request #1052 from ogniK5377/xeno (diff)
downloadyuzu-9d09d92c56c96a82bb9a5c7c2990bee1576ff780.tar.gz
yuzu-9d09d92c56c96a82bb9a5c7c2990bee1576ff780.tar.xz
yuzu-9d09d92c56c96a82bb9a5c7c2990bee1576ff780.zip
mm_u: Move implementation class into the cpp file
Now if changes are ever made to the behavior of the class, it doesn't involve rebuilding everything that includes the mm_u header.
Diffstat (limited to 'src/core/hle/service/mm')
-rw-r--r--src/core/hle/service/mm/mm_u.cpp77
-rw-r--r--src/core/hle/service/mm/mm_u.h15
2 files changed, 46 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..0183c6e2e 100644
--- a/src/core/hle/service/mm/mm_u.cpp
+++ b/src/core/hle/service/mm/mm_u.cpp
@@ -9,42 +9,57 @@
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, nullptr, "InitializeOld"},
18 {1, nullptr, "FinalizeOld"},
19 {2, nullptr, "SetAndWaitOld"},
20 {3, nullptr, "GetOld"},
21 {4, &MM_U::Initialize, "Initialize"},
22 {5, nullptr, "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 SetAndWait(Kernel::HLERequestContext& ctx) {
29 IPC::ResponseBuilder rb{ctx, 2}; 39 IPC::RequestParser rp{ctx};
30 rb.Push(RESULT_SUCCESS); 40 min = rp.Pop<u32>();
31} 41 max = rp.Pop<u32>();
42 current = min;
32 43
33void MM_U::Get(Kernel::HLERequestContext& ctx) { 44 LOG_WARNING(Service_MM, "(STUBBED) called, min=0x{:X}, max=0x{:X}", min, max);
34 LOG_WARNING(Service_MM, "(STUBBED) called"); 45 IPC::ResponseBuilder rb{ctx, 2};
35 IPC::ResponseBuilder rb{ctx, 3}; 46 rb.Push(RESULT_SUCCESS);
36 rb.Push(RESULT_SUCCESS); 47 }
37 rb.Push(current); 48
38} 49 void Get(Kernel::HLERequestContext& ctx) {
50 LOG_WARNING(Service_MM, "(STUBBED) called");
51 IPC::ResponseBuilder rb{ctx, 3};
52 rb.Push(RESULT_SUCCESS);
53 rb.Push(current);
54 }
55
56 u32 min{0};
57 u32 max{0};
58 u32 current{0};
59};
39 60
40MM_U::MM_U() : ServiceFramework("mm:u") { 61void InstallInterfaces(SM::ServiceManager& service_manager) {
41 static const FunctionInfo functions[] = { 62 std::make_shared<MM_U>()->InstallAsService(service_manager);
42 {0, nullptr, "InitializeOld"}, {1, nullptr, "FinalizeOld"},
43 {2, nullptr, "SetAndWaitOld"}, {3, nullptr, "GetOld"},
44 {4, &MM_U::Initialize, "Initialize"}, {5, nullptr, "Finalize"},
45 {6, &MM_U::SetAndWait, "SetAndWait"}, {7, &MM_U::Get, "Get"},
46 };
47 RegisterHandlers(functions);
48} 63}
49 64
50} // namespace Service::MM 65} // 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