[Glibc-bsd-commits] r4210 - in trunk/kfreebsd-kernel-headers: debian debian/patches test

Robert Millan rmh at alioth.debian.org
Fri Apr 20 20:46:32 UTC 2012


Author: rmh
Date: 2012-04-20 20:46:31 +0000 (Fri, 20 Apr 2012)
New Revision: 4210

Added:
   trunk/kfreebsd-kernel-headers/test/type_collision.c
   trunk/kfreebsd-kernel-headers/test/uintXX_t.c
Removed:
   trunk/kfreebsd-kernel-headers/debian/patches/001_sys_soundcard.diff
   trunk/kfreebsd-kernel-headers/debian/patches/013_mips.diff
   trunk/kfreebsd-kernel-headers/debian/patches/028_fbio.diff
   trunk/kfreebsd-kernel-headers/debian/patches/sys_types.diff
Modified:
   trunk/kfreebsd-kernel-headers/debian/changelog
   trunk/kfreebsd-kernel-headers/debian/install
   trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff
   trunk/kfreebsd-kernel-headers/debian/patches/018_sys__types.diff
   trunk/kfreebsd-kernel-headers/debian/patches/cpufunc.diff
   trunk/kfreebsd-kernel-headers/debian/patches/series
   trunk/kfreebsd-kernel-headers/debian/patches/type_collision.diff
   trunk/kfreebsd-kernel-headers/debian/rules
   trunk/kfreebsd-kernel-headers/test/Makefile
   trunk/kfreebsd-kernel-headers/test/bus.c
   trunk/kfreebsd-kernel-headers/test/cpufunc.c
   trunk/kfreebsd-kernel-headers/test/in_pcb.c
   trunk/kfreebsd-kernel-headers/test/ppp.c
   trunk/kfreebsd-kernel-headers/test/usb.c
Log:
  * Install kernel version of <sys/types.h> in an alternate location and
    use it internally for the rest of kernel headers.  Add a pair of new
    tests:
    - type_collision.c: Verify there is no collision with the GNU version
      of <sys/types.h>.
    - uintXX_t.c: Check for uintXX_t type availability (for kernel users).

Modified: trunk/kfreebsd-kernel-headers/debian/changelog
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/changelog	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/changelog	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,3 +1,14 @@
+kfreebsd-kernel-headers (0.80) UNRELEASED; urgency=low
+
+  * Install kernel version of <sys/types.h> in an alternate location and
+    use it internally for the rest of kernel headers.  Add a pair of new
+    tests:
+    - type_collision.c: Verify there is no collision with the GNU version
+      of <sys/types.h>.
+    - uintXX_t.c: Check for uintXX_t type availability (for kernel users).
+
+ -- Robert Millan <rmh at debian.org>  Fri, 20 Apr 2012 22:44:35 +0200
+
 kfreebsd-kernel-headers (0.79) unstable; urgency=low
 
   * Add sed rule to replace __printflike.

Modified: trunk/kfreebsd-kernel-headers/debian/install
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/install	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/install	2012-04-20 20:46:31 UTC (rev 4210)
@@ -306,6 +306,8 @@
 sys/sys/tty.h                           usr/include/sys
 sys/sys/ttycom.h                        usr/include/sys
 sys/sys/ttyqueue.h                      usr/include/sys
+# Avoid conflict with <sys/types.h> in glibc
+sys/sys/types.h				usr/include/kern
 sys/sys/ucred.h                         usr/include/sys
 sys/sys/unpcb.h                         usr/include/sys
 sys/sys/user.h                          usr/include/sys

Deleted: trunk/kfreebsd-kernel-headers/debian/patches/001_sys_soundcard.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/001_sys_soundcard.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/001_sys_soundcard.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,17 +0,0 @@
----
- sys/sys/soundcard.h |    4 ++++
- 1 file changed, 4 insertions(+)
-
---- a/sys/sys/soundcard.h
-+++ b/sys/sys/soundcard.h
-@@ -102,6 +102,10 @@
- #define SNDCARD_UART16550      27
- #define SNDCARD_OPL            28
- 
-+/* BSD types are need for the following includes */
-+#define __USE_BSD
-+#undef _SYS_TYPES_H
-+
- #include <sys/types.h>
- #include <machine/endian.h>
- #ifndef _IOWR

