From 4b860fb9c0bae72e6bfcffb44509183eb1763706 Mon Sep 17 00:00:00 2001 From: Daniel Jacobowitz Date: Thu, 21 Sep 2006 18:39:51 +0000 Subject: [PATCH] * sysdeps/unix/sysv/linux/arm/dl-procinfo.c (_dl_arm_cap_flags): Add "java" and "iwmmxt". * sysdeps/unix/sysv/linux/arm/dl-procinfo.h: Use for HWCAP values. (_DL_HWCAP_COUNT): Increase to 10. * sysdeps/unix/sysv/linux/arm/sysdep.h (HWCAP_ARM_SWP, HWCAP_ARM_HALF, HWCAP_ARM_THUMB, HWCAP_ARM_26BIT, HWCAP_ARM_FAST_MULT, HWCAP_ARM_FPA, HWCAP_ARM_VFP, HWCAP_ARM_EDSP, HWCAP_ARM_JAVA, HWCAP_ARM_IWMMXT): Define. * sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Save iWMMXt registers if HWCAP_ARM_IWMMXT set. Don't include . Use HWCAP_ARM_VFP instead of HWCAP_VFP. * sysdeps/arm/eabi/__longjmp.S (__longjmp): Restore iWMMXt registers if HWCAP_ARM_IWMMXT set. Don't include . Use HWCAP_ARM_VFP instead of HWCAP_VFP. --- ChangeLog.arm | 18 ++++++++++++++++++ sysdeps/arm/eabi/__longjmp.S | 19 +++++++++++++++---- sysdeps/arm/eabi/setjmp.S | 19 +++++++++++++++---- sysdeps/unix/sysv/linux/arm/dl-procinfo.c | 5 +++-- sysdeps/unix/sysv/linux/arm/dl-procinfo.h | 19 ++++--------------- sysdeps/unix/sysv/linux/arm/sysdep.h | 12 ++++++++++++ 6 files changed, 67 insertions(+), 25 deletions(-) diff --git a/ChangeLog.arm b/ChangeLog.arm index 3effa9d..45e8a87 100644 --- a/ChangeLog.arm +++ b/ChangeLog.arm @@ -1,3 +1,21 @@ +2006-09-21 Joseph Myers + + * sysdeps/unix/sysv/linux/arm/dl-procinfo.c (_dl_arm_cap_flags): + Add "java" and "iwmmxt". + * sysdeps/unix/sysv/linux/arm/dl-procinfo.h: Use for + HWCAP values. + (_DL_HWCAP_COUNT): Increase to 10. + * sysdeps/unix/sysv/linux/arm/sysdep.h (HWCAP_ARM_SWP, + HWCAP_ARM_HALF, HWCAP_ARM_THUMB, HWCAP_ARM_26BIT, + HWCAP_ARM_FAST_MULT, HWCAP_ARM_FPA, HWCAP_ARM_VFP, HWCAP_ARM_EDSP, + HWCAP_ARM_JAVA, HWCAP_ARM_IWMMXT): Define. + * sysdeps/arm/eabi/setjmp.S (__sigsetjmp): Save iWMMXt registers + if HWCAP_ARM_IWMMXT set. Don't include . Use + HWCAP_ARM_VFP instead of HWCAP_VFP. + * sysdeps/arm/eabi/__longjmp.S (__longjmp): Restore iWMMXt + registers if HWCAP_ARM_IWMMXT set. Don't include + . Use HWCAP_ARM_VFP instead of HWCAP_VFP. + 2006-09-21 Daniel Jacobowitz * sysdeps/arm/dl-machine.h (elf_machine_rel): Handle undefined diff --git a/sysdeps/arm/eabi/__longjmp.S b/sysdeps/arm/eabi/__longjmp.S index 5677633..fff25cd 100644 --- a/sysdeps/arm/eabi/__longjmp.S +++ b/sysdeps/arm/eabi/__longjmp.S @@ -1,5 +1,5 @@ /* longjmp for ARM. - Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2005, 2006 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 @@ -21,8 +21,6 @@ #define _SETJMP_H #define _ASM #include -#define __ASSEMBLY__ -#include #include /* __longjmp(jmpbuf, val) */ @@ -53,7 +51,7 @@ ENTRY (__longjmp) #endif #endif - tst a2, #HWCAP_VFP + tst a2, #HWCAP_ARM_VFP beq Lno_vfp /* Restore the VFP registers. */ @@ -65,6 +63,19 @@ ENTRY (__longjmp) mcr p10, 7, r1, cr1, cr0, 0 Lno_vfp: + tst a2, #HWCAP_ARM_IWMMXT + beq Lno_iwmmxt + + /* Restore the call-preserved iWMMXt registers. */ + /* Following instructions are wldrd wr10, [ip], #8 (etc.) */ + ldcl p1, cr10, [r12], #8 + ldcl p1, cr11, [r12], #8 + ldcl p1, cr12, [r12], #8 + ldcl p1, cr13, [r12], #8 + ldcl p1, cr14, [r12], #8 + ldcl p1, cr15, [r12], #8 +Lno_iwmmxt: + DO_RET(lr) #ifdef IS_IN_rtld diff --git a/sysdeps/arm/eabi/setjmp.S b/sysdeps/arm/eabi/setjmp.S index d9ad26a..b7d2400 100644 --- a/sysdeps/arm/eabi/setjmp.S +++ b/sysdeps/arm/eabi/setjmp.S @@ -1,5 +1,5 @@ /* setjmp for ARM. - Copyright (C) 1997, 1998, 2005 Free Software Foundation, Inc. + Copyright (C) 1997, 1998, 2005, 2006 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 @@ -21,8 +21,6 @@ #define _SETJMP_H #define _ASM #include -#define __ASSEMBLY__ -#include #include ENTRY (__sigsetjmp) @@ -51,7 +49,7 @@ ENTRY (__sigsetjmp) #endif #endif - tst a3, #HWCAP_VFP + tst a3, #HWCAP_ARM_VFP beq Lno_vfp /* Store the VFP registers. */ @@ -63,6 +61,19 @@ ENTRY (__sigsetjmp) str r2, [ip], #4 Lno_vfp: + tst a3, #HWCAP_ARM_IWMMXT + beq Lno_iwmmxt + + /* Save the call-preserved iWMMXt registers. */ + /* Following instructions are wstrd wr10, [ip], #8 (etc.) */ + stcl p1, cr10, [r12], #8 + stcl p1, cr11, [r12], #8 + stcl p1, cr12, [r12], #8 + stcl p1, cr13, [r12], #8 + stcl p1, cr14, [r12], #8 + stcl p1, cr15, [r12], #8 +Lno_iwmmxt: + /* Make a tail call to __sigjmp_save; it takes the same args. */ B PLTJMP(C_SYMBOL_NAME(__sigjmp_save)) diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.c b/sysdeps/unix/sysv/linux/arm/dl-procinfo.c index 9b87a20..5c913f5 100644 --- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.c +++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.c @@ -1,5 +1,5 @@ /* Data for Linux/ARM version of processor capability information. - Copyright (C) 2001, 2002, 2003 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2003, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 2001. @@ -47,11 +47,12 @@ #if !defined PROCINFO_DECL && defined SHARED ._dl_arm_cap_flags #else -PROCINFO_CLASS const char _dl_arm_cap_flags[8][10] +PROCINFO_CLASS const char _dl_arm_cap_flags[10][10] #endif #ifndef PROCINFO_DECL = { "swp", "half", "thumb", "26bit", "fast-mult", "fpa", "vfp", "edsp", + "java", "iwmmxt", } #endif #if !defined SHARED || defined PROCINFO_DECL diff --git a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h index 35b3334..0c675c6 100644 --- a/sysdeps/unix/sysv/linux/arm/dl-procinfo.h +++ b/sysdeps/unix/sysv/linux/arm/dl-procinfo.h @@ -1,5 +1,5 @@ /* Linux/ARM version of processor capability information handling macros. - Copyright (C) 2001, 2002, 2004 Free Software Foundation, Inc. + Copyright (C) 2001, 2002, 2004, 2006 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Philip Blundell , 2001. @@ -22,8 +22,9 @@ #define _DL_PROCINFO_H 1 #include +#include -#define _DL_HWCAP_COUNT 8 +#define _DL_HWCAP_COUNT 10 /* The kernel provides platform data but it is not interesting. */ #define _DL_HWCAP_PLATFORM 0 @@ -53,19 +54,7 @@ _dl_hwcap_string (int idx) return GLRO(dl_arm_cap_flags)[idx]; }; -enum -{ - HWCAP_ARM_SWP = 1 << 0, - HWCAP_ARM_HALF = 1 << 1, - HWCAP_ARM_THUMB = 1 << 2, - HWCAP_ARM_26BIT = 1 << 3, - HWCAP_ARM_FAST_MULT = 1 << 4, - HWCAP_ARM_FPA = 1 << 5, - HWCAP_ARM_VFP = 1 << 6, - HWCAP_ARM_EDSP = 1 << 7, - - HWCAP_IMPORTANT = (HWCAP_ARM_HALF | HWCAP_ARM_FAST_MULT) -}; +#define HWCAP_IMPORTANT (HWCAP_ARM_HALF | HWCAP_ARM_FAST_MULT) static inline int __attribute__ ((unused)) diff --git a/sysdeps/unix/sysv/linux/arm/sysdep.h b/sysdeps/unix/sysv/linux/arm/sysdep.h index e40add3..7692c1c 100644 --- a/sysdeps/unix/sysv/linux/arm/sysdep.h +++ b/sysdeps/unix/sysv/linux/arm/sysdep.h @@ -37,6 +37,18 @@ #define SYS_ify(syscall_name) (__NR_##syscall_name) +/* The following must match the kernel's . */ +#define HWCAP_ARM_SWP 1 +#define HWCAP_ARM_HALF 2 +#define HWCAP_ARM_THUMB 4 +#define HWCAP_ARM_26BIT 8 +#define HWCAP_ARM_FAST_MULT 16 +#define HWCAP_ARM_FPA 32 +#define HWCAP_ARM_VFP 64 +#define HWCAP_ARM_EDSP 128 +#define HWCAP_ARM_JAVA 256 +#define HWCAP_ARM_IWMMXT 512 + #ifdef __ASSEMBLER__ /* Linux uses a negative return value to indicate syscall errors, -- 2.7.4