27 lines
630 B
ArmAsm
27 lines
630 B
ArmAsm
#include "DEFS.h"
|
|
|
|
ENTRY(setjmp)
|
|
movl 4(%esp),%eax
|
|
movl %ebx,(%eax) # save ebx
|
|
movl %esp,4(%eax) # save esp
|
|
movl %ebp,8(%eax) # save ebp
|
|
movl %esi,12(%eax) # save esi
|
|
movl %edi,16(%eax) # save edi
|
|
movl (%esp),%edx # get rta
|
|
movl %edx,20(%eax) # save eip
|
|
xorl %eax,%eax # return (0);
|
|
ret
|
|
|
|
ENTRY(longjmp)
|
|
movl 4(%esp),%eax
|
|
movl (%eax),%ebx # restore ebx
|
|
movl 4(%eax),%esp # restore esp
|
|
movl 8(%eax),%ebp # restore ebp
|
|
movl 12(%eax),%esi # restore esi
|
|
movl 16(%eax),%edi # restore edi
|
|
movl 20(%eax),%edx # get rta
|
|
movl %edx,(%esp) # put in return frame
|
|
xorl %eax,%eax # return (1);
|
|
incl %eax
|
|
ret
|