Modified: trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -184,7 +184,7 @@
 @@ -20,6 +20,7 @@
  
  #ifndef _KERNEL
- #include <sys/types.h>
+ #include <kern/types.h>
 +#include <stdint.h>
  #endif
  #include <sys/ioccom.h>

Deleted: trunk/kfreebsd-kernel-headers/debian/patches/013_mips.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/013_mips.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/013_mips.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,27 +0,0 @@
----
- sys/mips/include/frame.h |    2 ++
- sys/mips/include/reg.h   |    2 ++
- 2 files changed, 4 insertions(+)
-
---- a/sys/mips/include/frame.h
-+++ b/sys/mips/include/frame.h
-@@ -39,6 +39,8 @@
- 
- #include <sys/types.h>
- 
-+#include <machine/_types.h>	/* f_register_t */
-+
- struct trapframe {
- 	register_t	zero;
- 	register_t	ast;
---- a/sys/mips/include/reg.h
-+++ b/sys/mips/include/reg.h
-@@ -44,6 +44,8 @@
- 
- #include <sys/types.h>
- 
-+#include <machine/_types.h>	/* f_register_t */
-+
- /*
-  * Location of the users' stored registers relative to ZERO.
-  * must be visible to assembly code.

Modified: trunk/kfreebsd-kernel-headers/debian/patches/018_sys__types.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/018_sys__types.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/018_sys__types.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,63 +1,10 @@
 --- a/sys/sys/_types.h
 +++ b/sys/sys/_types.h
-@@ -120,4 +120,66 @@
+@@ -103,4 +103,13 @@
+ 	__int64_t	_mbstateL;	/* for alignment */
  } __mbstate_t;
- #endif
  
