[csl-arm] Backport EABI syscall interface fixes

Daniel Jacobowitz drow@false.org
Fri Jan 6 15:40:00 GMT 2006


I've checked in this patch.

-- 
Daniel Jacobowitz
CodeSourcery

2006-01-06  Daniel Jacobowitz  <dan@codesourcery.com>

	Backport from mainline:
	2005-11-15  Daniel Jacobowitz  <dan@codesourcery.com>
	* config/arm/lib1funcs.asm (div0) [L_dvmd_lnx]: Call raise instead
	of making syscalls.
	* config/arm/linux-eabi.h (CLEAR_INSN_CACHE): Define.  Set r7 also.

--- config/arm/lib1funcs.asm	(revision 109350)
+++ config/arm/lib1funcs.asm	(local)
@@ -1,7 +1,7 @@
 @ libgcc routines for ARM cpu.
 @ Division routines, written by Richard Earnshaw, (rearnsha@armltd.co.uk)
 
-/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004
+/* Copyright 1995, 1996, 1998, 1999, 2000, 2003, 2004, 2005, 2006
    Free Software Foundation, Inc.
 
 This file is free software; you can redistribute it and/or modify it
@@ -922,21 +922,15 @@ LSYM(Lover12):
 #ifdef L_dvmd_lnx
 @ GNU/Linux division-by zero handler.  Used in place of L_dvmd_tls
 
-/* Constants taken from <asm/unistd.h> and <asm/signal.h> */
+/* Constant taken from <asm/signal.h>.  */
 #define SIGFPE	8
-#define __NR_SYSCALL_BASE	0x900000
-#define __NR_getpid			(__NR_SYSCALL_BASE+ 20)
-#define __NR_kill			(__NR_SYSCALL_BASE+ 37)
 
 	.code	32
 	FUNC_START div0
 
 	stmfd	sp!, {r1, lr}
-	swi	__NR_getpid
-	cmn	r0, #1000
-	RETLDM	r1 hs
-	mov	r1, #SIGFPE
-	swi	__NR_kill
+	mov	r0, #SIGFPE
+	bl	SYM(raise) __PLT__
 	RETLDM	r1
 
 	FUNC_END div0
--- config/arm/linux-eabi.h	(revision 109350)
+++ config/arm/linux-eabi.h	(local)
@@ -1,5 +1,5 @@
 /* Configuration file for ARM GNU/Linux EABI targets.
-   Copyright (C) 2004
+   Copyright (C) 2004, 2005, 2006
    Free Software Foundation, Inc.
    Contributed by CodeSourcery, LLC   
 
@@ -68,3 +68,18 @@
    non-AAPCS.  */
 #undef WCHAR_TYPE
 #define WCHAR_TYPE (TARGET_AAPCS_BASED ? "unsigned int" : "long int")
+
+/* Clear the instruction cache from `beg' to `end'.  This makes an
+   inline system call to SYS_cacheflush.  It is modified to work with
+   both the original and EABI-only syscall interfaces.  */
+#undef CLEAR_INSN_CACHE
+#define CLEAR_INSN_CACHE(BEG, END)					\
+{									\
+  register unsigned long _beg __asm ("a1") = (unsigned long) (BEG);	\
+  register unsigned long _end __asm ("a2") = (unsigned long) (END);	\
+  register unsigned long _flg __asm ("a3") = 0;				\
+  register unsigned long _scno __asm ("r7") = 0xf0002;			\
+  __asm __volatile ("swi 0x9f0002		@ sys_cacheflush"	\
+		    : "=r" (_beg)					\
+		    : "0" (_beg), "r" (_end), "r" (_flg), "r" (_scno));	\
+}



More information about the Gcc-patches mailing list