|
| 1 | +#include "psm.h" |
| 2 | + |
| 3 | +.text |
| 4 | +.globl rust_psm_stack_direction |
| 5 | +.align 2 |
| 6 | +.type rust_psm_stack_direction,@function |
| 7 | +rust_psm_stack_direction: |
| 8 | +/* extern "C" fn() -> u8 */ |
| 9 | +.cfi_startproc |
| 10 | + li.w $r4, STACK_DIRECTION_DESCENDING |
| 11 | + jr $r1 |
| 12 | +.rust_psm_stack_direction_end: |
| 13 | +.size rust_psm_stack_direction,.rust_psm_stack_direction_end-rust_psm_stack_direction |
| 14 | +.cfi_endproc |
| 15 | + |
| 16 | + |
| 17 | +.globl rust_psm_stack_pointer |
| 18 | +.align 2 |
| 19 | +.type rust_psm_stack_pointer,@function |
| 20 | +rust_psm_stack_pointer: |
| 21 | +/* extern "C" fn() -> *mut u8 */ |
| 22 | +.cfi_startproc |
| 23 | + move $r4, $r3 |
| 24 | + jr $r1 |
| 25 | +.rust_psm_stack_pointer_end: |
| 26 | +.size rust_psm_stack_pointer,.rust_psm_stack_pointer_end-rust_psm_stack_pointer |
| 27 | +.cfi_endproc |
| 28 | + |
| 29 | + |
| 30 | +.globl rust_psm_replace_stack |
| 31 | +.align 2 |
| 32 | +.type rust_psm_replace_stack,@function |
| 33 | +rust_psm_replace_stack: |
| 34 | +/* extern "C" fn(r4: usize, r5: extern "C" fn(usize), r6: *mut u8) */ |
| 35 | +.cfi_startproc |
| 36 | + move $r3, $r6 |
| 37 | + jr $r5 |
| 38 | +.rust_psm_replace_stack_end: |
| 39 | +.size rust_psm_replace_stack,.rust_psm_replace_stack_end-rust_psm_replace_stack |
| 40 | +.cfi_endproc |
| 41 | + |
| 42 | + |
| 43 | +.globl rust_psm_on_stack |
| 44 | +.align 2 |
| 45 | +.type rust_psm_on_stack,@function |
| 46 | +rust_psm_on_stack: |
| 47 | +/* extern "C" fn(r4: usize, r5: usize, r6: extern "C" fn(usize, usize), r7: *mut u8) */ |
| 48 | +.cfi_startproc |
| 49 | + st.d $r1, $r7, -8 |
| 50 | + st.d $r3, $r7, -16 |
| 51 | + addi.d $r3, $r7, -16 |
| 52 | + .cfi_def_cfa 3, 16 |
| 53 | + .cfi_offset 1, -8 |
| 54 | + .cfi_offset 3, -16 |
| 55 | + jirl $r1, $r6, 0 |
| 56 | + ld.d $r1, $r3, 8 |
| 57 | + .cfi_restore 1 |
| 58 | + ld.d $r3, $r3, 0 |
| 59 | + .cfi_restore 3 |
| 60 | + jr $r1 |
| 61 | +.rust_psm_on_stack_end: |
| 62 | +.size rust_psm_on_stack,.rust_psm_on_stack_end-rust_psm_on_stack |
| 63 | +.cfi_endproc |
0 commit comments