summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Lioncash2018-08-02 09:59:08 -0400
committerGravatar Lioncash2018-08-02 10:09:45 -0400
commit7469e26e5e1a224aaeee4eccc86079c82f9c326d (patch)
tree55b3441d54a431fcb454a12ec17173ba882918ba /src/core
parentMerge pull request #896 from lioncash/audio-out (diff)
downloadyuzu-7469e26e5e1a224aaeee4eccc86079c82f9c326d.tar.gz
yuzu-7469e26e5e1a224aaeee4eccc86079c82f9c326d.tar.xz
yuzu-7469e26e5e1a224aaeee4eccc86079c82f9c326d.zip
service: Add migration services
Adds the basic skeleton for the mig:usr service based off information provided by Switch Brew.
Diffstat (limited to 'src/core')
-rw-r--r--src/core/CMakeLists.txt2
-rw-r--r--src/core/hle/service/mig/mig.cpp34
-rw-r--r--src/core/hle/service/mig/mig.h15
-rw-r--r--src/core/hle/service/service.cpp2
4 files changed, 53 insertions, 0 deletions
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 3cc9160ca..b74e144a0 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -204,6 +204,8 @@ add_library(core STATIC
204 hle/service/ldr/ldr.h 204 hle/service/ldr/ldr.h
205 hle/service/lm/lm.cpp 205 hle/service/lm/lm.cpp
206 hle/service/lm/lm.h 206 hle/service/lm/lm.h
207 hle/service/mig/mig.cpp
208 hle/service/mig/mig.h
207 hle/service/mii/mii.cpp 209 hle/service/mii/mii.cpp
208 hle/service/mii/mii.h 210 hle/service/mii/mii.h
209 hle/service/mm/mm_u.cpp 211 hle/service/mm/mm_u.cpp
diff --git a/src/core/hle/service/mig/mig.cpp b/src/core/hle/service/mig/mig.cpp
new file mode 100644
index 000000000..d16367f2c
--- /dev/null
+++ b/src/core/hle/service/mig/mig.cpp
@@ -0,0 +1,34 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#include <memory>
6
7#include "core/hle/service/mig/mig.h"
8#include "core/hle/service/service.h"
9#include "core/hle/service/sm/sm.h"
10
11namespace Service::Migration {
12
13class MIG_USR final : public ServiceFramework<MIG_USR> {
14public:
15 explicit MIG_USR() : ServiceFramework{"mig:usr"} {
16 // clang-format off
17 static const FunctionInfo functions[] = {
18 {10, nullptr, "TryGetLastMigrationInfo"},
19 {100, nullptr, "CreateServer"},
20 {101, nullptr, "ResumeServer"},
21 {200, nullptr, "CreateClient"},
22 {201, nullptr, "ResumeClient"},
23 };
24 // clang-format on
25
26 RegisterHandlers(functions);
27 }
28};
29
30void InstallInterfaces(SM::ServiceManager& sm) {
31 std::make_shared<MIG_USR>()->InstallAsService(sm);
32}
33
34} // namespace Service::Migration
diff --git a/src/core/hle/service/mig/mig.h b/src/core/hle/service/mig/mig.h
new file mode 100644
index 000000000..288c1c1b3
--- /dev/null
+++ b/src/core/hle/service/mig/mig.h
@@ -0,0 +1,15 @@
1// Copyright 2018 yuzu emulator team
2// Licensed under GPLv2 or any later version
3// Refer to the license.txt file included.
4
5#pragma once
6
7namespace Service::SM {
8class ServiceManager;
9}
10
11namespace Service::Migration {
12
13void InstallInterfaces(SM::ServiceManager& sm);
14
15} // namespace Service::Migration
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 828666e9b..3ed6d3404 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -38,6 +38,7 @@
38#include "core/hle/service/ldn/ldn.h" 38#include "core/hle/service/ldn/ldn.h"
39#include "core/hle/service/ldr/ldr.h" 39#include "core/hle/service/ldr/ldr.h"
40#include "core/hle/service/lm/lm.h" 40#include "core/hle/service/lm/lm.h"
41#include "core/hle/service/mig/mig.h"
41#include "core/hle/service/mii/mii.h" 42#include "core/hle/service/mii/mii.h"
42#include "core/hle/service/mm/mm_u.h" 43#include "core/hle/service/mm/mm_u.h"
43#include "core/hle/service/ncm/ncm.h" 44#include "core/hle/service/ncm/ncm.h"
@@ -224,6 +225,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
224 LDN::InstallInterfaces(*sm); 225 LDN::InstallInterfaces(*sm);
225 LDR::InstallInterfaces(*sm); 226 LDR::InstallInterfaces(*sm);
226 LM::InstallInterfaces(*sm); 227 LM::InstallInterfaces(*sm);
228 Migration::InstallInterfaces(*sm);
227 Mii::InstallInterfaces(*sm); 229 Mii::InstallInterfaces(*sm);
228 MM::InstallInterfaces(*sm); 230 MM::InstallInterfaces(*sm);
229 NCM::InstallInterfaces(*sm); 231 NCM::InstallInterfaces(*sm);