annotate VPThread.s @ 8:a2ff41577ecb

Version 0
author Merten Sach <msach@mailbox.tu-berlin.de>
date Mon, 11 Jul 2011 18:08:44 +0200
parents f36e9ab2e030
children
rev   line source
msach@5 1
msach@5 2 //Assembly code takes the return addr off the stack and saves
msach@5 3 // into the singleton. The first field in the singleton is the
msach@5 4 // "endInstrAddr" field, and the return addr is at 0x4(%ebp)
msach@5 5 .globl asm_save_ret_to_singleton
msach@5 6 asm_save_ret_to_singleton:
msach@6 7 movq 0x8(%rbp), %rax #get ret address, ebp is the same as in the calling function
msach@6 8 movq %rax, (%rdi) #write ret addr to endInstrAddr field
msach@5 9 ret
msach@5 10
msach@5 11
msach@5 12 //Assembly code changes the return addr on the stack to the one
msach@5 13 // saved into the singleton by the end-singleton-fn
msach@5 14 //The stack's return addr is at 0x4(%%ebp)
msach@5 15 .globl asm_write_ret_from_singleton
msach@5 16 asm_write_ret_from_singleton:
msach@6 17 movq (%rdi), %rax #get endInstrAddr field
msach@6 18 movq %rax, 0x8(%rbp) #write return addr to the stack of the caller
msach@5 19 ret
msach@5 20
msach@5 21