Browse Source

Service: Clean-up Interface

pull/15/merge
Yuri Kunde Schlesner 11 years ago
parent
commit
a79d21c83e
  1. 2
      src/core/hle/service/ac_u.cpp
  2. 2
      src/core/hle/service/act_u.cpp
  3. 2
      src/core/hle/service/am_app.cpp
  4. 2
      src/core/hle/service/am_net.cpp
  5. 2
      src/core/hle/service/am_sys.cpp
  6. 2
      src/core/hle/service/apt_a.cpp
  7. 2
      src/core/hle/service/apt_s.cpp
  8. 2
      src/core/hle/service/apt_u.cpp
  9. 2
      src/core/hle/service/boss_p.cpp
  10. 2
      src/core/hle/service/boss_u.cpp
  11. 2
      src/core/hle/service/cam_u.cpp
  12. 2
      src/core/hle/service/cecd_s.cpp
  13. 2
      src/core/hle/service/cecd_u.cpp
  14. 2
      src/core/hle/service/cfg/cfg_i.cpp
  15. 2
      src/core/hle/service/cfg/cfg_s.cpp
  16. 2
      src/core/hle/service/cfg/cfg_u.cpp
  17. 2
      src/core/hle/service/csnd_snd.cpp
  18. 2
      src/core/hle/service/dsp_dsp.cpp
  19. 2
      src/core/hle/service/err_f.cpp
  20. 2
      src/core/hle/service/frd_a.cpp
  21. 2
      src/core/hle/service/frd_u.cpp
  22. 2
      src/core/hle/service/fs/fs_user.cpp
  23. 2
      src/core/hle/service/gsp_gpu.cpp
  24. 2
      src/core/hle/service/gsp_lcd.cpp
  25. 2
      src/core/hle/service/hid/hid_spvr.cpp
  26. 2
      src/core/hle/service/hid/hid_user.cpp
  27. 2
      src/core/hle/service/http_c.cpp
  28. 2
      src/core/hle/service/ir_rst.cpp
  29. 2
      src/core/hle/service/ir_u.cpp
  30. 2
      src/core/hle/service/ldr_ro.cpp
  31. 2
      src/core/hle/service/mic_u.cpp
  32. 2
      src/core/hle/service/ndm_u.cpp
  33. 2
      src/core/hle/service/news_s.cpp
  34. 2
      src/core/hle/service/news_u.cpp
  35. 2
      src/core/hle/service/nim_aoc.cpp
  36. 2
      src/core/hle/service/ns_s.cpp
  37. 2
      src/core/hle/service/nwm_uds.cpp
  38. 2
      src/core/hle/service/pm_app.cpp
  39. 2
      src/core/hle/service/ptm_play.cpp
  40. 2
      src/core/hle/service/ptm_sysm.cpp
  41. 2
      src/core/hle/service/ptm_u.cpp
  42. 31
      src/core/hle/service/service.h
  43. 2
      src/core/hle/service/soc_u.cpp
  44. 2
      src/core/hle/service/srv.cpp
  45. 2
      src/core/hle/service/ssl_c.cpp
  46. 2
      src/core/hle/service/y2r_u.cpp

2
src/core/hle/service/ac_u.cpp

@ -53,7 +53,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/act_u.cpp

