-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
asm-generic: add generic ABI headers
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. Signed-off-by: Remis Lima Baima <remis.developer@googlemail.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
- Loading branch information
Arnd Bergmann
authored and
Arnd Bergmann
committed
Jun 11, 2009
1 parent
2864d32
commit 6103ec5
Showing
16 changed files
with
1,049 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
#ifndef __ASM_GENERIC_IOCTLS_H | ||
#define __ASM_GENERIC_IOCTLS_H | ||
|
||
#include <linux/ioctl.h> | ||
|
||
/* | ||
* These are the most common definitions for tty ioctl numbers. | ||
* Most of them do not use the recommended _IOC(), but there is | ||
* probably some source code out there hardcoding the number, | ||
* so we might as well use them for all new platforms. | ||
* | ||
* The architectures that use different values here typically | ||
* try to be compatible with some Unix variants for the same | ||
* architecture. | ||
*/ | ||
|
||
/* 0x54 is just a magic number to make these relatively unique ('T') */ | ||
|
||
#define TCGETS 0x5401 | ||
#define TCSETS 0x5402 | ||
#define TCSETSW 0x5403 | ||
#define TCSETSF 0x5404 | ||
#define TCGETA 0x5405 | ||
#define TCSETA 0x5406 | ||
#define TCSETAW 0x5407 | ||
#define TCSETAF 0x5408 | ||
#define TCSBRK 0x5409 | ||
#define TCXONC 0x540A | ||
#define TCFLSH 0x540B | ||
#define TIOCEXCL 0x540C | ||
#define TIOCNXCL 0x540D | ||
#define TIOCSCTTY 0x540E | ||
#define TIOCGPGRP 0x540F | ||
#define TIOCSPGRP 0x5410 | ||
#define TIOCOUTQ 0x5411 | ||
#define TIOCSTI 0x5412 | ||
#define TIOCGWINSZ 0x5413 | ||
#define TIOCSWINSZ 0x5414 | ||
#define TIOCMGET 0x5415 | ||
#define TIOCMBIS 0x5416 | ||
#define TIOCMBIC 0x5417 | ||
#define TIOCMSET 0x5418 | ||
#define TIOCGSOFTCAR 0x5419 | ||
#define TIOCSSOFTCAR 0x541A | ||
#define FIONREAD 0x541B | ||
#define TIOCINQ FIONREAD | ||
#define TIOCLINUX 0x541C | ||
#define TIOCCONS 0x541D | ||
#define TIOCGSERIAL 0x541E | ||
#define TIOCSSERIAL 0x541F | ||
#define TIOCPKT 0x5420 | ||
#define FIONBIO 0x5421 | ||
#define TIOCNOTTY 0x5422 | ||
#define TIOCSETD 0x5423 | ||
#define TIOCGETD 0x5424 | ||
#define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ | ||
#define TIOCSBRK 0x5427 /* BSD compatibility */ | ||
#define TIOCCBRK 0x5428 /* BSD compatibility */ | ||
#define TIOCGSID 0x5429 /* Return the session ID of FD */ | ||
#define TCGETS2 _IOR('T', 0x2A, struct termios2) | ||
#define TCSETS2 _IOW('T', 0x2B, struct termios2) | ||
#define TCSETSW2 _IOW('T', 0x2C, struct termios2) | ||
#define TCSETSF2 _IOW('T', 0x2D, struct termios2) | ||
#define TIOCGRS485 0x542E | ||
#define TIOCSRS485 0x542F | ||
#define TIOCGPTN _IOR('T', 0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
#define TIOCSPTLCK _IOW('T', 0x31, int) /* Lock/unlock Pty */ | ||
#define TCGETX 0x5432 /* SYS5 TCGETX compatibility */ | ||
#define TCSETX 0x5433 | ||
#define TCSETXF 0x5434 | ||
#define TCSETXW 0x5435 | ||
|
||
#define FIONCLEX 0x5450 | ||
#define FIOCLEX 0x5451 | ||
#define FIOASYNC 0x5452 | ||
#define TIOCSERCONFIG 0x5453 | ||
#define TIOCSERGWILD 0x5454 | ||
#define TIOCSERSWILD 0x5455 | ||
#define TIOCGLCKTRMIOS 0x5456 | ||
#define TIOCSLCKTRMIOS 0x5457 | ||
#define TIOCSERGSTRUCT 0x5458 /* For debugging only */ | ||
#define TIOCSERGETLSR 0x5459 /* Get line status register */ | ||
#define TIOCSERGETMULTI 0x545A /* Get multiport config */ | ||
#define TIOCSERSETMULTI 0x545B /* Set multiport config */ | ||
|
||
#define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ | ||
#define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | ||
|
||
/* | ||
* some architectures define FIOQSIZE as 0x545E, which is used for | ||
* TIOCGHAYESESP on others | ||
*/ | ||
#ifndef FIOQSIZE | ||
# define TIOCGHAYESESP 0x545E /* Get Hayes ESP configuration */ | ||
# define TIOCSHAYESESP 0x545F /* Set Hayes ESP configuration */ | ||
# define FIOQSIZE 0x5460 | ||
#endif | ||
|
||
/* Used for packet mode */ | ||
#define TIOCPKT_DATA 0 | ||
#define TIOCPKT_FLUSHREAD 1 | ||
#define TIOCPKT_FLUSHWRITE 2 | ||
#define TIOCPKT_STOP 4 | ||
#define TIOCPKT_START 8 | ||
#define TIOCPKT_NOSTOP 16 | ||
#define TIOCPKT_DOSTOP 32 | ||
|
||
#define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
|
||
#endif /* __ASM_GENERIC_IOCTLS_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifndef __ASM_GENERIC_MMAN_H | ||
#define __ASM_GENERIC_MMAN_H | ||
|
||
#include <asm-generic/mman-common.h> | ||
|
||
#define MAP_GROWSDOWN 0x0100 /* stack-like segment */ | ||
#define MAP_DENYWRITE 0x0800 /* ETXTBSY */ | ||
#define MAP_EXECUTABLE 0x1000 /* mark it as an executable */ | ||
#define MAP_LOCKED 0x2000 /* pages are locked */ | ||
#define MAP_NORESERVE 0x4000 /* don't check for reservations */ | ||
#define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | ||
#define MAP_NONBLOCK 0x10000 /* do not block on IO */ | ||
#define MAP_STACK 0x20000 /* give out an address that is best suited for process/thread stacks */ | ||
|
||
#define MCL_CURRENT 1 /* lock all current mappings */ | ||
#define MCL_FUTURE 2 /* lock all future mappings */ | ||
|
||
#endif /* __ASM_GENERIC_MMAN_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
#ifndef __ASM_GENERIC_POSIX_TYPES_H | ||
#define __ASM_GENERIC_POSIX_TYPES_H | ||
|
||
#include <asm/bitsperlong.h> | ||
/* | ||
* This file is generally used by user-level software, so you need to | ||
* be a little careful about namespace pollution etc. | ||
* | ||
* First the types that are often defined in different ways across | ||
* architectures, so that you can override them. | ||
*/ | ||
|
||
#ifndef __kernel_ino_t | ||
typedef unsigned long __kernel_ino_t; | ||
#endif | ||
|
||
#ifndef __kernel_mode_t | ||
typedef unsigned int __kernel_mode_t; | ||
#endif | ||
|
||
#ifndef __kernel_nlink_t | ||
typedef unsigned long __kernel_nlink_t; | ||
#endif | ||
|
||
#ifndef __kernel_pid_t | ||
typedef int __kernel_pid_t; | ||
#endif | ||
|
||
#ifndef __kernel_ipc_pid_t | ||
typedef int __kernel_ipc_pid_t; | ||
#endif | ||
|
||
#ifndef __kernel_uid_t | ||
typedef unsigned int __kernel_uid_t; | ||
typedef unsigned int __kernel_gid_t; | ||
#endif | ||
|
||
#ifndef __kernel_suseconds_t | ||
typedef long __kernel_suseconds_t; | ||
#endif | ||
|
||
#ifndef __kernel_daddr_t | ||
typedef int __kernel_daddr_t; | ||
#endif | ||
|
||
#ifndef __kernel_uid32_t | ||
typedef __kernel_uid_t __kernel_uid32_t; | ||
typedef __kernel_gid_t __kernel_gid32_t; | ||
#endif | ||
|
||
#ifndef __kernel_old_uid_t | ||
typedef __kernel_uid_t __kernel_old_uid_t; | ||
typedef __kernel_gid_t __kernel_old_gid_t; | ||
#endif | ||
|
||
#ifndef __kernel_old_dev_t | ||
typedef unsigned int __kernel_old_dev_t; | ||
#endif | ||
|
||
/* | ||
* Most 32 bit architectures use "unsigned int" size_t, | ||
* and all 64 bit architectures use "unsigned long" size_t. | ||
*/ | ||
#ifndef __kernel_size_t | ||
#if __BITS_PER_LONG != 64 | ||
typedef unsigned int __kernel_size_t; | ||
typedef int __kernel_ssize_t; | ||
typedef int __kernel_ptrdiff_t; | ||
#else | ||
typedef unsigned long __kernel_size_t; | ||
typedef long __kernel_ssize_t; | ||
typedef long __kernel_ptrdiff_t; | ||
#endif | ||
#endif | ||
|
||
/* | ||
* anything below here should be completely generic | ||
*/ | ||
typedef long __kernel_off_t; | ||
typedef long long __kernel_loff_t; | ||
typedef long __kernel_time_t; | ||
typedef long __kernel_clock_t; | ||
typedef int __kernel_timer_t; | ||
typedef int __kernel_clockid_t; | ||
typedef char * __kernel_caddr_t; | ||
typedef unsigned short __kernel_uid16_t; | ||
typedef unsigned short __kernel_gid16_t; | ||
|
||
typedef struct { | ||
int val[2]; | ||
} __kernel_fsid_t; | ||
|
||
#ifdef __KERNEL__ | ||
|
||
#undef __FD_SET | ||
static inline void __FD_SET(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
{ | ||
unsigned long __tmp = __fd / __NFDBITS; | ||
unsigned long __rem = __fd % __NFDBITS; | ||
__fdsetp->fds_bits[__tmp] |= (1UL<<__rem); | ||
} | ||
|
||
#undef __FD_CLR | ||
static inline void __FD_CLR(unsigned long __fd, __kernel_fd_set *__fdsetp) | ||
{ | ||
unsigned long __tmp = __fd / __NFDBITS; | ||
unsigned long __rem = __fd % __NFDBITS; | ||
__fdsetp->fds_bits[__tmp] &= ~(1UL<<__rem); | ||
} | ||
|
||
#undef __FD_ISSET | ||
static inline int __FD_ISSET(unsigned long __fd, const __kernel_fd_set *__p) | ||
{ | ||
unsigned long __tmp = __fd / __NFDBITS; | ||
unsigned long __rem = __fd % __NFDBITS; | ||
return (__p->fds_bits[__tmp] & (1UL<<__rem)) != 0; | ||
} | ||
|
||
/* | ||
* This will unroll the loop for the normal constant case (8 ints, | ||
* for a 256-bit fd_set) | ||
*/ | ||
#undef __FD_ZERO | ||
static inline void __FD_ZERO(__kernel_fd_set *__p) | ||
{ | ||
unsigned long *__tmp = __p->fds_bits; | ||
int __i; | ||
|
||
if (__builtin_constant_p(__FDSET_LONGS)) { | ||
switch (__FDSET_LONGS) { | ||
case 16: | ||
__tmp[ 0] = 0; __tmp[ 1] = 0; | ||
__tmp[ 2] = 0; __tmp[ 3] = 0; | ||
__tmp[ 4] = 0; __tmp[ 5] = 0; | ||
__tmp[ 6] = 0; __tmp[ 7] = 0; | ||
__tmp[ 8] = 0; __tmp[ 9] = 0; | ||
__tmp[10] = 0; __tmp[11] = 0; | ||
__tmp[12] = 0; __tmp[13] = 0; | ||
__tmp[14] = 0; __tmp[15] = 0; | ||
return; | ||
|
||
case 8: | ||
__tmp[ 0] = 0; __tmp[ 1] = 0; | ||
__tmp[ 2] = 0; __tmp[ 3] = 0; | ||
__tmp[ 4] = 0; __tmp[ 5] = 0; | ||
__tmp[ 6] = 0; __tmp[ 7] = 0; | ||
return; | ||
|
||
case 4: | ||
__tmp[ 0] = 0; __tmp[ 1] = 0; | ||
__tmp[ 2] = 0; __tmp[ 3] = 0; | ||
return; | ||
} | ||
} | ||
__i = __FDSET_LONGS; | ||
while (__i) { | ||
__i--; | ||
*__tmp = 0; | ||
__tmp++; | ||
} | ||
} | ||
|
||
#endif /* __KERNEL__ */ | ||
|
||
#endif /* __ASM_GENERIC_POSIX_TYPES_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef __ASM_GENERIC_SETUP_H | ||
#define __ASM_GENERIC_SETUP_H | ||
|
||
#define COMMAND_LINE_SIZE 512 | ||
|
||
#endif /* __ASM_GENERIC_SETUP_H */ |
Oops, something went wrong.