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

Robert Millan rmh at alioth.debian.org
Sun Feb 19 19:12:06 UTC 2012


Author: rmh
Date: 2012-02-19 19:12:06 +0000 (Sun, 19 Feb 2012)
New Revision: 4106

Added:
   trunk/kfreebsd-kernel-headers/test/cpufunc.c
Modified:
   trunk/kfreebsd-kernel-headers/debian/changelog
   trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff
   trunk/kfreebsd-kernel-headers/debian/patches/014_misc.diff
   trunk/kfreebsd-kernel-headers/debian/rules
   trunk/kfreebsd-kernel-headers/test/Makefile
Log:
  * Misc fixes related to machine/cpufunc.h.  (Closes: #660396)
    - Add sed hack to force __CC_SUPPORTS___INLINE == 1.
    - Remove conflicting declarations for inb(), inw(), outb(), etc.
    - Add new test for machine/cpufunc.h (test/cpufunc.c).

Modified: trunk/kfreebsd-kernel-headers/debian/changelog
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/changelog	2012-02-15 22:23:01 UTC (rev 4105)
+++ trunk/kfreebsd-kernel-headers/debian/changelog	2012-02-19 19:12:06 UTC (rev 4106)
@@ -1,3 +1,12 @@
+kfreebsd-kernel-headers (0.74) UNRELEASED; urgency=low
+
+  * Misc fixes related to machine/cpufunc.h.  (Closes: #660396)
+    - Add sed hack to force __CC_SUPPORTS___INLINE == 1.
+    - Remove conflicting declarations for inb(), inw(), outb(), etc.
+    - Add new test for machine/cpufunc.h (test/cpufunc.c).
+
+ -- Robert Millan <rmh at debian.org>  Sun, 19 Feb 2012 20:08:18 +0100
+
 kfreebsd-kernel-headers (0.73) unstable; urgency=low
 
   * Fix "kernel of FreeBSD headers" misnomer.

Modified: trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff	2012-02-15 22:23:01 UTC (rev 4105)
+++ trunk/kfreebsd-kernel-headers/debian/patches/004_stdint_h.diff	2012-02-19 19:12:06 UTC (rev 4106)
@@ -1,12 +1,3 @@
----
- sys/amd64/include/apm_bios.h |    1 +
- sys/dev/usb/usb_endian.h     |    2 +-
- sys/i386/include/apm_bios.h  |    1 +
- sys/net/if_media.h           |    2 ++
- sys/net80211/_ieee80211.h    |    2 ++
- sys/net80211/ieee80211.h     |    2 ++
- 6 files changed, 9 insertions(+), 1 deletion(-)
-
 --- a/sys/net80211/_ieee80211.h
 +++ b/sys/net80211/_ieee80211.h
 @@ -28,6 +28,8 @@
@@ -102,17 +93,6 @@
  #include <sys/ioccom.h>
  
  #pragma pack(1)
---- a/sys/i386/include/cpufunc.h
-+++ b/sys/i386/include/cpufunc.h
-@@ -38,6 +38,8 @@
- #ifndef _MACHINE_CPUFUNC_H_
- #define	_MACHINE_CPUFUNC_H_
- 
-+#include <stdint.h>
-+
- #ifndef _SYS_CDEFS_H
- #error this file needs sys/cdefs.h as a prerequisite
- #endif
 --- a/sys/netinet/tcp_var.h
 +++ b/sys/netinet/tcp_var.h
 @@ -33,6 +33,7 @@

Modified: trunk/kfreebsd-kernel-headers/debian/patches/014_misc.diff
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/patches/014_misc.diff	2012-02-15 22:23:01 UTC (rev 4105)
+++ trunk/kfreebsd-kernel-headers/debian/patches/014_misc.diff	2012-02-19 19:12:06 UTC (rev 4106)
@@ -1,6 +1,160 @@
+
+See #660396
+
+--- a/sys/amd64/include/cpufunc.h
++++ b/sys/amd64/include/cpufunc.h
+@@ -41,6 +41,8 @@
+ 
+ #include <sys/types.h>
+ 
++#include <stdint.h>
++
+ #ifndef _SYS_CDEFS_H
+ #error this file needs sys/cdefs.h as a prerequisite
+ #endif
+@@ -173,108 +175,6 @@
+ 	__asm __volatile("hlt");
+ }
+ 
+-static __inline u_char
+-inb(unsigned int port)
+-{
+-	unsigned char	data;
+-
+-	__asm __volatile("inb %w1, %0" : "=a" (data) : "Nd" (port));
+-	return (data);
+-}
+-
+-static __inline u_int
+-inl(unsigned int port)
+-{
+-	unsigned int	data;
+-
+-	__asm __volatile("inl %w1, %0" : "=a" (data) : "Nd" (port));
+-	return (data);
+-}
+-
+-static __inline void
+-insb(unsigned int port, void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; insb"
+-			 : "+D" (addr), "+c" (count)
+-			 : "d" (port)
+-			 : "memory");
+-}
+-
+-static __inline void
+-insw(unsigned int port, void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; insw"
+-			 : "+D" (addr), "+c" (count)
+-			 : "d" (port)
+-			 : "memory");
+-}
+-
+-static __inline void
+-insl(unsigned int port, void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; insl"
+-			 : "+D" (addr), "+c" (count)
+-			 : "d" (port)
+-			 : "memory");
+-}
+-
+-static __inline void
+-invd(void)
+-{
+-	__asm __volatile("invd");
+-}
+-
+-static __inline u_short
+-inw(unsigned int port)
+-{
+-	unsigned short	data;
+-
+-	__asm __volatile("inw %w1, %0" : "=a" (data) : "Nd" (port));
+-	return (data);
+-}
+-
+-static __inline void
+-outb(unsigned int port, unsigned char data)
+-{
+-	__asm __volatile("outb %0, %w1" : : "a" (data), "Nd" (port));
+-}
+-
+-static __inline void
+-outl(unsigned int port, unsigned int data)
+-{
+-	__asm __volatile("outl %0, %w1" : : "a" (data), "Nd" (port));
+-}
+-
+-static __inline void
+-outsb(unsigned int port, const void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; outsb"
+-			 : "+S" (addr), "+c" (count)
+-			 : "d" (port));
+-}
+-
+-static __inline void
+-outsw(unsigned int port, const void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; outsw"
+-			 : "+S" (addr), "+c" (count)
+-			 : "d" (port));
+-}
+-
+-static __inline void
+-outsl(unsigned int port, const void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; outsl"
+-			 : "+S" (addr), "+c" (count)
+-			 : "d" (port));
+-}
+-
+-static __inline void
+-outw(unsigned int port, unsigned short data)
+-{
+-	__asm __volatile("outw %0, %w1" : : "a" (data), "Nd" (port));
+-}
+-
+ static __inline void
+ mfence(void)
+ {
+--- a/sys/mips/include/cpufunc.h
++++ b/sys/mips/include/cpufunc.h
+@@ -60,6 +60,7 @@
+ #define	_MACHINE_CPUFUNC_H_
+ 
+ #include <sys/types.h>
++#include <stdint.h>
+ #include <machine/cpuregs.h>
+ 
+ /* 
+--- a/sys/powerpc/include/cpufunc.h
++++ b/sys/powerpc/include/cpufunc.h
+@@ -29,6 +29,8 @@
+ #ifndef _MACHINE_CPUFUNC_H_
+ #define	_MACHINE_CPUFUNC_H_
+ 
++#include <stdint.h>
++
+ /*
+  * Required for user-space atomic.h includes
+  */
+--- a/sys/sparc64/include/cpufunc.h
++++ b/sys/sparc64/include/cpufunc.h
+@@ -29,6 +29,7 @@
+ #ifndef	_MACHINE_CPUFUNC_H_
+ #define	_MACHINE_CPUFUNC_H_
+ 
++#include <stdint.h>
+ #include <machine/asi.h>
+ #include <machine/pstate.h>
+ 
 --- a/sys/i386/include/cpufunc.h
 +++ b/sys/i386/include/cpufunc.h
-@@ -42,6 +42,8 @@
+@@ -40,6 +40,8 @@
  
  #include <sys/types.h>
  
@@ -9,28 +163,112 @@
  #ifndef _SYS_CDEFS_H
  #error this file needs sys/cdefs.h as a prerequisite
  #endif
-@@ -697,11 +699,6 @@
- void	enable_intr(void);
- void	halt(void);
- void	ia32_pause(void);
--unsigned char	inb(unsigned int port);
--unsigned int	inl(unsigned int port);
--void	insb(unsigned int port, void *addr, size_t count);
--void	insl(unsigned int port, void *addr, size_t count);
--void	insw(unsigned int port, void *addr, size_t count);
- register_t	intr_disable(void);
- void	intr_restore(register_t ef);
- void	invd(void);
-@@ -724,12 +721,6 @@
- void	load_fs(unsigned short sel);
- void	load_gs(unsigned short sel);
- void	ltr(unsigned short sel);
--void	outb(unsigned int port, unsigned char data);
--void	outl(unsigned int port, unsigned int data);
--void	outsb(unsigned int port, const void *addr, size_t count);
--void	outsl(unsigned int port, const void *addr, size_t count);
--void	outsw(unsigned int port, const void *addr, size_t count);
--void	outw(unsigned int port, unsigned short data);
- unsigned int	rcr0(void);
- unsigned int	rcr2(void);
- unsigned int	rcr3(void);
+@@ -188,108 +190,6 @@
+ 	__asm __volatile("hlt");
+ }
+ 
+-static __inline u_char
+-inb(unsigned int port)
+-{
+-	unsigned char	data;
+-
+-	__asm __volatile("inb %w1, %0" : "=a" (data) : "Nd" (port));
+-	return (data);
+-}
+-
+-static __inline u_int
+-inl(unsigned int port)
+-{
+-	unsigned int	data;
+-
+-	__asm __volatile("inl %w1, %0" : "=a" (data) : "Nd" (port));
+-	return (data);
+-}
+-
+-static __inline void
+-insb(unsigned int port, void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; insb"
+-			 : "+D" (addr), "+c" (count)
+-			 : "d" (port)
+-			 : "memory");
+-}
+-
+-static __inline void
+-insw(unsigned int port, void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; insw"
+-			 : "+D" (addr), "+c" (count)
+-			 : "d" (port)
+-			 : "memory");
+-}
+-
+-static __inline void
+-insl(unsigned int port, void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; insl"
+-			 : "+D" (addr), "+c" (count)
+-			 : "d" (port)
+-			 : "memory");
+-}
+-
+-static __inline void
+-invd(void)
+-{
+-	__asm __volatile("invd");
+-}
+-
+-static __inline u_short
+-inw(unsigned int port)
+-{
+-	unsigned short	data;
+-
+-	__asm __volatile("inw %w1, %0" : "=a" (data) : "Nd" (port));
+-	return (data);
+-}
+-
+-static __inline void
+-outb(unsigned int port, unsigned char data)
+-{
+-	__asm __volatile("outb %0, %w1" : : "a" (data), "Nd" (port));
+-}
+-
+-static __inline void
+-outl(unsigned int port, unsigned int data)
+-{
+-	__asm __volatile("outl %0, %w1" : : "a" (data), "Nd" (port));
+-}
+-
+-static __inline void
+-outsb(unsigned int port, const void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; outsb"
+-			 : "+S" (addr), "+c" (count)
+-			 : "d" (port));
+-}
+-
+-static __inline void
+-outsw(unsigned int port, const void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; outsw"
+-			 : "+S" (addr), "+c" (count)
+-			 : "d" (port));
+-}
+-
+-static __inline void
+-outsl(unsigned int port, const void *addr, size_t count)
+-{
+-	__asm __volatile("cld; rep; outsl"
+-			 : "+S" (addr), "+c" (count)
+-			 : "d" (port));
+-}
+-
+-static __inline void
+-outw(unsigned int port, unsigned short data)
+-{
+-	__asm __volatile("outw %0, %w1" : : "a" (data), "Nd" (port));
+-}
+-
+ static __inline void
+ ia32_pause(void)
+ {

Modified: trunk/kfreebsd-kernel-headers/debian/rules
===================================================================
--- trunk/kfreebsd-kernel-headers/debian/rules	2012-02-15 22:23:01 UTC (rev 4105)
+++ trunk/kfreebsd-kernel-headers/debian/rules	2012-02-19 19:12:06 UTC (rev 4106)
@@ -56,6 +56,10 @@
 		-e 's/#\s*ifdef\s*__GNUCLIKE_[A-Z_]\+\(\s\|$$\)/#if 1/g' \
 		-e 's/#\s*ifndef\s*__GNUCLIKE_[A-Z_]\+\(\s\|$$\)/#if 0/g' \
 		\
+		-e 's/defined\s*(\s*__CC_SUPPORTS___INLINE\s*)/1/g' \
+		-e 's/#\s*ifdef\s*__CC_SUPPORTS___INLINE\(\s\|$$\)/#if 1/g' \
+		-e 's/#\s*ifndef\s*__CC_SUPPORTS___INLINE\(\s\|$$\)/#if 0/g' \
+		\
 		-e 's/__packed\(\s\|;\)/ __attribute__((__packed__))\1/g' \
 		-e 's/__aligned(\([^)]*\?\))/ __attribute__((aligned(\1)))/g' \
 		-e 's/\(\s\|^\|(\)u_\(char\|int\|short\|long\)\(\s\)/\1unsigned \2\3/g' \

Modified: trunk/kfreebsd-kernel-headers/test/Makefile
===================================================================
--- trunk/kfreebsd-kernel-headers/test/Makefile	2012-02-15 22:23:01 UTC (rev 4105)
+++ trunk/kfreebsd-kernel-headers/test/Makefile	2012-02-19 19:12:06 UTC (rev 4106)
@@ -1,6 +1,7 @@
 TESTS = \
+	cpufunc.o \
+	soundcard.o \
 	usb.o \
-	soundcard.o \
 	$()
 
 CFLAGS = -isystem=../debian/kfreebsd-kernel-headers/usr/include

Added: trunk/kfreebsd-kernel-headers/test/cpufunc.c
===================================================================
--- trunk/kfreebsd-kernel-headers/test/cpufunc.c	                        (rev 0)
+++ trunk/kfreebsd-kernel-headers/test/cpufunc.c	2012-02-19 19:12:06 UTC (rev 4106)
@@ -0,0 +1,7 @@
+#include <sys/types.h>
+
+/* Include potentially conflicting declarations: inb(), inw(), outb(), etc. */
+#include <sys/io.h>
+
+/* Include <machine/cpufunc.h> WITHOUT explicit <stdint.h>. */
+#include <machine/cpufunc.h>




More information about the Glibc-bsd-commits mailing list