]> Joshua Wise's Git repositories - netwatch.git/blame - netwatch/pagingstub-asm.S
Fix smm_type detection to actually detect, and add a state_num_regs routine.
[netwatch.git] / netwatch / pagingstub-asm.S
CommitLineData
3c4e084d
JP
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.
9e2a82e4
JP
8
9.globl set_cr0
10
11set_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)
17set_cr0_cont: # Hey, here we are!
18 addl $6, %esp # Un-do 48 bits of pushing
19 ret
20
8e404e68
JP
21
22.globl ps_switch_stack
23ps_switch_stack:
24 mov 4(%esp), %eax
25 mov 8(%esp), %esp
4e3ef36b
JW
26 # Put a sentinel value (FEEDFACE) at the top of the stack
27 mov $0xCEFAEDFE, %edx
28 push %edx
29 push %edx
30 push %edx
31 push %edx
8e404e68
JP
32 call *%eax
33 rsm
This page took 0.022938 seconds and 4 git commands to generate.