Rename struct Thread; Completely split task memspace and shceduling

This commit is contained in:
TXuian
2024-05-18 21:37:30 +08:00
parent 0b858de120
commit 736ba18769
36 changed files with 636 additions and 260 deletions

View File

@@ -30,9 +30,9 @@ Modification:
#include "log.h"
#include "scheduler.h"
struct TaskMicroDescriptor* max_priority_runnable_task(void)
struct Thread* max_priority_runnable_task(void)
{
static struct TaskMicroDescriptor* task = NULL;
static struct Thread* task = NULL;
static int priority = 0;
priority = __builtin_ffs(ready_task_priority) - 1;
@@ -53,9 +53,9 @@ struct TaskMicroDescriptor* max_priority_runnable_task(void)
return NULL;
}
struct TaskMicroDescriptor* round_robin_runnable_task(uint32_t priority)
struct Thread* round_robin_runnable_task(uint32_t priority)
{
struct TaskMicroDescriptor* task = NULL;
struct Thread* task = NULL;
DOUBLE_LIST_FOR_EACH_ENTRY(task, &xizi_task_manager.task_list_head[priority], node)
{
@@ -74,7 +74,7 @@ struct TaskMicroDescriptor* round_robin_runnable_task(uint32_t priority)
/* recover task priority */
void recover_priority(void)
{
struct TaskMicroDescriptor* task = NULL;
struct Thread* task = NULL;
for (int i = 1; i < TASK_MAX_PRIORITY; i++) {
if (i == TASK_DEFAULT_PRIORITY)
continue;