annotate Vthread.s @ 27:e5d4d5871ac9

half-done update to common_ancesor VMS version.. in middle
author Some Random Person <seanhalle@yahoo.com>
date Thu, 01 Mar 2012 13:20:51 -0800
parents
children
rev   line source
seanhalle@27 1
seanhalle@27 2 //Assembly code takes the return addr off the stack and saves
seanhalle@27 3 // into the singleton. The first field in the singleton is the
seanhalle@27 4 // "endInstrAddr" field, and the return addr is at 0x4(%ebp)
seanhalle@27 5 .globl asm_save_ret_to_singleton
seanhalle@27 6 asm_save_ret_to_singleton:
seanhalle@27 7 movq 0x8(%rbp), %rax #get ret address, ebp is the same as in the calling function
seanhalle@27 8 movq %rax, (%rdi) #write ret addr to endInstrAddr field
seanhalle@27 9 ret
seanhalle@27 10
seanhalle@27 11
seanhalle@27 12 //Assembly code changes the return addr on the stack to the one
seanhalle@27 13 // saved into the singleton by the end-singleton-fn
seanhalle@27 14 //The stack's return addr is at 0x4(%%ebp)
seanhalle@27 15 .globl asm_write_ret_from_singleton
seanhalle@27 16 asm_write_ret_from_singleton:
seanhalle@27 17 movq (%rdi), %rax #get endInstrAddr field
seanhalle@27 18 movq %rax, 0x8(%rbp) #write return addr to the stack of the caller
seanhalle@27 19 ret
seanhalle@27 20
seanhalle@27 21