summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar mailwl2018-05-28 16:36:38 +0300
committerGravatar mailwl2018-05-28 16:46:56 +0300
commit7757cc1a7ffceccdcd87a77d8ea292c822fa9599 (patch)
tree4cd15764485f445d9c52cbcea96dcb480c3896f7 /src
parentMerge pull request #472 from bunnei/greater-equal (diff)
downloadyuzu-7757cc1a7ffceccdcd87a77d8ea292c822fa9599.tar.gz
yuzu-7757cc1a7ffceccdcd87a77d8ea292c822fa9599.tar.xz
yuzu-7757cc1a7ffceccdcd87a77d8ea292c822fa9599.zip
Service/BCAT: add module and services
Diffstat (limited to 'src')
-rw-r--r--src/common/logging/backend.cpp1
-rw-r--r--src/common/logging/log.h1
-rw-r--r--src/core/CMakeLists.txt4
-rw-r--r--src/core/hle/service/bcat/bcat.cpp16
-rw-r--r--src/core/hle/service/bcat/bcat.h16
-rw-r--r--src/core/hle/service/bcat/module.cpp53
-rw-r--r--src/core/hle/service/bcat/module.h27
-rw-r--r--src/core/hle/service/service.cpp2
8 files changed, 120 insertions, 0 deletions
diff --git a/src/common/logging/backend.cpp b/src/common/logging/backend.cpp
index aeb4249f8..3e31a74f2 100644
--- a/src/common/logging/backend.cpp
+++ b/src/common/logging/backend.cpp
@@ -35,6 +35,7 @@ namespace Log {
35 SUB(Service, AM) \ 35 SUB(Service, AM) \
36 SUB(Service, AOC) \ 36 SUB(Service, AOC) \
37 SUB(Service, APM) \ 37 SUB(Service, APM) \
38 SUB(Service, BCAT) \
38 SUB(Service, Fatal) \ 39 SUB(Service, Fatal) \
39 SUB(Service, Friend) \ 40 SUB(Service, Friend) \
40 SUB(Service, FS) \ 41 SUB(Service, FS) \
diff --git a/src/common/logging/log.h b/src/common/logging/log.h
index 48f85deac..43e572ebe 100644
--- a/src/common/logging/log.h
+++ b/src/common/logging/log.h
@@ -55,6 +55,7 @@ enum class Class : ClassType {
55 Service_AOC, ///< The AOC (AddOn Content) service 55 Service_AOC, ///< The AOC (AddOn Content) service
56 Service_APM, ///< The APM (Performance) service 56 Service_APM, ///< The APM (Performance) service
57 Service_Audio, ///< The Audio (Audio control) service 57 Service_Audio, ///< The Audio (Audio control) service
58 Service_BCAT, ///< The BCAT service
58 Service_Fatal, ///< The Fatal service 59 Service_Fatal, ///< The Fatal service
59 Service_Friend, ///< The friend service 60 Service_Friend, ///< The friend service
60 Service_FS, ///< The FS (Filesystem) service 61 Service_FS, ///< The FS (Filesystem) service
diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt
index 821d2f883..7ab60c5bc 100644
--- a/src/core/CMakeLists.txt
+++ b/src/core/CMakeLists.txt
@@ -124,6 +124,10 @@ add_library(core STATIC
124 hle/service/audio/audren_u.h 124 hle/service/audio/audren_u.h
125 hle/service/audio/codecctl.cpp 125 hle/service/audio/codecctl.cpp
126 hle/service/audio/codecctl.h 126 hle/service/audio/codecctl.h
127 hle/service/bcat/module.cpp
128 hle/service/bcat/module.h
129 hle/service/bcat/bcat.cpp
130 hle/service/bcat/bcat.h
127 hle/service/fatal/fatal.cpp 131 hle/service/fatal/fatal.cpp
128 hle/service/fatal/fatal.h 132 hle/service/fatal/fatal.h
129 hle/service/fatal/fatal_p.cpp 133 hle/service/fatal/fatal_p.cpp
diff --git a/src/core/hle/service/bcat/bcat.cpp b/src/core/hle/service/bcat/bcat.cpp
new file mode 100644
index 000000000..20ce692dc
--- /dev/null
+++ b/src/core/hle/service/bcat/bcat.cpp
@@ -0,0 +1,16 @@
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 "core/hle/service/bcat/bcat.h"
6
7namespace Service::BCAT {
8
9BCAT::BCAT(std::shared_ptr<Module> module, const char* name)
10 : Module::Interface(std::move(module), name) {
11 static const FunctionInfo functions[] = {
12 {0, &BCAT::CreateBcatService, "CreateBcatService"},
13 };
14 RegisterHandlers(functions);
15}
16} // namespace Service::BCAT
diff --git a/src/core/hle/service/bcat/bcat.h b/src/core/hle/service/bcat/bcat.h
new file mode 100644
index 000000000..6632996a0
--- /dev/null
+++ b/src/core/hle/service/bcat/bcat.h
@@ -0,0 +1,16 @@
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
7#include "core/hle/service/bcat/module.h"
8
9namespace Service::BCAT {
10
11class BCAT final : public Module::Interface {
12public:
13 explicit BCAT(std::shared_ptr<Module> module, const char* name);
14};
15
16} // namespace Service::BCAT
diff --git a/src/core/hle/service/bcat/module.cpp b/src/core/hle/service/bcat/module.cpp
new file mode 100644
index 000000000..52be9db22
--- /dev/null
+++ b/src/core/hle/service/bcat/module.cpp
@@ -0,0 +1,53 @@
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 "common/logging/log.h"
6#include "core/hle/ipc_helpers.h"
7#include "core/hle/service/bcat/bcat.h"
8#include "core/hle/service/bcat/module.h"
9
10namespace Service::BCAT {
11
12class IBcatService final : public ServiceFramework<IBcatService> {
13public:
14 IBcatService() : ServiceFramework("IBcatService") {
15 static const FunctionInfo functions[] = {
16 {10100, nullptr, "RequestSyncDeliveryCache"},
17 {10101, nullptr, "RequestSyncDeliveryCacheWithDirectoryName"},
18 {10200, nullptr, "CancelSyncDeliveryCacheRequest"},
19 {20100, nullptr, "RequestSyncDeliveryCacheWithApplicationId"},
20 {20101, nullptr, "RequestSyncDeliveryCacheWithApplicationIdAndDirectoryName"},
21 {30100, nullptr, "SetPassphrase"},
22 {30200, nullptr, "RegisterBackgroundDeliveryTask"},
23 {30201, nullptr, "UnregisterBackgroundDeliveryTask"},
24 {30202, nullptr, "BlockDeliveryTask"},
25 {30203, nullptr, "UnblockDeliveryTask"},
26 {90100, nullptr, "EnumerateBackgroundDeliveryTask"},
27 {90200, nullptr, "GetDeliveryList"},
28 {90201, nullptr, "ClearDeliveryCacheStorage"},
29 {90300, nullptr, "GetPushNotificationLog"},
30 };
31 RegisterHandlers(functions);
32 }
33};
34
35void Module::Interface::CreateBcatService(Kernel::HLERequestContext& ctx) {
36 IPC::ResponseBuilder rb{ctx, 2, 0, 1};
37 rb.Push(RESULT_SUCCESS);
38 rb.PushIpcInterface<IBcatService>();
39 NGLOG_DEBUG(Service_BCAT, "called");
40}
41
42Module::Interface::Interface(std::shared_ptr<Module> module, const char* name)
43 : ServiceFramework(name), module(std::move(module)) {}
44
45void InstallInterfaces(SM::ServiceManager& service_manager) {
46 auto module = std::make_shared<Module>();
47 std::make_shared<BCAT>(module, "bcat:a")->InstallAsService(service_manager);
48 std::make_shared<BCAT>(module, "bcat:m")->InstallAsService(service_manager);
49 std::make_shared<BCAT>(module, "bcat:u")->InstallAsService(service_manager);
50 std::make_shared<BCAT>(module, "bcat:s")->InstallAsService(service_manager);
51}
52
53} // namespace Service::BCAT
diff --git a/src/core/hle/service/bcat/module.h b/src/core/hle/service/bcat/module.h
new file mode 100644
index 000000000..8366fb877
--- /dev/null
+++ b/src/core/hle/service/bcat/module.h
@@ -0,0 +1,27 @@
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
7#include "core/hle/service/service.h"
8
9namespace Service::BCAT {
10
11class Module final {
12public:
13 class Interface : public ServiceFramework<Interface> {
14 public:
15 Interface(std::shared_ptr<Module> module, const char* name);
16
17 void CreateBcatService(Kernel::HLERequestContext& ctx);
18
19 protected:
20 std::shared_ptr<Module> module;
21 };
22};
23
24/// Registers all BCAT services with the specified service manager.
25void InstallInterfaces(SM::ServiceManager& service_manager);
26
27} // namespace Service::BCAT
diff --git a/src/core/hle/service/service.cpp b/src/core/hle/service/service.cpp
index 5b91089cf..409fec470 100644
--- a/src/core/hle/service/service.cpp
+++ b/src/core/hle/service/service.cpp
@@ -20,6 +20,7 @@
20#include "core/hle/service/aoc/aoc_u.h" 20#include "core/hle/service/aoc/aoc_u.h"
21#include "core/hle/service/apm/apm.h" 21#include "core/hle/service/apm/apm.h"
22#include "core/hle/service/audio/audio.h" 22#include "core/hle/service/audio/audio.h"
23#include "core/hle/service/bcat/bcat.h"
23#include "core/hle/service/fatal/fatal.h" 24#include "core/hle/service/fatal/fatal.h"
24#include "core/hle/service/filesystem/filesystem.h" 25#include "core/hle/service/filesystem/filesystem.h"
25#include "core/hle/service/friend/friend.h" 26#include "core/hle/service/friend/friend.h"
@@ -183,6 +184,7 @@ void Init(std::shared_ptr<SM::ServiceManager>& sm) {
183 AM::InstallInterfaces(*sm, nv_flinger); 184 AM::InstallInterfaces(*sm, nv_flinger);
184 AOC::InstallInterfaces(*sm); 185 AOC::InstallInterfaces(*sm);
185 APM::InstallInterfaces(*sm); 186 APM::InstallInterfaces(*sm);
187 BCAT::InstallInterfaces(*sm);
186 Audio::InstallInterfaces(*sm); 188 Audio::InstallInterfaces(*sm);
187 Fatal::InstallInterfaces(*sm); 189 Fatal::InstallInterfaces(*sm);
188 FileSystem::InstallInterfaces(*sm); 190 FileSystem::InstallInterfaces(*sm);