]>
Commit | Line | Data |
---|---|---|
1 | # pagingstub-asm.s | |
2 | # Paging-enable helper routines | |
3 | # NetWatch system management mode administration console | |
4 | # | |
5 | # Copyright (c) 2008 Jacob Potter and Joshua Wise. All rights reserved. | |
6 | # This program is free software; you can redistribute and/or modify it under | |
7 | # the terms found in the file LICENSE in the root of this source tree. | |
8 | ||
9 | .globl set_cr0 | |
10 | ||
11 | set_cr0: | |
12 | mov 4(%esp), %eax # Load argument | |
13 | movl %eax, %cr0 # Set CR0 | |
14 | pushw %cs # Push 16 bits of %CS | |
15 | pushl $set_cr0_cont # Push 32 bits of %EIP | |
16 | ljmp *(%esp) # "Far jump" (both %CS and %EIP from stack) | |
17 | set_cr0_cont: # Hey, here we are! | |
18 | addl $6, %esp # Un-do 48 bits of pushing | |
19 | ret | |
20 | ||
21 | ||
22 | .globl ps_switch_stack | |
23 | ps_switch_stack: | |
24 | mov 4(%esp), %eax | |
25 | mov 8(%esp), %esp | |
26 | call *%eax | |
27 | rsm |