-+/* Types below are defined in <sys/types.h> on FreeBSD.  We have to define them
-+   here because <sys/types.h> is GNU-owned (some of them are also GNU types, but
-+   thanks to _GNU_SOURCE non-sense they can't be used unconditionally).  */
-+
-+#ifndef _CLOCK_T_DECLARED
-+typedef	__clock_t	clock_t;
-+#define	_CLOCK_T_DECLARED
-+#endif
-+
-+#ifndef _FFLAGS_T_DECLARED
-+typedef	__fflags_t	fflags_t;	/* file flags */
-+#define	_FFLAGS_T_DECLARED
-+#endif
-+
-+typedef	__fixpt_t	fixpt_t;	/* fixed point number */
-+
-+#ifndef _IN_ADDR_T_DECLARED
-+typedef	__uint32_t	in_addr_t;	/* base type for internet address */
-+#define	_IN_ADDR_T_DECLARED
-+#endif
-+
-+#ifndef _IN_PORT_T_DECLARED
-+typedef	__uint16_t	in_port_t;
-+#define	_IN_PORT_T_DECLARED
-+#endif
-+
-+#ifndef _LWPID_T_DECLARED
-+typedef	__lwpid_t	lwpid_t;	/* Thread ID (a.k.a. LWP) */
-+#define	_LWPID_T_DECLARED
-+#endif
-+
-+#ifndef _NLINK_T_DECLARED
-+typedef	__nlink_t	nlink_t;	/* link count */
-+#define	_NLINK_T_DECLARED
-+#endif
-+
-+#ifndef _RLIM_T_DECLARED
-+typedef	__rlim_t	rlim_t;		/* resource limit */
-+#define	_RLIM_T_DECLARED
-+#endif
-+
-+typedef	__segsz_t	segsz_t;	/* segment size (in pages) */
-+
-+typedef	__u_register_t	u_register_t;
-+typedef	__vm_offset_t	vm_offset_t;
-+typedef	__vm_ooffset_t	vm_ooffset_t;
-+typedef	__vm_paddr_t	vm_paddr_t;
-+typedef	__vm_pindex_t	vm_pindex_t;
-+typedef	__vm_size_t	vm_size_t;
-+typedef	__cpuwhich_t	cpuwhich_t;
-+typedef	__cpulevel_t	cpulevel_t;
-+typedef	__cpusetid_t	cpusetid_t;
-+typedef	__cap_rights_t  cap_rights_t;
-+
++/* FIXME: this belongs in <sys/time.h>.   */
 +#ifndef bintime 
 +#define bintime bintime 
 +struct bintime { 
@@ -67,13 +14,3 @@
 +#endif 
 +                
  #endif /* !_SYS__TYPES_H_ */
---- a/sys/sys/proc.h
-+++ b/sys/sys/proc.h
-@@ -38,6 +38,7 @@
- #ifndef _SYS_PROC_H_
- #define	_SYS_PROC_H_
- 
-+#include <sys/_types.h> 
- #include <sys/callout.h>		/* For struct callout. */
- #include <sys/event.h>			/* For struct klist. */
- #include <sys/condvar.h>

Deleted: trunk/kfreebsd-kernel-headers/debian/patches/028_fbio.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/028_fbio.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/028_fbio.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,15 +0,0 @@
----
- sys/sys/fbio.h |    2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
---- a/sys/sys/fbio.h
-+++ b/sys/sys/fbio.h
-@@ -39,7 +39,7 @@
- #define _SYS_FBIO_H_
- 
- #ifndef _KERNEL
--#include <sys/types.h>
-+#include <sys/_types.h>
- #endif
- #include <sys/ioccom.h>
- 

Modified: trunk/kfreebsd-kernel-headers/debian/patches/cpufunc.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/cpufunc.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/cpufunc.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -5,7 +5,7 @@
 +++ b/sys/amd64/include/cpufunc.h
 @@ -41,6 +41,9 @@
  
- #include <sys/types.h>
+ #include <kern/types.h>
  
 +#include <stdint.h>
 +
@@ -18,7 +18,7 @@
 @@ -60,6 +60,7 @@
  #define	_MACHINE_CPUFUNC_H_
  
- #include <sys/types.h>
+ #include <kern/types.h>
 +#include <stdint.h>
  #include <machine/cpuregs.h>
  
@@ -48,7 +48,7 @@
 +++ b/sys/i386/include/cpufunc.h
 @@ -40,6 +40,9 @@
  
- #include <sys/types.h>
+ #include <kern/types.h>
  
 +#include <stdint.h>
 +

Modified: trunk/kfreebsd-kernel-headers/debian/patches/series
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/series	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/series	2012-04-20 20:46:31 UTC (rev 4210)
@@ -3,11 +3,9 @@
 hide_inpcbgroup.diff
 
 # Patches that are in good shape for merging upstream
-sys_types.diff
 
 # Other patches that might or might not be mergeable
 000_bruno_haible.diff
-001_sys_soundcard.diff
 002_gdb.diff
 004_stdint_h.diff
 005_register_t.diff
@@ -17,7 +15,6 @@
 009_inetutils.diff
 010_glibc.diff
 011_wine.diff
-013_mips.diff
 cpufunc.diff
 015_cam.diff
 018_sys__types.diff
@@ -27,7 +24,6 @@
 024_ioccom.diff
 026_acpiio.diff
 027_ktrace.diff
-028_fbio.diff
 029_conf.diff
 030_pfvar.diff
 031_ufs.diff

Deleted: trunk/kfreebsd-kernel-headers/debian/patches/sys_types.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/sys_types.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/sys_types.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,48 +0,0 @@
---- a/sys/amd64/include/_bus.h
-+++ b/sys/amd64/include/_bus.h
-@@ -31,16 +31,18 @@
- #ifndef AMD64_INCLUDE__BUS_H
- #define AMD64_INCLUDE__BUS_H
- 
-+#include <sys/_types.h>
-+
- /*
-  * Bus address and size types
-  */
--typedef uint64_t bus_addr_t;
--typedef uint64_t bus_size_t;
-+typedef __uint64_t bus_addr_t;
-+typedef __uint64_t bus_size_t;
- 
- /*
-  * Access methods for bus resources and address space.
-  */
--typedef	uint64_t bus_space_tag_t;
--typedef	uint64_t bus_space_handle_t;
-+typedef	__uint64_t bus_space_tag_t;
-+typedef	__uint64_t bus_space_handle_t;
- 
- #endif /* AMD64_INCLUDE__BUS_H */
---- a/sys/i386/include/_bus.h
-+++ b/sys/i386/include/_bus.h
-@@ -31,15 +31,17 @@
- #ifndef I386_INCLUDE__BUS_H
- #define I386_INCLUDE__BUS_H
- 
-+#include <sys/_types.h>
-+
- /*
-  * Bus address and size types
-  */
- #ifdef PAE
--typedef uint64_t bus_addr_t;
-+typedef __uint64_t bus_addr_t;
- #else
--typedef uint32_t bus_addr_t;
-+typedef __uint32_t bus_addr_t;
- #endif
--typedef uint32_t bus_size_t;
-+typedef __uint32_t bus_size_t;
- 
- /*
-  * Access methods for bus resources and address space.

Modified: trunk/kfreebsd-kernel-headers/debian/patches/type_collision.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/type_collision.diff	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/patches/type_collision.diff	2012-04-20 20:46:31 UTC (rev 4210)
@@ -59,7 +59,7 @@
  typedef	struct __mq	*__mqd_t;	/* mq_open()... */
  typedef	__uint32_t	__uid_t;
  typedef	unsigned int	__useconds_t;	/* microseconds (unsigned) */
-@@ -98,9 +111,13 @@
+@@ -98,10 +111,14 @@
   * mbstate_t is an opaque object to keep conversion state during multibyte
   * stream conversions.
   */
@@ -72,7 +72,8 @@
  } __mbstate_t;
 +#endif
  
