Reorganize the ndm service path for dummy implement function

SuspendDaemons , ResumeDaemons , OverrideDefaultDaemons

The NDM file move to /core/hle/service/ndm/ now!
This commit is contained in:
JamePeng 2016-02-14 19:53:32 +08:00
parent a2024d7497
commit dd0b8047eb
8 changed files with 124 additions and 26 deletions

View file

@ -0,0 +1,47 @@
// Copyright 2016 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "common/common_types.h"
#include "common/logging/log.h"
#include "core/hle/service/service.h"
#include "core/hle/service/ndm/ndm.h"
#include "core/hle/service/ndm/ndm_u.h"
namespace Service {
namespace NDM {
void SuspendDaemons(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
}
void ResumeDaemons(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
}
void OverrideDefaultDaemons(Service::Interface* self) {
u32* cmd_buff = Kernel::GetCommandBuffer();
LOG_WARNING(Service_NDM, "(STUBBED) bit_mask=0x%08X ", cmd_buff[1]);
cmd_buff[1] = RESULT_SUCCESS.raw; // No error
}
void Init() {
AddService(new NDM_U_Interface);
}
void Shutdown() {
}
}// namespace NDM
}// namespace Service

View file

@ -0,0 +1,52 @@
// Copyright 2016 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#pragma once
#include "common/common_types.h"
namespace Service {
class Interface;
namespace NDM {
/**
* SuspendDaemons
* Inputs:
* 0 : Command header (0x00020082)
* 1 : Daemon bit mask
* Outputs:
* 1 : Result, 0 on success, otherwise error code
*/
void SuspendDaemons(Service::Interface* self);
/**
* ResumeDaemons
* Inputs:
* 0 : Command header (0x00020082)
* 1 : Daemon bit mask
* Outputs:
* 1 : Result, 0 on success, otherwise error code
*/
void ResumeDaemons(Service::Interface* self);
/**
* OverrideDefaultDaemons
* Inputs:
* 0 : Command header (0x00020082)
* 1 : Daemon bit mask
* Outputs:
* 1 : Result, 0 on success, otherwise error code
*/
void OverrideDefaultDaemons(Service::Interface* self);
/// Initialize NDM service
void Init();
/// Shutdown NDM service
void Shutdown();
}// namespace NDM
}// namespace Service

View file

@ -0,0 +1,42 @@
// Copyright 2014 Citra Emulator Project
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
#include "core/hle/service/ndm/ndm.h"
#include "core/hle/service/ndm/ndm_u.h"
namespace Service {
namespace NDM {
const Interface::FunctionInfo FunctionTable[] = {
{0x00010042, nullptr, "EnterExclusiveState"},
{0x00020002, nullptr, "LeaveExclusiveState"},
{0x00030000, nullptr, "QueryExclusiveMode"},
{0x00040002, nullptr, "LockState"},
{0x00050002, nullptr, "UnlockState"},
{0x00060040, SuspendDaemons, "SuspendDaemons"},
{0x00070040, ResumeDaemons, "ResumeDaemons"},
{0x00080040, nullptr, "DisableWifiUsage"},
{0x00090000, nullptr, "EnableWifiUsage"},
{0x000A0000, nullptr, "GetCurrentState"},
{0x000B0000, nullptr, "GetTargetState"},
{0x000C0000, nullptr, "<Stubbed>"},
{0x000D0040, nullptr, "QueryStatus"},
{0x000E0040, nullptr, "GetDaemonDisableCount"},
{0x000F0000, nullptr, "GetSchedulerDisableCount"},
{0x00100040, nullptr, "SetScanInterval"},
{0x00110000, nullptr, "GetScanInterval"},
{0x00120040, nullptr, "SetRetryInterval"},
{0x00130000, nullptr, "GetRetryInterval"},
{0x00140040, OverrideDefaultDaemons, "OverrideDefaultDaemons"},
{0x00150000, nullptr, "ResetDefaultDaemons"},
{0x00160000, nullptr, "GetDefaultDaemons"},
{0x00170000, nullptr, "ClearHalfAwakeMacFilter"},
};
NDM_U_Interface::NDM_U_Interface() {
Register(FunctionTable);
}
} // namespace NDM
} // 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 NDM {
class NDM_U_Interface : public Service::Interface {
public:
NDM_U_Interface();
std::string GetPortName() const override {
return "ndm:u";
}
};
} // namespace NDM
} // namespace Service