ams.mitm: simplify bpc ShouldMitm logic, fix enum problem

This commit is contained in:
Michael Scire 2019-02-04 21:47:55 -08:00
parent 784964d49d
commit e2a7f23214
2 changed files with 5 additions and 2 deletions

View file

@ -21,7 +21,8 @@ enum MitmModuleId : u32 {
MitmModuleId_SetMitm = 1, MitmModuleId_SetMitm = 1,
MitmModuleId_BpcMitm = 2, MitmModuleId_BpcMitm = 2,
MitmModuleId_Count = 3, /* Always keep this at the end. */
MitmModuleId_Count,
}; };
void LaunchAllMitmModules(); void LaunchAllMitmModules();

View file

@ -18,6 +18,8 @@
#include <switch.h> #include <switch.h>
#include <stratosphere.hpp> #include <stratosphere.hpp>
#include "../utils.hpp"
enum BpcCmd : u32 { enum BpcCmd : u32 {
BpcCmd_ShutdownSystem = 0, BpcCmd_ShutdownSystem = 0,
BpcCmd_RebootSystem = 1, BpcCmd_RebootSystem = 1,
@ -35,7 +37,7 @@ class BpcMitmService : public IMitmServiceObject {
* - fatal, to simplify payload reboot logic significantly * - fatal, to simplify payload reboot logic significantly
* - applications, to allow homebrew to take advantage of the feature. * - applications, to allow homebrew to take advantage of the feature.
*/ */
return tid == 0x0100000000000023ull || tid == 0x0100000000000034ull || tid >= 0x0100000000010000ull; return tid == 0x0100000000000023ull || tid == 0x0100000000000034ull || Utils::IsHblTid(tid);
} }
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx); static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);