yuezonghe | 824eb0c | 2024-06-27 02:32:26 -0700 | [diff] [blame^] | 1 | |
| 2 | /* |
| 3 | * setjmp.S atp. Sept. 2001 |
| 4 | * Jan-Benedict Glaw <jbglaw@lug-owl.de> 2006 |
| 5 | * |
| 6 | * Save regs and info needed for a longjmp |
| 7 | */ |
| 8 | |
| 9 | .globl __sigsetjmp |
| 10 | .align 4 |
| 11 | __sigsetjmp: |
| 12 | .word 0x0000 /* We look after reg saving here - this */ |
| 13 | /* must match longjmp. */ |
| 14 | movl 0x4(%ap), %r0 /* Our scratch reg */ |
| 15 | /* kenn would probably use movq here. :-) */ |
| 16 | movl %r1, 0x14(%r0) /* save regs */ |
| 17 | movl %r2, 0x18(%r0) |
| 18 | movl %r3, 0x1c(%r0) |
| 19 | movl %r4, 0x20(%r0) |
| 20 | movl %r5, 0x24(%r0) |
| 21 | movl %r6, 0x28(%r0) |
| 22 | movl %r7, 0x2c(%r0) |
| 23 | movl %r8, 0x30(%r0) |
| 24 | movl %r9, 0x34(%r0) |
| 25 | movl %r10, 0x38(%r0) |
| 26 | movl %r11, 0x3c(%r0) |
| 27 | /* Now save our call frame */ |
| 28 | movl (%fp), (%r0) /* Condition handler (for VMS emulation) */ |
| 29 | movl 0x4(%fp), 0x4(%r0) /* psw */ |
| 30 | movl 0x8(%fp), 0x8(%r0) /* ap */ |
| 31 | movl 0xc(%fp), 0xc(%r0) /* fp */ |
| 32 | movl 0x10(%fp), 0x10(%r0) /* pc */ |
| 33 | /* Call the sigjmp save routine */ |
| 34 | pushl 8(%ap) |
| 35 | pushl %r0 |
| 36 | calls $2, __sigjmp_save |
| 37 | /* Done */ |
| 38 | ret |
| 39 | |