From 7cdb70505944b2ed456d7f5376594e05f3b3357f Mon Sep 17 00:00:00 2001 From: bunnei Date: Fri, 16 May 2014 23:48:15 -0400 Subject: - replaced KERNELOBJECT_MAX_NAME_LENGTH with KERNEL_MAX_NAME_LENGTH - added KERNEL_DEFAULT_STACK_SIZE definition (0x4000) --- src/core/hle/kernel/kernel.h | 5 ++--- src/core/hle/kernel/thread.cpp | 9 +++++---- src/core/hle/kernel/thread.h | 6 +++++- 3 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src/core') diff --git a/src/core/hle/kernel/kernel.h b/src/core/hle/kernel/kernel.h index 24d422682..2608eecc9 100644 --- a/src/core/hle/kernel/kernel.h +++ b/src/core/hle/kernel/kernel.h @@ -16,11 +16,10 @@ enum KernelIDType { }; enum { - KERNELOBJECT_MAX_NAME_LENGTH = 255, + KERNEL_MAX_NAME_LENGTH = 0x100, + KERNEL_DEFAULT_STACK_SIZE = 0x4000, }; -#define KERNELOBJECT_MAX_NAME_LENGTH 31 - class KernelObjectPool; class KernelObject { diff --git a/src/core/hle/kernel/thread.cpp b/src/core/hle/kernel/thread.cpp index 833a1b4ba..76a73747d 100644 --- a/src/core/hle/kernel/thread.cpp +++ b/src/core/hle/kernel/thread.cpp @@ -81,7 +81,7 @@ public: WaitType wait_type; - char name[KERNELOBJECT_MAX_NAME_LENGTH+1]; + char name[KERNEL_MAX_NAME_LENGTH+1]; }; // Lists all thread ids that aren't deleted/etc. @@ -165,7 +165,8 @@ void __KernelResetThread(Thread *t, s32 lowest_priority) { } /// Creates a new thread -Thread *__KernelCreateThread(Handle &handle, const char *name, u32 entry_point, s32 priority, s32 processor_id, u32 stack_top, int stack_size=0x4000) { +Thread *__KernelCreateThread(Handle &handle, const char *name, u32 entry_point, s32 priority, + s32 processor_id, u32 stack_top, int stack_size) { static u32 _handle_count = 1; Thread *t = new Thread; @@ -183,8 +184,8 @@ Thread *__KernelCreateThread(Handle &handle, const char *name, u32 entry_point, t->processor_id = processor_id; t->wait_type = WAITTYPE_NONE; - strncpy(t->name, name, KERNELOBJECT_MAX_NAME_LENGTH); - t->name[KERNELOBJECT_MAX_NAME_LENGTH] = '\0'; + strncpy(t->name, name, KERNEL_MAX_NAME_LENGTH); + t->name[KERNEL_MAX_NAME_LENGTH] = '\0'; return t; } diff --git a/src/core/hle/kernel/thread.h b/src/core/hle/kernel/thread.h index cca4e85fd..add6107d7 100644 --- a/src/core/hle/kernel/thread.h +++ b/src/core/hle/kernel/thread.h @@ -9,8 +9,12 @@ class Thread; +/// Creates a new thread +Thread *__KernelCreateThread(Handle &handle, const char *name, u32 entry_point, s32 priority, + s32 processor_id, u32 stack_top, int stack_size=KERNEL_DEFAULT_STACK_SIZE); + /// Sets up the primary application thread -Handle __KernelSetupMainThread(s32 priority, int stack_size=0x4000); +Handle __KernelSetupMainThread(s32 priority, int stack_size=KERNEL_DEFAULT_STACK_SIZE); void __KernelThreadingInit(); void __KernelThreadingShutdown(); -- cgit v1.2.3