X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=kern%2Fswitch_x86_64.s;h=5fb4da658d1663d461c4fb91218285d212fb82f2;hb=8ed6318f92444e347d2043f585362bc4b1107f84;hp=60a31e286b6bd50db1adb04ddd12fbe0fec62b12;hpb=057acc534d78302f2dc31b3b363f605c99ea8ebb;p=bertos.git diff --git a/kern/switch_x86_64.s b/kern/switch_x86_64.s old mode 100755 new mode 100644 index 60a31e28..5fb4da65 --- a/kern/switch_x86_64.s +++ b/kern/switch_x86_64.s @@ -15,6 +15,15 @@ /* * $Log$ + * Revision 1.4 2006/09/20 14:02:49 marco + * C-style comment. + * + * Revision 1.3 2006/02/24 01:35:40 bernie + * Update for new emulator. + * + * Revision 1.2 2006/02/24 01:17:05 bernie + * Update for new emulator. + * * Revision 1.1 2005/11/27 03:06:15 bernie * Add x86_64 task switching (to be updated to new-style scheduler). * @@ -29,14 +38,13 @@ * */ -!!!!!! THIS FILE HAS NOT BEEN REVISED FOR THE NEW SCHEDULER API !!!!!! - /* I know it's ugly... */ -#.intel_syntax +/* .intel_syntax */ -/* void AsmSwitchContext(void * new_sp, void ** save_sp) */ -.globl AsmSwitchContext -AsmSwitchContext: +/* void AsmSwitchContext(void **new_sp, void **save_sp) */ +/* %rdi %rsi */ +.globl asm_switch_context +asm_switch_context: pushq %rax pushq %rbx pushq %rcx @@ -45,7 +53,7 @@ AsmSwitchContext: pushq %rdi pushq %rbp movq %rsp,(%rsi) /* *save_sp = rsp */ - movq %rdi,%rsp /* rsp = new_sp */ + movq (%rdi),%rsp /* rsp = *new_sp */ popq %rbp popq %rdi popq %rsi @@ -55,16 +63,9 @@ AsmSwitchContext: popq %rax ret -/* void AsmReplaceContext(void * new_sp, void ** dummy) */ -.globl AsmReplaceContext -AsmReplaceContext: - movq %rdi,%rsp /* rsp = new_sp */ - popq %rbp - popq %rdi - popq %rsi - popq %rdx - popq %rcx - popq %rbx - popq %rax +/* int asm_switch_version(void) */ +.globl asm_switch_version +asm_switch_version: + mov $1,%rax ret