]> Joshua Wise's Git repositories - netwatch.git/blame_incremental - netwatch/pagingstub-asm.S
Improve correctness of backtrace library.
[netwatch.git] / netwatch / pagingstub-asm.S
... / ...
CommitLineData
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
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
21
22.globl ps_switch_stack
23ps_switch_stack:
24 mov 4(%esp), %eax
25 mov 8(%esp), %esp
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
32 call *%eax
33 rsm
This page took 0.018924 seconds and 4 git commands to generate.