]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Remove inclusion of <linux/module.h> and <asm/atomic.h> since that
authorJulian Seward <jseward@acm.org>
Thu, 13 Jun 2002 16:07:51 +0000 (16:07 +0000)
committerJulian Seward <jseward@acm.org>
Thu, 13 Jun 2002 16:07:51 +0000 (16:07 +0000)
seems to lead to a portability swamp.  As a result, remove autoconf
check for <asm/atomic.h>.  Replace all this junk with
VKI_SIZEOF_STRUCT_MODULE (== 96) since that's all I ever wanted to
know in the first place.

git-svn-id: svn://svn.valgrind.org/valgrind/trunk@413

configure.in
coregrind/vg_kerneliface.h
coregrind/vg_unsafe.h
vg_kerneliface.h
vg_syscall_mem.c
vg_unsafe.h

index 4d8b9ec510d847d7914398eeb0e5fa86b7720d16..091b4cebd7be86ed94cbe3161300abede1fcce3f 100644 (file)
@@ -262,7 +262,7 @@ AC_SUBST(PREFERRED_STACK_BOUNDARY)
 
 # Checks for header files.
 AC_HEADER_STDC
-AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h termios.h unistd.h utime.h asm/atomic.h])
+AC_CHECK_HEADERS([fcntl.h malloc.h stdlib.h string.h sys/socket.h sys/statfs.h sys/time.h termios.h unistd.h utime.h])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_TYPE_UID_T
index 8eb7046306750d92e428cd01ab54b07747f8ca41..ef6cd6677d24465f99136d304adfbbbd5ed8c2fd 100644 (file)
@@ -326,6 +326,24 @@ struct vki_stat {
 #define VKI_AT_PHDR   3     /* program headers for program */
 
 
+/* Including <linux/module.h> leads to loads of hassle because then we
+   need <asm/atomic.h> sometimes (RedHat 7.3) and that is a
+   kernel-only header which deliberately #errors on gcc-3.1.  Mucho
+   hassle considering that we only want to know sizeof(struct module).
+   Hence ...
+   #include <stdio.h>
+   #include <asm/atomic.h>
+   #include <linux/module.h>
+
+   int main ( void )
+   {
+      printf ("sizeof(struct module) = %d\n", sizeof(struct module) );
+      return 0;
+    }
+*/
+
+#define VKI_SIZEOF_STRUCT_MODULE 96
 
 #endif /* ndef __VG_KERNELIFACE_H */
 
index cd9f3cd740b82c98697b02bd133b2eb5660a31bf..0f726468d0ca172d2a59fd6594389506a4ba7af6 100644 (file)
 #include <linux/sem.h>    /* for struct sembuf */
 
 #include <linux/isdn.h>   /* for ISDN ioctls */
-#ifdef HAVE_ASM_ATOMIC_H
-#include <asm/atomic.h>   /* necessary for module.h */
-#endif
-#include <linux/module.h> /* for struct module */
 #include <scsi/sg.h>      /* for the SG_* ioctls */
 #include <sched.h>        /* for struct sched_param */
 #include <linux/sysctl.h> /* for struct __sysctl_args */
index 8eb7046306750d92e428cd01ab54b07747f8ca41..ef6cd6677d24465f99136d304adfbbbd5ed8c2fd 100644 (file)
@@ -326,6 +326,24 @@ struct vki_stat {
 #define VKI_AT_PHDR   3     /* program headers for program */
 
 
+/* Including <linux/module.h> leads to loads of hassle because then we
+   need <asm/atomic.h> sometimes (RedHat 7.3) and that is a
+   kernel-only header which deliberately #errors on gcc-3.1.  Mucho
+   hassle considering that we only want to know sizeof(struct module).
+   Hence ...
+   #include <stdio.h>
+   #include <asm/atomic.h>
+   #include <linux/module.h>
+
+   int main ( void )
+   {
+      printf ("sizeof(struct module) = %d\n", sizeof(struct module) );
+      return 0;
+    }
+*/
+
+#define VKI_SIZEOF_STRUCT_MODULE 96
 
 #endif /* ndef __VG_KERNELIFACE_H */
 
index 5fc3cc7ddac3edac7fd9fd2b2764d2d9ff88ced0..e228f8ad7a560e7196548b3035ca3e4d46683210 100644 (file)
@@ -871,7 +871,7 @@ void VG_(perform_assumed_nonblocking_syscall) ( ThreadId tid )
             VG_(printf)("init_module ( %p, %p )\n", arg1, arg2 );
          must_be_readable_asciiz( tst, "init_module(name)", arg1 );
          must_be_readable( tst, "init_module(image)", arg2, 
-                           sizeof(struct module) );
+                           VKI_SIZEOF_STRUCT_MODULE );
          KERNEL_DO_SYSCALL(tid,res);
          break;
 
index cd9f3cd740b82c98697b02bd133b2eb5660a31bf..0f726468d0ca172d2a59fd6594389506a4ba7af6 100644 (file)
 #include <linux/sem.h>    /* for struct sembuf */
 
 #include <linux/isdn.h>   /* for ISDN ioctls */
-#ifdef HAVE_ASM_ATOMIC_H
-#include <asm/atomic.h>   /* necessary for module.h */
-#endif
-#include <linux/module.h> /* for struct module */
 #include <scsi/sg.h>      /* for the SG_* ioctls */
 #include <sched.h>        /* for struct sched_param */
 #include <linux/sysctl.h> /* for struct __sysctl_args */