[liba] Add setjmp and longjmp

Change-Id: I3a57787199308900de8e7c6ce5961b2a26f6d38e
This commit is contained in:
Émilie Feral
2017-08-23 11:31:07 +02:00
parent 67e68e145f
commit 6b783346cc
5 changed files with 63 additions and 0 deletions

View File

@@ -1,4 +1,17 @@
#ifndef LIBA_SETJMP_H
#define LIBA_SETJMP_H
/* We are preseving registers:
* - sp & lr -> 2x4 bytes
* - General purpose registers: r4-r9, r10 = sl, r11 = fp -> 8x4 bytes
* - Floating point registers: s16-s31 -> 8x8 bytes
* - VFP status register: fpscr ->1x4 bytes
* The buffer size has to include room for setjmp implementation: 4x4 bytes.
* (See C Library ABI for the ARM architecture documentation)
* The minimum buffer size is then (2+8+16+1+4)xsizeof(int64_t). */
typedef int jmp_buf[31];
void longjmp(jmp_buf env, int val);
int setjmp(jmp_buf env);
#endif