Created
February 2, 2009 21:38
-
-
Save aglasgall/57109 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
do_switch_task: | |
cli | |
pop ecx ; throw away return address | |
pop ecx ; first parameter is the new eip | |
pop esi ; second parameter is new esp, store in esi temporarily | |
pop edi ; third is new ebp, store in edi temporarily | |
pop edx ; fourth is new cr3, but we can't pop | |
mov esp, esi | |
mov ebp, edi | |
mov cr3, edx ; directly into that | |
mov eax, 0xdeadbeef ; magic cookie value | |
sti | |
jmp ecx | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment