diff --git a/kernel/cpu/cpu_amd64.go b/kernel/cpu/cpu_amd64.go index 4943fa2..7776082 100644 --- a/kernel/cpu/cpu_amd64.go +++ b/kernel/cpu/cpu_amd64.go @@ -1,5 +1,14 @@ package cpu +// EnableInterrupts enables interrupt handling. +func EnableInterrupts() + +// DisableInterrupts disables interrupt handling. +func DisableInterrupts() + +// Halt stops instruction execution. +func Halt() + // FlushTLBEntry flushes a TLB entry for a particular virtual address. func FlushTLBEntry(virtAddr uintptr) diff --git a/kernel/cpu/cpu_amd64.s b/kernel/cpu/cpu_amd64.s index 002c8cb..5ef45db 100644 --- a/kernel/cpu/cpu_amd64.s +++ b/kernel/cpu/cpu_amd64.s @@ -1,5 +1,18 @@ #include "textflag.h" +TEXT ·EnableInterrupts(SB),NOSPLIT,$0 + STI + RET + +TEXT ·DisableInterrupts(SB),NOSPLIT,$0 + CLI + RET + +TEXT ·Halt(SB),NOSPLIT,$0 + CLI + HLT + RET + TEXT ·FlushTLBEntry(SB),NOSPLIT,$0 INVLPG virtAddr+0(FP) RET