]> Joshua Wise's Git repositories - netwatch.git/blobdiff - netwatch/pagingstub-asm.s
Move aseg-paging to netwatch/
[netwatch.git] / netwatch / pagingstub-asm.s
diff --git a/netwatch/pagingstub-asm.s b/netwatch/pagingstub-asm.s
new file mode 100644 (file)
index 0000000..414e463
--- /dev/null
@@ -0,0 +1,20 @@
+
+.globl set_cr0
+
+set_cr0:
+  mov 4(%esp), %eax                     # Load argument
+  movl %eax, %cr0                       # Set CR0
+  pushw %cs                             # Push 16 bits of %CS
+  pushl $set_cr0_cont                   # Push 32 bits of %EIP
+  ljmp *(%esp)                          # "Far jump" (both %CS and %EIP from stack)
+set_cr0_cont:                           # Hey, here we are!
+  addl $6, %esp                         # Un-do 48 bits of pushing
+  ret
+
+
+.globl ps_switch_stack
+ps_switch_stack:
+  mov 4(%esp), %eax
+  mov 8(%esp), %esp   
+  call *%eax
+  rsm
This page took 0.022181 seconds and 4 git commands to generate.