diff options
author | Marvin Borner | 2020-08-05 21:33:48 +0200 |
---|---|---|
committer | Marvin Borner | 2020-08-05 21:33:48 +0200 |
commit | 835960fd85989ee961b5a932f467e6e4f545d201 (patch) | |
tree | d93c67e51189eec12fb43ef860deba92e9017329 /src/drivers/cpu.c | |
parent | 4af62bb53676b7f721b46cabee78cac3a557e924 (diff) |
Added some cpu function wrappers
Diffstat (limited to 'src/drivers/cpu.c')
-rw-r--r-- | src/drivers/cpu.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/src/drivers/cpu.c b/src/drivers/cpu.c index ba8c66f..5c27c51 100644 --- a/src/drivers/cpu.c +++ b/src/drivers/cpu.c @@ -46,3 +46,24 @@ void outl(u16 port, u32 data) { __asm__ volatile("outl %0, %1" ::"a"(data), "Nd"(port)); } + +void cli() +{ + __asm__ volatile("cli"); +} + +void sti() +{ + __asm__ volatile("sti"); +} + +void hlt() +{ + __asm__ volatile("hlt"); +} + +void idle() +{ + while (1) + hlt(); +} |