sched: add current_task(), current_thread(), and preempt_disable/enable()

This commit is contained in:
2023-03-28 21:39:59 +01:00
parent e0e6f4a9ae
commit 7d003da960
6 changed files with 65 additions and 3 deletions

View File

@@ -15,8 +15,9 @@ typedef enum cpu_flags {
typedef struct cpu_data {
cpu_flags_t c_flags;
unsigned int c_id;
unsigned int c_preempt_count;
task_t *c_current_task;
thread_t *c_current_thread;
runqueue_t c_rq;
} cpu_data_t;
@@ -35,6 +36,9 @@ extern void cpu_set_online(unsigned int cpu_id);
#define irq_enable() ml_int_enable()
#define irq_disable() ml_int_disable()
extern void preempt_disable(void);
extern void preempt_enable(void);
extern unsigned int cpu_get_highest_available(void);
#ifdef __cplusplus