mirror of
https://github.com/taigrr/gopher-os
synced 2025-01-18 04:43:13 -08:00
This will allow us to figure out the virtual address that caused a page- or general protection fault.
34 lines
482 B
ArmAsm
34 lines
482 B
ArmAsm
#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
|
|
|
|
TEXT ·SwitchPDT(SB),NOSPLIT,$0
|
|
// loading CR3 also triggers a TLB flush
|
|
MOVQ pdtPhysAddr+0(FP), CR3
|
|
RET
|
|
|
|
TEXT ·ActivePDT(SB),NOSPLIT,$0
|
|
MOVQ CR3, AX
|
|
MOVQ AX, ret+0(FP)
|
|
RET
|
|
|
|
TEXT ·ReadCR2(SB),NOSPLIT,$0
|
|
MOVQ CR2, AX
|
|
MOVQ AX, ret+0(FP)
|
|
RET
|