File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -175,15 +175,20 @@ mod frameless {
175175 // Calls original function, then calls interrupt function.
176176 #[ cfg( target_arch = "aarch64" ) ]
177177 dynasm ! ( assembler
178+ ; stp x29, x30, [ sp, -16 ] ! // save link register and allow clobber of x29
179+ ; mov x29, sp // store stack pointer
178180 ; mov x16, * orig as u64
179181 ; blr x16
182+ ; ldp x29, x30, [ sp] , 16 // restore link register
180183 ; mov x16, interrupt_addr as u64
181184 ; br x16 // tail call
182185 ) ;
183186 #[ cfg( target_arch = "x86_64" ) ]
184187 dynasm ! ( assembler
188+ ; push rbp // align stack
185189 ; mov rax, QWORD * orig as i64
186190 ; call rax
191+ ; pop rbp // restore stack
187192 ; mov rax, QWORD interrupt_addr as i64
188193 ; jmp rax // tail call
189194 ) ;
You can’t perform that action at this time.
0 commit comments