mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-04 11:45:18 +02:00
Thread: Default to kernel threads from kernel.
This is an experiment. In most cases, allowKernel will be false.
This commit is contained in:
committed by
sum2012
parent
104bf3915e
commit
e8b651fbd6
@@ -66,7 +66,8 @@
|
||||
#include "GPU/GPUState.h"
|
||||
|
||||
enum {
|
||||
PSP_THREAD_ATTR_USER = 0x80000000
|
||||
PSP_THREAD_ATTR_KERNEL = 0x00001000,
|
||||
PSP_THREAD_ATTR_USER = 0x80000000,
|
||||
};
|
||||
|
||||
enum {
|
||||
@@ -1593,6 +1594,7 @@ static void __KernelStartModule(PSPModule *m, int args, const char *argp, SceKer
|
||||
currentMIPS->pc = m->nm.module_start_func;
|
||||
}
|
||||
|
||||
WARN_LOG(SCEKERNEL, "Root thread attr: %08x", options->attribute);
|
||||
SceUID threadID = __KernelSetupRootThread(m->GetUID(), args, argp, options->priority, options->stacksize, options->attribute);
|
||||
__KernelSetThreadRA(threadID, NID_MODULERETURN);
|
||||
}
|
||||
@@ -1608,6 +1610,16 @@ u32 __KernelGetModuleGP(SceUID uid) {
|
||||
}
|
||||
}
|
||||
|
||||
bool KernelModuleIsKernelMode(SceUID uid) {
|
||||
u32 error;
|
||||
PSPModule *module = kernelObjects.Get<PSPModule>(uid, error);
|
||||
if (module) {
|
||||
return (module->nm.attribute & 0x1000) != 0;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void __KernelLoadReset() {
|
||||
// Wipe kernel here, loadexec should reset the entire system
|
||||
if (__KernelIsRunning()) {
|
||||
|
||||
Reference in New Issue
Block a user