Skip to contentSkip to conversation

PATCH [email protected] 1 participant 1 message Apr 27, 2009

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw
Quoted 1 line

From [email protected] Mon Apr 27 16:28:40 2009

References: <[email protected]>
User-Agent: quilt/0.46-1
Date: Mon, 27 Apr 2009 16:20:20 +0200
From: [email protected]
To: [email protected]
Cc: [email protected],
[email protected], [email protected], [email protected], [email protected],
Sam Ravnborg <[email protected]>,
Remis Lima Baima <remis.developer-gM/[email protected]>
Subject: [RFC 10/17] asm-generic: provide generic ABI headers
Content-Disposition: inline; filename=0006-asm-generic-provide-generic-ABI-headers.patch
X-Provags-ID: V01U2FsdGVkX18PSRZiW4+EZJqFTk5r5Yj5Zxoc6HvEGkxOKBW
xlKIlQY3tbNzgAR5oFFoT/CjQ4ViOXH1L5gfF0VuPgx0Nm4EGZ zBYvx/PVahU2VUh4yHWog==

These header files are typically copied from an existing architecture into any new one, slightly modified and then remain untouched until the end of time in the name of ABI stability.

To make it easier for future architectures, provide a sane generic version here. In cases where multiple architectures already use identical code, I used the most common version. In cases like stat.h that are more or less broken everywhere, I provide a version that is meant to be ideal for new architectures.

---

 include/asm-generic/Kbuild        |   12 	12 +	0 -	0 !
 include/asm-generic/auxvec.h      |    8 	8 +	0 -	0 !
 include/asm-generic/ioctls.h      |  110 	110 +	0 -	0 !
 include/asm-generic/param.h       |   24 	24 +	0 -	0 !
 include/asm-generic/posix_types.h |  166 	166 +	0 -	0 !
 include/asm-generic/setup.h       |    6 	6 +	0 -	0 !
 include/asm-generic/socket.h      |   60 	60 +	0 -	0 !
 include/asm-generic/sockios.h     |   13 	13 +	0 -	0 !
 include/asm-generic/stat.h        |   72 	72 +	0 -	0 !
 include/asm-generic/swab.h        |   18 	18 +	0 -	0 !
 include/asm-generic/termbits.h    |  198 	198 +	0 -	0 !
 include/asm-generic/ucontext.h    |   12 	12 +	0 -	0 !
 12 files changed, 699 insertions(+)
 create mode 100644 include/asm-generic/auxvec.h
 create mode 100644 include/asm-generic/ioctls.h
 create mode 100644 include/asm-generic/param.h
 create mode 100644 include/asm-generic/posix_types.h
 create mode 100644 include/asm-generic/setup.h
 create mode 100644 include/asm-generic/socket.h
 create mode 100644 include/asm-generic/sockios.h
 create mode 100644 include/asm-generic/stat.h
 create mode 100644 include/asm-generic/termbits.h
 create mode 100644 include/asm-generic/ucontext.h
include/asm-generic/Kbuild +12 -0
Index: linux-2.6/include/asm-generic/Kbuild
===================================================================
@@ -1,20 +1,32 @@
+header-y += auxvec.h
+header-y += byteorder.h
 header-y += errno-base.h
 header-y += errno.h
 header-y += fcntl.h
 header-y += ioctl.h
+header-y += ioctls.h
 header-y += ipcbuf.h
 header-y += mman-common.h
 header-y += mman.h
 header-y += msgbuf.h
+header-y += param.h
 header-y += poll.h
+header-y += posix_types.h
 header-y += sembuf.h
+header-y += setup.h
 header-y += shmbuf.h
 header-y += shmparam.h
 header-y += signal-defs.h
 header-y += signal.h
+header-y += socket.h
+header-y += sockios.h
+header-y += stat.h
 header-y += statfs.h
+header-y += swab.h
+header-y += termbits.h
 header-y += termios.h
 header-y += types.h
+header-y += ucontext.h
 
 unifdef-y += int-l64.h
 unifdef-y += int-ll64.h
include/asm-generic/auxvec.h new file +8 -0
Index: linux-2.6/include/asm-generic/auxvec.h
===================================================================
@@ -0,0 +1,8 @@
+#ifndef __ASM_GENERIC_AUXVEC_H
+#define __ASM_GENERIC_AUXVEC_H
+/*
+ * Not all architectures need their own auxvec.h, the most
+ * common definitions are already in linux/auxvec.h.
+ */
+
+#endif /* __ASM_GENERIC_AUXVEC_H */
include/asm-generic/ioctls.h new file +110 -0

