stratosphere: remove trailing whitespace
This commit is contained in:
@@ -24,9 +24,9 @@ Result BpcAtmosphereService::RebootToFatalError(InBuffer<AtmosphereFatalErrorCon
|
||||
if (ctx.buffer == nullptr || ctx.num_elements != 1) {
|
||||
return ResultKernelConnectionClosed;
|
||||
}
|
||||
|
||||
|
||||
/* Reboot to fusee with the input context. */
|
||||
BpcRebootManager::RebootForFatalError(ctx.buffer);
|
||||
|
||||
|
||||
return ResultSuccess;
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
@@ -30,7 +30,7 @@ class BpcMitmService : public IMitmServiceObject {
|
||||
BpcMitmService(std::shared_ptr<Service> s, u64 pid) : IMitmServiceObject(s, pid) {
|
||||
/* ... */
|
||||
}
|
||||
|
||||
|
||||
static bool ShouldMitm(u64 pid, u64 tid) {
|
||||
/* We will mitm:
|
||||
* - am, to intercept the Reboot/Power buttons in the overlay menu.
|
||||
@@ -39,9 +39,9 @@ class BpcMitmService : public IMitmServiceObject {
|
||||
*/
|
||||
return tid == TitleId_Am || tid == TitleId_Fatal || TitleIdIsApplication(tid) || Utils::IsHblTid(tid);
|
||||
}
|
||||
|
||||
|
||||
static void PostProcess(IMitmServiceObject *obj, IpcResponseContext *ctx);
|
||||
|
||||
|
||||
protected:
|
||||
/* Overridden commands. */
|
||||
Result ShutdownSystem();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <cstdlib>
|
||||
#include <cstdint>
|
||||
#include <cstring>
|
||||
@@ -33,13 +33,13 @@
|
||||
void BpcMitmMain(void *arg) {
|
||||
/* Wait for initialization to occur */
|
||||
Utils::WaitSdInitialized();
|
||||
|
||||
|
||||
/* Load a payload off of the SD */
|
||||
BpcRebootManager::Initialize();
|
||||
|
||||
|
||||
/* Create server manager */
|
||||
auto server_manager = new WaitableManager(2);
|
||||
|
||||
|
||||
/* Create bpc mitm. */
|
||||
const char *service_name = "bpc";
|
||||
if (GetRuntimeFirmwareVersion() < FirmwareVersion_200) {
|
||||
@@ -53,8 +53,8 @@ void BpcMitmMain(void *arg) {
|
||||
|
||||
/* Loop forever, servicing our services. */
|
||||
server_manager->Process();
|
||||
|
||||
|
||||
delete server_manager;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
#include <strings.h>
|
||||
@@ -33,16 +33,16 @@ void BpcRebootManager::Initialize() {
|
||||
return;
|
||||
}
|
||||
ON_SCOPE_EXIT { fsFileClose(&payload_file); };
|
||||
|
||||
|
||||
/* Clear payload buffer */
|
||||
std::memset(g_reboot_payload, 0xFF, sizeof(g_reboot_payload));
|
||||
|
||||
|
||||
/* Read payload file. */
|
||||
size_t actual_size;
|
||||
fsFileRead(&payload_file, 0, g_reboot_payload, IRAM_PAYLOAD_MAX_SIZE, FS_READOPTION_NONE, &actual_size);
|
||||
|
||||
|
||||
g_payload_loaded = true;
|
||||
|
||||
|
||||
/* Figure out what kind of reboot we're gonna be doing. */
|
||||
{
|
||||
char reboot_type[0x40] = {0};
|
||||
@@ -62,7 +62,7 @@ void BpcRebootManager::Initialize() {
|
||||
static void ClearIram() {
|
||||
/* Make page FFs. */
|
||||
memset(g_work_page, 0xFF, sizeof(g_work_page));
|
||||
|
||||
|
||||
/* Overwrite all of IRAM with FFs. */
|
||||
for (size_t ofs = 0; ofs < IRAM_SIZE; ofs += sizeof(g_work_page)) {
|
||||
CopyToIram(IRAM_BASE + ofs, g_work_page, sizeof(g_work_page));
|
||||
@@ -74,15 +74,15 @@ static void DoRebootToPayload() {
|
||||
if (!g_payload_loaded) {
|
||||
RebootToRcm();
|
||||
}
|
||||
|
||||
|
||||
/* Ensure clean IRAM state. */
|
||||
ClearIram();
|
||||
|
||||
|
||||
/* Copy in payload. */
|
||||
for (size_t ofs = 0; ofs < sizeof(g_reboot_payload); ofs += 0x1000) {
|
||||
CopyToIram(IRAM_PAYLOAD_BASE + ofs, &g_reboot_payload[ofs], 0x1000);
|
||||
}
|
||||
|
||||
|
||||
RebootToIramPayload();
|
||||
}
|
||||
|
||||
@@ -103,16 +103,16 @@ Result BpcRebootManager::PerformReboot() {
|
||||
void BpcRebootManager::RebootForFatalError(AtmosphereFatalErrorContext *ctx) {
|
||||
/* Ensure clean IRAM state. */
|
||||
ClearIram();
|
||||
|
||||
|
||||
|
||||
|
||||
/* Copy in payload. */
|
||||
for (size_t ofs = 0; ofs < sizeof(g_reboot_payload); ofs += 0x1000) {
|
||||
CopyToIram(IRAM_PAYLOAD_BASE + ofs, &g_reboot_payload[ofs], 0x1000);
|
||||
}
|
||||
|
||||
|
||||
memcpy(g_work_page, ctx, sizeof(*ctx));
|
||||
CopyToIram(IRAM_PAYLOAD_BASE + IRAM_PAYLOAD_MAX_SIZE, g_work_page, sizeof(g_work_page));
|
||||
|
||||
|
||||
/* If we don't actually have a payload loaded, just go to RCM. */
|
||||
if (!g_payload_loaded) {
|
||||
RebootToRcm();
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
|
||||
#pragma once
|
||||
#include <switch.h>
|
||||
#include <stratosphere.hpp>
|
||||
|
||||
Reference in New Issue
Block a user