Merge pull request #855 from purpasmart96/service_rearrangment

Services: Continue separation of services into their own folders
This commit is contained in:
bunnei 2015-06-21 10:55:02 -04:00
commit 9850f98339
75 changed files with 1190 additions and 637 deletions

View file

@ -37,6 +37,7 @@ namespace Log {
SUB(Service, APT) \
SUB(Service, GSP) \
SUB(Service, AC) \
SUB(Service, AM) \
SUB(Service, PTM) \
SUB(Service, LDR) \
SUB(Service, NIM) \

View file

@ -57,13 +57,14 @@ enum class Class : ClassType {
Service_APT, ///< The APT (Applets) service
Service_GSP, ///< The GSP (GPU control) service
Service_AC, ///< The AC (WiFi status) service
Service_AM, ///< The AM (Application manager) service
Service_PTM, ///< The PTM (Power status & misc.) service
Service_LDR, ///< The LDR (3ds dll loader) service
Service_NIM, ///< The NIM (Network interface manager) service
Service_NWM, ///< The NWM (Network manager) service
Service_NWM, ///< The NWM (Network wlan manager) service
Service_CFG, ///< The CFG (Configuration) service
Service_DSP, ///< The DSP (DSP control) service
Service_HID, ///< The HID (User input) service
Service_HID, ///< The HID (Human interface device) service
Service_SOC, ///< The SOC (Socket) service
Service_Y2R, ///< The Y2R (YUV to RGB conversion) service
HW, ///< Low-level hardware emulation

View file

@ -39,18 +39,26 @@ set(SRCS
hle/kernel/vm_manager.cpp
hle/service/ac_u.cpp
hle/service/act_u.cpp
hle/service/am_app.cpp
hle/service/am_net.cpp
hle/service/am_sys.cpp
hle/service/am/am.cpp
hle/service/am/am_app.cpp
hle/service/am/am_net.cpp
hle/service/am/am_sys.cpp
hle/service/am/am_u.cpp
hle/service/apt/apt.cpp
hle/service/apt/apt_a.cpp
hle/service/apt/apt_s.cpp
hle/service/apt/apt_u.cpp
hle/service/boss_p.cpp
hle/service/boss_u.cpp
hle/service/cam_u.cpp
hle/service/cecd_s.cpp
hle/service/cecd_u.cpp
hle/service/boss/boss.cpp
hle/service/boss/boss_p.cpp
hle/service/boss/boss_u.cpp
hle/service/cam/cam.cpp
hle/service/cam/cam_c.cpp
hle/service/cam/cam_q.cpp
hle/service/cam/cam_s.cpp
hle/service/cam/cam_u.cpp
hle/service/cecd/cecd.cpp
hle/service/cecd/cecd_s.cpp
hle/service/cecd/cecd_u.cpp
hle/service/cfg/cfg.cpp
hle/service/cfg/cfg_i.cpp
hle/service/cfg/cfg_s.cpp
@ -58,8 +66,9 @@ set(SRCS
hle/service/csnd_snd.cpp
hle/service/dsp_dsp.cpp
hle/service/err_f.cpp
hle/service/frd_a.cpp
hle/service/frd_u.cpp
hle/service/frd/frd.cpp
hle/service/frd/frd_a.cpp
hle/service/frd/frd_u.cpp
hle/service/fs/archive.cpp
hle/service/fs/fs_user.cpp
hle/service/gsp_gpu.cpp
@ -75,10 +84,13 @@ set(SRCS
hle/service/ldr_ro.cpp
hle/service/mic_u.cpp
hle/service/ndm_u.cpp
hle/service/news_s.cpp
hle/service/news_u.cpp
hle/service/nim_aoc.cpp
hle/service/nim_u.cpp
hle/service/news/news.cpp
hle/service/news/news_s.cpp
hle/service/news/news_u.cpp
hle/service/nim/nim.cpp
hle/service/nim/nim_aoc.cpp
hle/service/nim/nim_s.cpp
hle/service/nim/nim_u.cpp
hle/service/ns_s.cpp
hle/service/nwm_uds.cpp
hle/service/pm_app.cpp
@ -152,18 +164,26 @@ set(HEADERS
hle/result.h
hle/service/ac_u.h
hle/service/act_u.h
hle/service/am_app.h
hle/service/am_net.h
hle/service/am_sys.h
hle/service/am/am.h
hle/service/am/am_app.h
hle/service/am/am_net.h
hle/service/am/am_sys.h
hle/service/am/am_u.h
hle/service/apt/apt.h
hle/service/apt/apt_a.h
hle/service/apt/apt_s.h
hle/service/apt/apt_u.h
hle/service/boss_p.h
hle/service/boss_u.h
hle/service/cam_u.h
hle/service/cecd_s.h
hle/service/cecd_u.h
hle/service/boss/boss.h
hle/service/boss/boss_p.h
hle/service/boss/boss_u.h
hle/service/cam/cam.h
hle/service/cam/cam_c.h
hle/service/cam/cam_q.h
hle/service/cam/cam_s.h
hle/service/cam/cam_u.h
hle/service/cecd/cecd.h
hle/service/cecd/cecd_s.h
hle/service/cecd/cecd_u.h
hle/service/cfg/cfg.h
hle/service/cfg/cfg_i.h
hle/service/cfg/cfg_s.h
@ -171,8 +191,9 @@ set(HEADERS
hle/service/csnd_snd.h
hle/service/dsp_dsp.h
hle/service/err_f.h
hle/service/frd_a.h
hle/service/frd_u.h
hle/service/frd/frd.h
hle/service/frd/frd_a.h
hle/service/frd/frd_u.h
hle/service/fs/archive.h
hle/service/fs/fs_user.h
hle/service/gsp_gpu.h
@ -188,10 +209,13 @@ set(HEADERS
hle/service/ldr_ro.h
hle/service/mic_u.h
hle/service/ndm_u.h
hle/service/news_s.h
hle/service/news_u.h
hle/service/nim_aoc.h
hle/service/nim_u.h
hle/service/news/news.h
hle/service/news/news_s.h
hle/service/news/news_u.h
hle/service/nim/nim.h
hle/service/nim/nim_aoc.h
hle/service/nim/nim_s.h
hle/service/nim/nim_u.h
hle/service/ns_s.h
hle/service/nwm_uds.h
hle/service/pm_app.h

View file

@ -0,0 +1,55 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/logging/log.h"
#include "core/hle/service/service.h"
#include "core/hle/service/am/am_app.h"
#include "core/hle/service/am/am_net.h"
#include "core/hle/service/am/am_sys.h"
#include "core/hle/hle.h"
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/shared_memory.h"
namespace Service {
namespace AM {
void TitleIDListGetTotal(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 media_type = cmd_buff[1] & 0xFF;
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = 0;
LOG_WARNING(Service_AM, "(STUBBED) media_type %u", media_type);
}
void GetTitleIDList(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 num_titles = cmd_buff[1];
u32 media_type = cmd_buff[2] & 0xFF;
u32 addr = cmd_buff[4];
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = 0;
LOG_WARNING(Service_AM, "(STUBBED) Requested %u titles from media type %u", num_titles, media_type);
}
void Init() {
using namespace Kernel;
AddService(new AM_APP_Interface);
AddService(new AM_NET_Interface);
AddService(new AM_SYS_Interface);
}
void Shutdown() {
}
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,47 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/service.h"
namespace Service {
namespace AM {
/**
* AM::TitleIDListGetTotal service function
* Gets the number of installed titles in the requested media type
* Inputs:
* 0 : Command header (0x00010040)
* 1 : Media type to load the titles from
* Outputs:
* 1 : Result, 0 on success, otherwise error code
* 2 : The number of titles in the requested media type
*/
void TitleIDListGetTotal(Service::Interface* self);
/**
* AM::GetTitleIDList service function
* Loads information about the desired number of titles from the desired media type into an array
* Inputs:
* 0 : Command header (0x00020082)
* 1 : The maximum number of titles to load
* 2 : Media type to load the titles from
* 3 : Descriptor of the output buffer pointer
* 4 : Address of the output buffer
* Outputs:
* 1 : Result, 0 on success, otherwise error code
* 2 : The number of titles loaded from the requested media type
*/
void GetTitleIDList(Service::Interface* self);
/// Initialize AM service
void Init();
/// Shutdown AM service
void Shutdown();
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,20 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/hle.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/am_app.h"
namespace Service {
namespace AM {
// Empty arrays are illegal -- commented out until an entry is added.
//const Interface::FunctionInfo FunctionTable[] = { };
AM_APP_Interface::AM_APP_Interface() {
//Register(FunctionTable);
}
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,22 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included..
#pragma once
#include "core/hle/service/service.h"
namespace Service {
namespace AM {
class AM_APP_Interface : public Service::Interface {
public:
AM_APP_Interface();
std::string GetPortName() const override {
return "am:app";
}
};
} // namespace AM
} // namespace Service

View file

@ -3,12 +3,11 @@
// Refer to the license.txt file included.
#include "core/hle/hle.h"
#include "core/hle/service/am_net.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/am_net.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace AM_NET
namespace AM_NET {
namespace Service {
namespace AM {
const Interface::FunctionInfo FunctionTable[] = {
{0x08010000, nullptr, "OpenTicket"},
@ -33,11 +32,9 @@ const Interface::FunctionInfo FunctionTable[] = {
{0x081B00C2, nullptr, "InstallTitlesFinish"},
};
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::Interface() {
AM_NET_Interface::AM_NET_Interface() {
Register(FunctionTable);
}
} // namespace
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,22 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included..
#pragma once
#include "core/hle/service/service.h"
namespace Service {
namespace AM {
class AM_NET_Interface : public Service::Interface {
public:
AM_NET_Interface();
std::string GetPortName() const override {
return "am:net";
}
};
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,22 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/hle.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/am_sys.h"
namespace Service {
namespace AM {
const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
{0x00020082, GetTitleIDList, "GetTitleIDList"},
};
AM_SYS_Interface::AM_SYS_Interface() {
Register(FunctionTable);
}
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,22 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included..
#pragma once
#include "core/hle/service/service.h"
namespace Service {
namespace AM {
class AM_SYS_Interface : public Service::Interface {
public:
AM_SYS_Interface();
std::string GetPortName() const override {
return "am:sys";
}
};
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,22 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/hle.h"
#include "core/hle/service/am/am.h"
#include "core/hle/service/am/am_u.h"
namespace Service {
namespace AM {
const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
{0x00020082, GetTitleIDList, "GetTitleIDList"},
};
AM_U_Interface::AM_U_Interface() {
Register(FunctionTable);
}
} // namespace AM
} // namespace Service

View file

@ -0,0 +1,22 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included..
#pragma once
#include "core/hle/service/service.h"
namespace Service {
namespace AM {
class AM_U_Interface : public Service::Interface {
public:
AM_U_Interface();
std::string GetPortName() const override {
return "am:u";
}
};
} // namespace AM
} // namespace Service

View file

@ -1,23 +0,0 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/hle.h"
#include "core/hle/service/am_app.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace AM_APP
namespace AM_APP {
// Empty arrays are illegal -- commented out until an entry is added.
//const Interface::FunctionInfo FunctionTable[] = { };
////////////////////////////////////////////////////////////////////////////////////////////////////
// Interface class
Interface::Interface() {
//Register(FunctionTable);
}
} // namespace

View file

@ -1,23 +0,0 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace AM_APP
namespace AM_APP {
class Interface : public Service::Interface {
public:
Interface();
std::string GetPortName() const override {
return "am:app";
}
};
} // namespace

View file

@ -1,23 +0,0 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace AM_NET
namespace AM_NET {
class Interface : public Service::Interface {
public:
Interface();
std::string GetPortName() const override {
return "am:net";
}
};
} // namespace

View file

@ -1,62 +0,0 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/logging/log.h"
#include "core/hle/hle.h"
#include "core/hle/service/am_sys.h"
namespace AM_SYS {
/**
* Gets the number of installed titles in the requested media type
* Inputs:
* 0: Command header (0x00010040)
* 1: Media type to load the titles from
* Outputs:
* 1: Result, 0 on success, otherwise error code
* 2: The number of titles in the requested media type
*/
static void TitleIDListGetTotal(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 media_type = cmd_buff[1] & 0xFF;
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = 0;
LOG_WARNING(Service_CFG, "(STUBBED) media_type %u", media_type);
}
/**
* Loads information about the desired number of titles from the desired media type into an array
* Inputs:
* 0: Command header (0x00020082)
* 1: The maximum number of titles to load
* 2: Media type to load the titles from
* 3: Descriptor of the output buffer pointer
* 4: Address of the output buffer
* Outputs:
* 1: Result, 0 on success, otherwise error code
* 2: The number of titles loaded from the requested media type
*/
static void GetTitleIDList(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
u32 num_titles = cmd_buff[1];
u32 media_type = cmd_buff[2] & 0xFF;
u32 addr = cmd_buff[4];
cmd_buff[1] = RESULT_SUCCESS.raw;
cmd_buff[2] = 0;
LOG_WARNING(Service_CFG, "(STUBBED) Requested %u titles from media type %u", num_titles, media_type);
}
const Interface::FunctionInfo FunctionTable[] = {
{0x00010040, TitleIDListGetTotal, "TitleIDListGetTotal"},
{0x00020082, GetTitleIDList, "GetTitleIDList"},
};
Interface::Interface() {
Register(FunctionTable);
}
} // namespace

View file

@ -1,23 +0,0 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/service/service.h"
////////////////////////////////////////////////////////////////////////////////////////////////////
// Namespace AM_SYS
namespace AM_SYS {
class Interface : public Service::Interface {
public:
Interface();
std::string GetPortName() const override {
return "am:sys";
}
};
} // namespace

View file

@ -0,0 +1,29 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/service/service.h"
#include "core/hle/service/boss/boss.h"
#include "core/hle/service/boss/boss_p.h"
#include "core/hle/service/boss/boss_u.h"
#include "core/hle/kernel/event.h"
#include "core/hle/kernel/shared_memory.h"
#include "core/hle/hle.h"
namespace Service {
namespace BOSS {
void Init() {
using namespace Kernel;
AddService(new BOSS_P_Interface);
AddService(new BOSS_U_Interface);
}
void Shutdown() {
}
} // namespace BOSS
} // namespace Service

View file

@ -0,0 +1,20 @@
// Copyright 2015 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "core/hle/kernel/kernel.h"
#include "core/hle/service/service.h"
namespace Service {
namespace BOSS {
/// Initialize BOSS service(s)
void Init();
/// Shutdown BOSS service(s)
void Shutdown();
} // namespace BOSS
} // namespace Service

Some files were not shown because too many files have changed in this diff Show more