110 lines not on this page · raw message

include/asm-generic/param.h new file +24 -0
Index: linux-2.6/include/asm-generic/param.h
===================================================================
@@ -0,0 +1,24 @@
+#ifndef __ASM_GENERIC_PARAM_H
+#define __ASM_GENERIC_PARAM_H
+
+#ifdef __KERNEL__
+# define HZ		CONFIG_HZ	/* Internal kernel timer frequency */
+# define USER_HZ	100		/* some user interfaces are */
+# define CLOCKS_PER_SEC	(USER_HZ)       /* in "ticks" like times() */
+#endif
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#ifndef EXEC_PAGESIZE
+#define EXEC_PAGESIZE	4096
+#endif
+
+#ifndef NOGROUP
+#define NOGROUP		(-1)
+#endif
+
+#define MAXHOSTNAMELEN	64	/* max length of hostname */
+
+#endif /* __ASM_GENERIC_PARAM_H */
include/asm-generic/posix_types.h new file +166 -0

166 lines not on this page · raw message

include/asm-generic/setup.h new file +6 -0
Index: linux-2.6/include/asm-generic/setup.h
===================================================================
@@ -0,0 +1,6 @@
+#ifndef __ASM_GENERIC_SETUP_H
+#define __ASM_GENERIC_SETUP_H
+
+#define COMMAND_LINE_SIZE	512
+
+#endif	/* __ASM_GENERIC_SETUP_H */
include/asm-generic/socket.h new file +60 -0

60 lines not on this page · raw message

include/asm-generic/sockios.h new file +13 -0
Index: linux-2.6/include/asm-generic/sockios.h
===================================================================
@@ -0,0 +1,13 @@
+#ifndef __ASM_GENERIC_SOCKIOS_H
+#define __ASM_GENERIC_SOCKIOS_H
+
+/* Socket-level I/O control calls. */
+#define FIOSETOWN	0x8901
+#define SIOCSPGRP	0x8902
+#define FIOGETOWN	0x8903
+#define SIOCGPGRP	0x8904
+#define SIOCATMARK	0x8905
+#define SIOCGSTAMP	0x8906		/* Get stamp (timeval) */
+#define SIOCGSTAMPNS	0x8907		/* Get stamp (timespec) */
+
+#endif /* __ASM_GENERIC_SOCKIOS_H */
include/asm-generic/stat.h new file +72 -0

72 lines not on this page · raw message

include/asm-generic/termbits.h new file +198 -0

198 lines not on this page · raw message

include/asm-generic/ucontext.h new file +12 -0
Index: linux-2.6/include/asm-generic/ucontext.h
===================================================================
@@ -0,0 +1,12 @@
+#ifndef __ASM_GENERIC_UCONTEXT_H
+#define __ASM_GENERIC_UCONTEXT_H
+
+struct ucontext {
+	unsigned long	  uc_flags;
+	struct ucontext  *uc_link;
+	stack_t		  uc_stack;
+	struct sigcontext uc_mcontext;
+	sigset_t	  uc_sigmask;	/* mask last for extensibility */
+};
+
+#endif /* __ASM_GENERIC_UCONTEXT_H */
include/asm-generic/swab.h new file +18 -0
Index: linux-2.6/include/asm-generic/swab.h
===================================================================
@@ -0,0 +1,18 @@
+#ifndef _ASM_GENERIC_SWAB_H
+#define _ASM_GENERIC_SWAB_H
+
+#include <asm/bitsperlong.h>
+
+/*
+ * 32 bit architectures typically (but not always) want to
+ * set __SWAB_64_THRU_32__. In user space, this is only
+ * valid if the compiler supports 64 bit data types.
+ */
+
+#if __BITS_PER_LONG == 32
+#if defined(__GNUC__) && !defined(__STRICT_ANSI__) || defined(__KERNEL__)
+#define __SWAB_64_THRU_32__
+#endif
+#endif
+
+#endif /* _ASM_GENERIC_SWAB_H */
Signature · 4 lines
--
To unsubscribe from this list: send the line "unsubscribe linux-api" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html