Fix games like Paper Mario Color Splash from crashing with the message "Kernel copy thread stack allocation failed"
This commit is contained in:
parent
029bb4b14e
commit
c276347b62
@ -67,21 +67,25 @@ int kernelCopyService(int argc, void *argv) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// This is here to avoid the warning
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void startKernelCopyService() {
|
void startKernelCopyService() {
|
||||||
unsigned int stack = (unsigned int) memalign(0x40, 0x100);
|
unsigned int stack = (unsigned int) memalign(0x40, 0x100);
|
||||||
ASSERT_ALLOCATED(stack, "Kernel copy thread stack")
|
|
||||||
stack += 0x100;
|
|
||||||
void *thread = memalign(0x40, 0x1000);
|
|
||||||
ASSERT_ALLOCATED(thread, "Kernel copy thread")
|
|
||||||
|
|
||||||
int status = OSCreateThread(thread, kernelCopyService, 1, NULL, (u32) stack + sizeof(stack), sizeof(stack), 31,
|
if (stack != 0) {
|
||||||
OS_THREAD_ATTR_AFFINITY_CORE1 | OS_THREAD_ATTR_PINNED_AFFINITY | OS_THREAD_ATTR_DETACH);
|
stack += 0x100;
|
||||||
ASSERT_INTEGER(status, 1, "Creating kernel copy thread")
|
void *thread = memalign(0x40, 0x1000);
|
||||||
// OSSetThreadName(thread, "Kernel Copier");
|
ASSERT_ALLOCATED(thread, "Kernel copy thread")
|
||||||
OSResumeThread(thread);
|
|
||||||
|
int status = OSCreateThread(thread, kernelCopyService, 1, NULL, (u32) stack + sizeof(stack), sizeof(stack), 31,
|
||||||
|
OS_THREAD_ATTR_AFFINITY_CORE1 | OS_THREAD_ATTR_PINNED_AFFINITY |
|
||||||
|
OS_THREAD_ATTR_DETACH);
|
||||||
|
ASSERT_INTEGER(status, 1, "Creating kernel copy thread")
|
||||||
|
// OSSetThreadName(thread, "Kernel Copier");
|
||||||
|
OSResumeThread(thread);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#define MINIMUM_KERNEL_COMPARE_LENGTH 4
|
#define MINIMUM_KERNEL_COMPARE_LENGTH 4
|
||||||
|
BIN
tcpgecko.elf
BIN
tcpgecko.elf
Binary file not shown.
Loading…
Reference in New Issue
Block a user