From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- vendor/psm/src/arch/riscv.s | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 vendor/psm/src/arch/riscv.s (limited to 'vendor/psm/src/arch/riscv.s') diff --git a/vendor/psm/src/arch/riscv.s b/vendor/psm/src/arch/riscv.s new file mode 100644 index 000000000..4972993c9 --- /dev/null +++ b/vendor/psm/src/arch/riscv.s @@ -0,0 +1,64 @@ +#include "psm.h" + +.text +.globl rust_psm_stack_direction +.p2align 2 +.type rust_psm_stack_direction,@function +rust_psm_stack_direction: +/* extern "C" fn() -> u8 */ +.cfi_startproc + li x10, STACK_DIRECTION_DESCENDING + jr x1 +.rust_psm_stack_direction_end: +.size rust_psm_stack_direction,.rust_psm_stack_direction_end-rust_psm_stack_direction +.cfi_endproc + + +.globl rust_psm_stack_pointer +.p2align 2 +.type rust_psm_stack_pointer,@function +rust_psm_stack_pointer: +/* extern "C" fn() -> *mut u8 */ +.cfi_startproc + add x10, x2, x0 + jr x1 +.rust_psm_stack_pointer_end: +.size rust_psm_stack_pointer,.rust_psm_stack_pointer_end-rust_psm_stack_pointer +.cfi_endproc + + +.globl rust_psm_replace_stack +.p2align 2 +.type rust_psm_replace_stack,@function +rust_psm_replace_stack: +/* extern "C" fn(x10: usize, x11: extern "C" fn(usize), x12: *mut u8) */ +.cfi_startproc + add x2, x12, x0 + jr x11 +.rust_psm_replace_stack_end: +.size rust_psm_replace_stack,.rust_psm_replace_stack_end-rust_psm_replace_stack +.cfi_endproc + + +.globl rust_psm_on_stack +.p2align 2 +.type rust_psm_on_stack,@function +rust_psm_on_stack: +/* extern "C" fn(x10: usize, x11: usize, x12: extern "C" fn(usize, usize), x13: *mut u8) */ +.cfi_startproc + sw x1, -12(x13) + sw x2, -16(x13) + .cfi_def_cfa x13, 0 + .cfi_offset x1, -12 + .cfi_offset x2, -16 + addi x2, x13, -16 + .cfi_def_cfa x2, -16 + jalr x1, x12, 0 + lw x1, 4(x2) + .cfi_restore x1 + lw x2, 0(x2) + .cfi_restore x2 + jr x1 +.rust_psm_on_stack_end: +.size rust_psm_on_stack,.rust_psm_on_stack_end-rust_psm_on_stack +.cfi_endproc -- cgit v1.2.3