This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] reformatting patch for FreeBSD/sparc64


I find this version easier to read and would like to commit it.


2002-10-31  David O'Brien  <obrien@FreeBSD.org>

	* config/sparc/freebsd.h (TRANSFER_FROM_TRAMPOLINE): Reformat.


Index: config/sparc/freebsd.h
===================================================================
RCS file: /cvs/gcc/egcs/gcc/config/sparc/freebsd.h,v
retrieving revision 1.13
diff -u -r1.13 freebsd.h
--- config/sparc/freebsd.h	31 Oct 2002 09:08:11 -0000	1.13
+++ config/sparc/freebsd.h	1 Nov 2002 01:06:32 -0000
@@ -97,35 +97,29 @@
 #define SPARC_DEFAULT_CMODEL	CM_MEDLOW
 
 #define TRANSFER_FROM_TRAMPOLINE					\
-static int need_enable_exec_stack;					\
+  static int need_enable_exec_stack;					\
+  static void check_enabling(void) __attribute__ ((constructor));	\
+  static void check_enabling(void)					\
+  {									\
+    extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\
+    int prot = 0;							\
+    size_t len = sizeof(prot);						\
 									\
-static void check_enabling(void) __attribute__ ((constructor));		\
-static void check_enabling(void)					\
-{									\
-  extern int sysctlbyname(const char *, void *, size_t *, void *, size_t);\
-  size_t len;								\
-  int prot;								\
-									\
-  prot = 0;								\
-  len = sizeof(prot);							\
-  sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0);		\
-  if (prot != 7)							\
-    need_enable_exec_stack = 1;						\
-}									\
-									\
-extern void __enable_execute_stack (void *);				\
-void									\
-__enable_execute_stack (addr)						\
-     void *addr;							\
-{									\
-  if (!need_enable_exec_stack)						\
-    return;								\
-  else {								\
-    /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ 			\
-    if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0)			\
-      perror ("mprotect of trampoline code");				\
+    sysctlbyname ("kern.stackprot", &prot, &len, NULL, 0);		\
+    if (prot != 7)							\
+      need_enable_exec_stack = 1;					\
   }									\
-}
+  extern void __enable_execute_stack (void *);				\
+  void __enable_execute_stack (void *addr)				\
+  {									\
+    if (!need_enable_exec_stack)					\
+      return;								\
+    else {								\
+      /* 7 is PROT_READ | PROT_WRITE | PROT_EXEC */ 			\
+      if (mprotect (addr, TRAMPOLINE_SIZE, 7) < 0)			\
+        perror ("mprotect of trampoline code");				\
+    }									\
+  }
 
 


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]