diff --git a/src/system/kernel.h b/src/system/kernel.h index e3e631b..30f9d8c 100644 --- a/src/system/kernel.h +++ b/src/system/kernel.h @@ -67,21 +67,25 @@ int kernelCopyService(int argc, void *argv) { } } + // This is here to avoid the warning return 0; } void startKernelCopyService() { 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, - 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); + if (stack != 0) { + 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, + 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 diff --git a/tcpgecko.elf b/tcpgecko.elf index 236eefd..703d973 100644 Binary files a/tcpgecko.elf and b/tcpgecko.elf differ