diff options
author | Danny Holman <dholman@gymli.org> | 2024-02-16 12:57:09 -0600 |
---|---|---|
committer | Danny Holman <dholman@gymli.org> | 2024-02-16 12:57:09 -0600 |
commit | 157bea025cf120be22efe6327e6dd6b390fc4ba1 (patch) | |
tree | 92a7b747fcefc9d6e93001faf98cde99b0f15018 /arch/i386/include | |
parent | kernel: mem: kmalloc should not call page allocation (diff) | |
download | box-157bea025cf120be22efe6327e6dd6b390fc4ba1.tar.gz box-157bea025cf120be22efe6327e6dd6b390fc4ba1.tar.zst box-157bea025cf120be22efe6327e6dd6b390fc4ba1.zip |
arch: i386: move raw assembly calls to their own header
Move simple assembly calls to their own header. All one or two line
assembly calls should be defined in a single place.
Signed-off-by: Danny Holman <dholman@gymli.org>
Diffstat (limited to '')
-rw-r--r-- | arch/i386/include/kernel/asm.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/i386/include/kernel/asm.h b/arch/i386/include/kernel/asm.h new file mode 100644 index 0000000..33ec3d7 --- /dev/null +++ b/arch/i386/include/kernel/asm.h @@ -0,0 +1,19 @@ +#ifndef I386_ASM_H +#define I386_ASM_H + +static inline void enable_ints(void) { + __asm__ volatile("sti"); + return; +} + +static inline void disable_ints(void) { + __asm__ volatile("cli"); + return; +} + +static inline void flush_tss(void) { + __asm__ volatile("movw $0x28, %ax; ltr %ax"); + return; +} + +#endif |