@ -18,7 +18,7 @@ namespace ACT_U {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/am_app.cpp

@ -18,7 +18,7 @@ namespace AM_APP {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/am_net.cpp

@ -38,7 +38,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/am_sys.cpp

@ -18,7 +18,7 @@ namespace AM_SYS {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/apt_a.cpp

@ -39,7 +39,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/apt_s.cpp

@ -117,7 +117,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/apt_u.cpp

@ -520,7 +520,7 @@ Interface::Interface() {
lock = Kernel::Mutex::Create(false, "APT_U:Lock").MoveFrom();
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/boss_p.cpp

@ -18,7 +18,7 @@ namespace BOSS_P {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/boss_u.cpp

@ -19,7 +19,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/cam_u.cpp

@ -18,7 +18,7 @@ namespace CAM_U {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/cecd_s.cpp

@ -18,7 +18,7 @@ namespace CECD_S {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/cecd_u.cpp

@ -18,7 +18,7 @@ namespace CECD_U {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/cfg/cfg_i.cpp

@ -104,7 +104,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/cfg/cfg_s.cpp

@ -92,7 +92,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/cfg/cfg_u.cpp

@ -186,7 +186,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/csnd_snd.cpp

@ -29,7 +29,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/dsp_dsp.cpp

@ -206,7 +206,7 @@ Interface::Interface() {
interrupt_event = nullptr;
read_pipe_count = 0;
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/err_f.cpp

@ -19,7 +19,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/frd_a.cpp

@ -18,7 +18,7 @@ namespace FRD_A {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/frd_u.cpp

@ -27,7 +27,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/fs/fs_user.cpp

@ -591,7 +591,7 @@ const FSUserInterface::FunctionInfo FunctionTable[] = {
// Interface class
FSUserInterface::FSUserInterface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace FS

2
src/core/hle/service/gsp_gpu.cpp

@ -389,7 +389,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
g_interrupt_event = 0;
g_shared_memory = 0;

2
src/core/hle/service/gsp_lcd.cpp

@ -20,7 +20,7 @@ namespace GSP_LCD {
// Interface class
Interface::Interface() {
//Register(FunctionTable, ARRAY_SIZE(FunctionTable));
//Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/hid/hid_spvr.cpp

@ -32,7 +32,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/hid/hid_user.cpp

@ -72,7 +72,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/http_c.cpp

@ -58,7 +58,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ir_rst.cpp

@ -22,7 +22,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ir_u.cpp

@ -36,7 +36,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ldr_ro.cpp

@ -27,7 +27,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/mic_u.cpp

@ -34,7 +34,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ndm_u.cpp

@ -24,7 +24,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/news_s.cpp

@ -19,7 +19,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/news_u.cpp

@ -19,7 +19,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/nim_aoc.cpp

@ -25,7 +25,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ns_s.cpp

@ -21,7 +21,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/nwm_uds.cpp

@ -26,7 +26,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/pm_app.cpp

@ -26,7 +26,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ptm_play.cpp

@ -22,7 +22,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ptm_sysm.cpp

@ -50,7 +50,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ptm_u.cpp

@ -137,7 +137,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
// Create the SharedExtSaveData archive 0xF000000B and the gamecoin.dat file
// TODO(Subv): In the future we should use the FS service to query this archive
std::string nand_directory = FileUtil::GetUserPath(D_NAND_IDX);

31
src/core/hle/service/service.h

@ -5,11 +5,12 @@
#pragma once
#include <algorithm>
#include <map>
#include <string>
#include <unordered_map>
#include <vector>
#include <boost/container/flat_map.hpp>
#include "common/common.h"
#include "common/string_util.h"
#include "core/mem_map.h"
@ -69,21 +70,6 @@ public:
return "[UNKNOWN SERVICE PORT]";
}
/// Allocates a new handle for the service
Handle CreateHandle(Kernel::Object *obj) {
// TODO(yuriks): Fix error reporting
Handle handle = Kernel::g_handle_table.Create(obj).ValueOr(INVALID_HANDLE);
m_handles.push_back(handle);
return handle;
}
/// Frees a handle from the service
template <class T>
void DeleteHandle(const Handle handle) {
Kernel::g_handle_table.Close(handle);
m_handles.erase(std::remove(m_handles.begin(), m_handles.end(), handle), m_handles.end());
}
ResultVal<bool> SyncRequest() override {
u32* cmd_buff = Kernel::GetCommandBuffer();
auto itr = m_functions.find(cmd_buff[0]);
@ -109,16 +95,17 @@ protected:
/**
* Registers the functions in the service
*/
void Register(const FunctionInfo* functions, int len) {
for (int i = 0; i < len; i++) {
m_functions[functions[i].id] = functions[i];
template <size_t N>
void Register(const FunctionInfo (&functions)[N]) {
m_functions.reserve(N);
for (auto& fn : functions) {
// Usually this array is sorted by id already, so hint to instead at the end
m_functions.emplace_hint(m_functions.cend(), fn.id, fn);
}
}
private:
std::vector<Handle> m_handles;
std::map<u32, FunctionInfo> m_functions;
boost::container::flat_map<u32, FunctionInfo> m_functions;
};

2
src/core/hle/service/soc_u.cpp

@ -734,7 +734,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
Interface::~Interface() {

2
src/core/hle/service/srv.cpp

@ -63,7 +63,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/ssl_c.cpp

@ -22,7 +22,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace

2
src/core/hle/service/y2r_u.cpp

@ -54,7 +54,7 @@ const Interface::FunctionInfo FunctionTable[] = {
// Interface class
Interface::Interface() {
Register(FunctionTable, ARRAY_SIZE(FunctionTable));
Register(FunctionTable);
}
} // namespace
Loading…
Cancel
Save