[refactor] Organize STRING
This commit is contained in:
@@ -53,12 +53,7 @@ task_t* task_create(const char* name, void (*entry)(void)) {
|
||||
task->time_slice = TIME_SLICE_DEFAULT;
|
||||
|
||||
// Copy name
|
||||
const char* s = name;
|
||||
char* d = task->name;
|
||||
for (SSINT32 i = 0; i < TASK_NAME_LEN - 1 && *s; i++) {
|
||||
*d++ = *s++;
|
||||
}
|
||||
*d = '\0';
|
||||
str_copy(task->name, name, TASK_NAME_LEN);
|
||||
|
||||
// Set up initial stack for first context_switch into this task.
|
||||
// Stack grows downward. context_switch will pop 6 regs then ret.
|
||||
|
||||
Reference in New Issue
Block a user