- #endif /* !_SYS__TYPES_H_ */
+ /* Types below are defined in <sys/types.h> on FreeBSD.  We have to define them
+    here because <sys/types.h> is GNU-owned (some of them are also GNU types, but
 --- a/sys/amd64/include/_types.h
 +++ b/sys/amd64/include/_types.h
 @@ -76,11 +76,19 @@
@@ -151,3 +152,34 @@
  typedef	__int64_t	__segsz_t;		/* segment size (in pages) */
  typedef	__uint64_t	size_t;		/* sizeof() */
  typedef	__int64_t	__ssize_t;		/* byte count or error */
+--- a/sys/sys/types.h
++++ b/sys/sys/types.h
+@@ -44,7 +44,18 @@
+ #include <machine/endian.h>
+ #include <sys/_types.h>
+ 
+-#include <sys/_pthreadtypes.h>
++/* Allow conflicting declarations in glibc <sys/types.h> to override us.  */
++#include <sys/types.h>
++#define _CLOCK_T_DECLARED
++#define _FSBLKCNT_T_DECLARED
++#define _ID_T_DECLARED
++#define _TIME_T_DECLARED
++#define _TIMER_T_DECLARED
++
++/* We can't declare size_t directly because of s/__size_t/size_t/g in
++   debian/rules (see rev 184135 in GCC SVN).  */
++#include <stddef.h>
++#define _SIZE_T_DECLARED
+ 
+ #if __BSD_VISIBLE
+ typedef	unsigned char	u_char;
+@@ -182,8 +193,6 @@
+ #define	_PID_T_DECLARED
+ #endif
+ 
+-typedef	__register_t	register_t;
+-
+ #ifndef _RLIM_T_DECLARED
+ typedef	__rlim_t	rlim_t;		/* resource limit */
+ #define	_RLIM_T_DECLARED

