Skip to content
Snippets Groups Projects
Commit 7cdb7050 authored by bunnei's avatar bunnei
Browse files

- replaced KERNELOBJECT_MAX_NAME_LENGTH with KERNEL_MAX_NAME_LENGTH

- added KERNEL_DEFAULT_STACK_SIZE definition (0x4000)
parent 39ee75fc
No related branches found
No related tags found
No related merge requests found
...@@ -16,11 +16,10 @@ enum KernelIDType { ...@@ -16,11 +16,10 @@ enum KernelIDType {
}; };
enum { 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 KernelObjectPool;
class KernelObject { class KernelObject {
......
...@@ -81,7 +81,7 @@ public: ...@@ -81,7 +81,7 @@ public:
WaitType wait_type; 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. // Lists all thread ids that aren't deleted/etc.
...@@ -165,7 +165,8 @@ void __KernelResetThread(Thread *t, s32 lowest_priority) { ...@@ -165,7 +165,8 @@ void __KernelResetThread(Thread *t, s32 lowest_priority) {
} }
/// Creates a new 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=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; static u32 _handle_count = 1;
Thread *t = new Thread; Thread *t = new Thread;
...@@ -183,8 +184,8 @@ Thread *__KernelCreateThread(Handle &handle, const char *name, u32 entry_point, ...@@ -183,8 +184,8 @@ Thread *__KernelCreateThread(Handle &handle, const char *name, u32 entry_point,
t->processor_id = processor_id; t->processor_id = processor_id;
t->wait_type = WAITTYPE_NONE; t->wait_type = WAITTYPE_NONE;
strncpy(t->name, name, KERNELOBJECT_MAX_NAME_LENGTH); strncpy(t->name, name, KERNEL_MAX_NAME_LENGTH);
t->name[KERNELOBJECT_MAX_NAME_LENGTH] = '\0'; t->name[KERNEL_MAX_NAME_LENGTH] = '\0';
return t; return t;
} }
......
...@@ -9,8 +9,12 @@ ...@@ -9,8 +9,12 @@
class Thread; 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 /// 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 __KernelThreadingInit();
void __KernelThreadingShutdown(); void __KernelThreadingShutdown();
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment