Add config option to disable exception vectors.

This commit is contained in:
Michael Scire
2017-06-07 17:36:53 -07:00
parent 427a05997d
commit 0694ea8367
6 changed files with 53 additions and 3 deletions

View File

@@ -0,0 +1,36 @@
#pragma once
#include "types.h"
#define MAKE_BRANCH(src,dst) (0xEA000000 | ((u32)((((u8 *)(dst) - (u8 *)(src)) >> 2) - 2) & 0xFFFFFF))
#define MAKE_BRANCH_LINK(src,dst) (0xEB000000 | ((u32)((((u8 *)(dst) - (u8 *)(src)) >> 2) - 2) & 0xFFFFFF))
#define CONFIG(a) (((cfwInfo.config >> (a + 17)) & 1) != 0)
#define MULTICONFIG(a) ((cfwInfo.config >> (a * 2 + 7)) & 3)
#define BOOTCONFIG(a, b) ((cfwInfo.config >> a) & b)
#define BOOTCFG_NAND BOOTCONFIG(0, 7)
#define BOOTCFG_FIRM BOOTCONFIG(3, 7)
#define BOOTCFG_NOFORCEFLAG BOOTCONFIG(6, 1)
enum multiOptions
{
DEFAULTEMU = 0,
BRIGHTNESS,
SPLASH,
PIN,
NEWCPU
};
enum singleOptions
{
AUTOBOOTEMU = 0,
USEEMUFIRM,
LOADEXTFIRMSANDMODULES,
PATCHGAMES,
PATCHVERSTRING,
SHOWGBABOOT,
PATCHACCESS,
PATCHUNITINFO,
DISABLEVECTORS
};

View File

@@ -26,6 +26,7 @@
#pragma once
#include "config.h"
#include "kernel.h"
extern KRecursiveLock *criticalSectionLock;

View File

@@ -35,6 +35,8 @@
bool isExceptionFatal(u32 spsr, u32 *regs, u32 index)
{
if (CONFIG(DISABLEVECTORS)) return false;
if((spsr & 0x1f) != 0x10) return true;
KThread *thread = currentCoreContext->objectContext.currentThread;