kernel: implement cpu IDs and per-cpu variables

This commit is contained in:
2023-03-18 19:35:00 +00:00
parent 56bc47f570
commit 57eaf4e01c
14 changed files with 232 additions and 18 deletions

View File

@@ -47,7 +47,7 @@ typedef struct task {
typedef struct thread {
thread_state_t tr_state;
task_t *tr_parent;
unsigned int tr_id;
unsigned int tr_prio;
@@ -64,10 +64,13 @@ typedef struct runqueue {
extern kern_status_t sched_init(void);
extern void runqueue_init(runqueue_t *rq);
extern task_t *task_alloc(void);
static inline task_t *task_ref(task_t *task) { return object_data(object_ref(object_header(task))); }
static inline void task_deref(task_t *task) { object_deref(object_header(task)); }
extern task_t *task_from_pid(unsigned int pid);
extern task_t *kernel_task(void);
static inline void task_lock_irqsave(task_t *task, unsigned long *flags)
{