From 7f86996afc72481789c01ccc392e542d3318ddc0 Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Mon, 11 Mar 2013 16:45:25 -0700 Subject: ARM: Consolidate setjmp details in include/bits/setjmp.h file. --- ports/sysdeps/arm/__longjmp.S | 4 +--- ports/sysdeps/arm/bits/setjmp.h | 2 +- ports/sysdeps/arm/include/bits/setjmp.h | 34 +++++++++++++++++++++++++++++++++ ports/sysdeps/arm/jmpbuf-offsets.h | 19 ------------------ ports/sysdeps/arm/jmpbuf-unwind.h | 1 - ports/sysdeps/arm/setjmp.S | 4 +--- 6 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 ports/sysdeps/arm/include/bits/setjmp.h delete mode 100644 ports/sysdeps/arm/jmpbuf-offsets.h (limited to 'ports/sysdeps') diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S index 1d5d56bde6..becba930a0 100644 --- a/ports/sysdeps/arm/__longjmp.S +++ b/ports/sysdeps/arm/__longjmp.S @@ -19,8 +19,6 @@ /* ??? Needs more rearrangement for the LDM to handle thumb mode. */ #define NO_THUMB #include -#define _SETJMP_H -#define _ASM #include #include #include @@ -37,7 +35,7 @@ ENTRY (__longjmp) cfi_undefined (r4) CHECK_SP (r4) #endif - ldmia ip!, {v1-v6, sl, fp, sp, lr} + ldmia ip!, JMP_BUF_REGLIST cfi_restore (v1) cfi_restore (v2) cfi_restore (v3) diff --git a/ports/sysdeps/arm/bits/setjmp.h b/ports/sysdeps/arm/bits/setjmp.h index 1f7ddd3653..21bbf7f57d 100644 --- a/ports/sysdeps/arm/bits/setjmp.h +++ b/ports/sysdeps/arm/bits/setjmp.h @@ -24,7 +24,7 @@ # error "Never include directly; use instead." #endif -#ifndef _ASM +#ifndef __ASSEMBLER__ /* The exact set of registers saved may depend on the particular core in use, as some coprocessor registers may need to be saved. The C Library ABI requires that the buffer be 8-byte aligned, and diff --git a/ports/sysdeps/arm/include/bits/setjmp.h b/ports/sysdeps/arm/include/bits/setjmp.h new file mode 100644 index 0000000000..23d8f75cf2 --- /dev/null +++ b/ports/sysdeps/arm/include/bits/setjmp.h @@ -0,0 +1,34 @@ +/* Private jmp_buf-related definitions. ARM EABI version. + Copyright (C) 2013 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + The GNU C Library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with the GNU C Library. If not, see + . */ + +#ifndef _INCLUDE_BITS_SETJMP_H +#define _INCLUDE_BITS_SETJMP_H 1 + +#ifndef __ASSEMBLER__ +/* Get the public declarations. */ +# include +#endif + +/* Register list for a ldm/stm instruction to load/store + the general registers from a __jmp_buf. */ +#define JMP_BUF_REGLIST {v1-v6, sl, fp, sp, lr} + +/* Index of __jmp_buf where the sp register resides. */ +#define __JMP_BUF_SP 8 + +#endif /* include/bits/setjmp.h */ diff --git a/ports/sysdeps/arm/jmpbuf-offsets.h b/ports/sysdeps/arm/jmpbuf-offsets.h deleted file mode 100644 index beeccbb40f..0000000000 --- a/ports/sysdeps/arm/jmpbuf-offsets.h +++ /dev/null @@ -1,19 +0,0 @@ -/* Private macros for accessing __jmp_buf contents. ARM EABI version. - Copyright (C) 2007-2013 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library. If not, see - . */ - -#define __JMP_BUF_SP 8 diff --git a/ports/sysdeps/arm/jmpbuf-unwind.h b/ports/sysdeps/arm/jmpbuf-unwind.h index 7f7770aea0..0863540ce0 100644 --- a/ports/sysdeps/arm/jmpbuf-unwind.h +++ b/ports/sysdeps/arm/jmpbuf-unwind.h @@ -16,7 +16,6 @@ . */ #include -#include #include #include diff --git a/ports/sysdeps/arm/setjmp.S b/ports/sysdeps/arm/setjmp.S index 6776cab384..c41a1baddd 100644 --- a/ports/sysdeps/arm/setjmp.S +++ b/ports/sysdeps/arm/setjmp.S @@ -19,8 +19,6 @@ /* ??? Needs more rearrangement for the STM to handle thumb mode. */ #define NO_THUMB #include -#define _SETJMP_H -#define _ASM #include #include #include @@ -29,7 +27,7 @@ ENTRY (__sigsetjmp) mov ip, r0 /* Save registers */ - stmia ip!, {v1-v6, sl, fp, sp, lr} + stmia ip!, JMP_BUF_REGLIST #if !defined ARM_ASSUME_NO_IWMMXT || defined __SOFTFP__ # define NEED_HWCAP 1 -- cgit 1.4.1