; Low level interrupt/thread handling code for GeekOS.
; Copyright (c) 2001,2003,2004 David H. Hovemeyer <daveho@cs.umd.edu>
; Copyright (c) 2003, Jeffrey K. Hollingsworth <hollings@cs.umd.edu>
-; $Revision: 1.1 $
+; $Revision: 1.2 $
; This is free software. You are permitted to use,
; redistribute, and modify it as specified in the file "COPYING".
EXPORT g_entryPointTableStart
EXPORT g_entryPointTableEnd
+
+EXPORT InByteLL
+
; Thread context switch function.
EXPORT Switch_To_Thread
EXPORT Set_PDBR
EXPORT Get_PDBR
EXPORT Flush_TLB
+EXPORT Invalidate_PG
; CPUID functions
EXPORT cpuid_ecx
;
+; Invalidate Page - removes a page from the TLB
+;
+align 8
+Invalidate_PG:
+ mov eax, [esp+4]
+ invlpg [eax]
+ ret
+
+;
; cpuid_ecx - return the ecx register from cpuid
;
align 8
ret
+
+align 8
+InByteLL:
+ push ebp
+ mov ebp, esp
+ push ecx
+ push ebx
+ push edx
+
+ rdtsc
+ mov ebx, eax
+ mov ecx, edx
+ mov dx, [ebp + 8]
+
+ in al, dx
+
+ pop edx
+ pop ebx
+ pop ecx
+ pop ebp
+ ret
+
; Common interrupt handling code.
; Save registers, call C handler function,
; possibly choose a new thread to run, restore
+
; ----------------------------------------------------------------------
; Generate interrupt-specific entry points for all interrupts.
; We also define symbols to indicate the extend of the table