Modified: trunk/kfreebsd-kernel-headers/debian/rules
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/rules	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/debian/rules	2012-04-20 20:46:31 UTC (rev 4210)
@@ -72,6 +72,8 @@
 		-e 's/#\s*ifdef\s*_SYS_CDEFS_H_\(\s\|$$\)/#ifdef _SYS_CDEFS_H/g' \
 		-e 's/#\s*ifndef\s*_SYS_CDEFS_H_\(\s\|$$\)/#ifndef _SYS_CDEFS_H/g' \
 		\
+		-e 's/#\s*include\s\+<sys\/types\.h>\s*/#include <kern\/types.h>/g' \
+		\
 		-e 's/__size_t/size_t/g' \
 	; done) ; \
 	echo "#define __FreeBSD_kernel_version $$fbsd_version" > misc/osreldate.h

Modified: trunk/kfreebsd-kernel-headers/test/Makefile
===================================================================
--- trunk/kfreebsd-kernel-headers/test/Makefile	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/test/Makefile	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,4 +1,7 @@
 TESTS = \
+	type_collision.o \
+	uintXX_t.o \
+	\
 	bus.o \
 	cpufunc.o \
 	in_pcb.o \
@@ -7,7 +10,7 @@
 	usb.o \
 	$()
 
-CFLAGS = -I../debian/kfreebsd-kernel-headers/usr/include
+CFLAGS = -Iinclude -I../debian/kfreebsd-kernel-headers/usr/include
 
 all: $(TESTS)
 

Modified: trunk/kfreebsd-kernel-headers/test/bus.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/bus.c	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/test/bus.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,3 +1,3 @@
 #include <sys/cdefs.h>
-#include <sys/types.h>
+#include <kern/types.h>
 #include <machine/bus.h>

Modified: trunk/kfreebsd-kernel-headers/test/cpufunc.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/cpufunc.c	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/test/cpufunc.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,4 +1,4 @@
-#include <sys/types.h>
+#include <kern/types.h>
 
 /* Include <machine/cpufunc.h> WITHOUT explicit <stdint.h>. */
 #include <machine/cpufunc.h>

Modified: trunk/kfreebsd-kernel-headers/test/in_pcb.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/in_pcb.c	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/test/in_pcb.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,3 +1,3 @@
-#include <sys/types.h>
+#include <kern/types.h>
 #include <netinet/in.h>		/* struct in_addr */
 #include <netinet/in_pcb.h>

Modified: trunk/kfreebsd-kernel-headers/test/ppp.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/ppp.c	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/test/ppp.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,2 +1,2 @@
-#include <sys/types.h>
+#include <kern/types.h>
 #include <net/ppp_defs.h>

Added: trunk/kfreebsd-kernel-headers/test/type_collision.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/type_collision.c	                        (rev 0)
+++ trunk/kfreebsd-kernel-headers/test/type_collision.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -0,0 +1,2 @@
+#include <sys/types.h>
+#include <kern/types.h>

Added: trunk/kfreebsd-kernel-headers/test/uintXX_t.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/uintXX_t.c	                        (rev 0)
+++ trunk/kfreebsd-kernel-headers/test/uintXX_t.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -0,0 +1,9 @@
+/* Test that <kern/types.h> provides uintXX_t without explicitly including
+   <stdint.h>.  */
+
+#include <kern/types.h>
+
+uint8_t a;
+uint16_t b;
+uint32_t c;
+uint64_t d;

Modified: trunk/kfreebsd-kernel-headers/test/usb.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/usb.c	2012-04-19 18:25:30 UTC (rev 4209)
+++ trunk/kfreebsd-kernel-headers/test/usb.c	2012-04-20 20:46:31 UTC (rev 4210)
@@ -1,3 +1,3 @@
-#include <sys/types.h>
+#include <kern/types.h>
 #include <dev/usb/usb.h>
 #include <dev/usb/usbhid.h>




More information about the Glibc-bsd-commits mailing list