feat: added support for waiting on an irq
This commit is contained in:
@@ -12,11 +12,21 @@ void syscall1(uint32_t arg1) {
|
||||
: "a"(arg1));
|
||||
}
|
||||
|
||||
void syscall_yield_job() {
|
||||
syscall1(SYSCALL_YIELD_JOB);
|
||||
void syscall2(uint32_t arg1, uint32_t arg2) {
|
||||
__asm__("int $0x80"
|
||||
:
|
||||
: "a"(arg1), "b"(arg2));
|
||||
}
|
||||
|
||||
void 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 );
|
||||
}
|
||||
|
||||
@@ -4,14 +4,17 @@
|
||||
|
||||
#ifndef NEW_KERNEL_SYSCALL_H
|
||||
#define NEW_KERNEL_SYSCALL_H
|
||||
|
||||
#include <types.h>
|
||||
#include <attributes.h>
|
||||
|
||||
#define SYSCALL_START_SCHEDULER 0x01
|
||||
#define SYSCALL_YIELD_JOB 0x02
|
||||
|
||||
void syscall_yield_job();
|
||||
#define SYSCALL_YIELD_IRQ 0x03
|
||||
|
||||
void noreturn syscall_start_scheduler();
|
||||
|
||||
void syscall_yield_job();
|
||||
|
||||
void syscall_yield_irq(uint16_t irq);
|
||||
|
||||
#endif //NEW_KERNEL_SYSCALL_H
|
||||
|
||||
Reference in New Issue
Block a user