feat: gdt, attributes move, reorder
Added late gdt setup with initial tss Moved attributes to include root Reordered some imports
This commit is contained in:
@@ -2,15 +2,15 @@
|
||||
// Created by rick on 22-02-21.
|
||||
//
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <attributes.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <myke/tasks/task.h>
|
||||
#include <myke/cpu/cpu.h>
|
||||
#include <myke/mem/pmm.h>
|
||||
#include <myke/attributes.h>
|
||||
#include <myke/libk/libk.h>
|
||||
#include <myke/mem/pmm.h>
|
||||
#include <myke/tasks/task.h>
|
||||
|
||||
#define stack_end(task) ((task)->stack + ((task)->stack_page_count * PAGE_SIZE))
|
||||
|
||||
@@ -48,7 +48,7 @@ typedef struct {
|
||||
task_entrypoint entrypoint;
|
||||
void *entry_data;
|
||||
char alignment[4];
|
||||
} packed task_stack_start;
|
||||
} att_packed task_stack_start;
|
||||
|
||||
volatile uint32_t task_locked = 0;
|
||||
|
||||
@@ -62,12 +62,12 @@ uint32_t last_tid = 0;
|
||||
extern switch_task(task_registers_t
|
||||
**, task_registers_t*);
|
||||
|
||||
extern cdecl noreturn void __task_entry_point();
|
||||
extern att_cdecl att_noreturn void __task_entry_point();
|
||||
|
||||
extern noreturn void __task_entry_point_inner();
|
||||
extern att_noreturn void __task_entry_point_inner();
|
||||
|
||||
// explicit cdecl calling convention
|
||||
void cdecl noreturn task_entry_point(task_entrypoint entrypoint, void *entry_data) {
|
||||
void att_cdecl att_noreturn task_entry_point(task_entrypoint entrypoint, void *entry_data) {
|
||||
entrypoint(entry_data);
|
||||
// task_end_self();
|
||||
while (true); // halt
|
||||
@@ -114,7 +114,7 @@ void task_suspend() {
|
||||
task_switch_next();
|
||||
}
|
||||
|
||||
void noreturn task_idle(void *data) {
|
||||
void att_noreturn task_idle(void *data) {
|
||||
while (true) __asm__("hlt");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user