Files
my-kern/kernel/libk/syscall.c
Rick Rongen 20ab9e1d6e feat: gdt, attributes move, reorder
Added late gdt setup with initial tss
Moved attributes to include root
Reordered some imports
2021-03-21 17:34:38 +01:00

38 lines
637 B
C

//
// Created by rick on 22-02-21.
//
#include <attributes.h>
#include <sys/types.h>
#include <myke/libk/syscall.h>
void syscall1(uint32_t arg1) {
__asm__("int $0x80"
:
: "a"(arg1));
}
void syscall2(uint32_t arg1, uint32_t arg2) {
__asm__("int $0x80"
:
: "a"(arg1), "b"(arg2));
}
void att_noreturn syscall_start_scheduler() {
syscall1(SYSCALL_START_SCHEDULER);
while (1) { __asm__("hlt"); };
}
void syscall_yield_job() {
syscall1(SYSCALL_YIELD_JOB);
}
void syscall_yield_irq(uint16_t irq) {
syscall2(SYSCALL_YIELD_IRQ, irq);
}
void syscall_job_suspend() {
syscall1(SYSCALL_SUSPEND);
}