diff options
Diffstat (limited to 'arch/alpha/include')
28 files changed, 1611 insertions, 0 deletions
diff --git a/arch/alpha/include/asm/auxvec.h b/arch/alpha/include/asm/auxvec.h new file mode 100644 index 00000000000..e96fe880e31 --- /dev/null +++ b/arch/alpha/include/asm/auxvec.h | |||
@@ -0,0 +1,24 @@ | |||
1 | #ifndef __ASM_ALPHA_AUXVEC_H | ||
2 | #define __ASM_ALPHA_AUXVEC_H | ||
3 | |||
4 | /* Reserve these numbers for any future use of a VDSO. */ | ||
5 | #if 0 | ||
6 | #define AT_SYSINFO 32 | ||
7 | #define AT_SYSINFO_EHDR 33 | ||
8 | #endif | ||
9 | |||
10 | /* More complete cache descriptions than AT_[DIU]CACHEBSIZE. If the | ||
11 | value is -1, then the cache doesn't exist. Otherwise: | ||
12 | |||
13 | bit 0-3: Cache set-associativity; 0 means fully associative. | ||
14 | bit 4-7: Log2 of cacheline size. | ||
15 | bit 8-31: Size of the entire cache >> 8. | ||
16 | bit 32-63: Reserved. | ||
17 | */ | ||
18 | |||
19 | #define AT_L1I_CACHESHAPE 34 | ||
20 | #define AT_L1D_CACHESHAPE 35 | ||
21 | #define AT_L2_CACHESHAPE 36 | ||
22 | #define AT_L3_CACHESHAPE 37 | ||
23 | |||
24 | #endif /* __ASM_ALPHA_AUXVEC_H */ | ||
diff --git a/arch/alpha/include/asm/bitsperlong.h b/arch/alpha/include/asm/bitsperlong.h new file mode 100644 index 00000000000..ad57f786820 --- /dev/null +++ b/arch/alpha/include/asm/bitsperlong.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASM_ALPHA_BITSPERLONG_H | ||
2 | #define __ASM_ALPHA_BITSPERLONG_H | ||
3 | |||
4 | #define __BITS_PER_LONG 64 | ||
5 | |||
6 | #include <asm-generic/bitsperlong.h> | ||
7 | |||
8 | #endif /* __ASM_ALPHA_BITSPERLONG_H */ | ||
diff --git a/arch/alpha/include/asm/byteorder.h b/arch/alpha/include/asm/byteorder.h new file mode 100644 index 00000000000..73683093202 --- /dev/null +++ b/arch/alpha/include/asm/byteorder.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ALPHA_BYTEORDER_H | ||
2 | #define _ALPHA_BYTEORDER_H | ||
3 | |||
4 | #include <linux/byteorder/little_endian.h> | ||
5 | |||
6 | #endif /* _ALPHA_BYTEORDER_H */ | ||
diff --git a/arch/alpha/include/asm/errno.h b/arch/alpha/include/asm/errno.h new file mode 100644 index 00000000000..e5f29ca2818 --- /dev/null +++ b/arch/alpha/include/asm/errno.h | |||
@@ -0,0 +1,127 @@ | |||
1 | #ifndef _ALPHA_ERRNO_H | ||
2 | #define _ALPHA_ERRNO_H | ||
3 | |||
4 | #include <asm-generic/errno-base.h> | ||
5 | |||
6 | #undef EAGAIN /* 11 in errno-base.h */ | ||
7 | |||
8 | #define EDEADLK 11 /* Resource deadlock would occur */ | ||
9 | |||
10 | #define EAGAIN 35 /* Try again */ | ||
11 | #define EWOULDBLOCK EAGAIN /* Operation would block */ | ||
12 | #define EINPROGRESS 36 /* Operation now in progress */ | ||
13 | #define EALREADY 37 /* Operation already in progress */ | ||
14 | #define ENOTSOCK 38 /* Socket operation on non-socket */ | ||
15 | #define EDESTADDRREQ 39 /* Destination address required */ | ||
16 | #define EMSGSIZE 40 /* Message too long */ | ||
17 | #define EPROTOTYPE 41 /* Protocol wrong type for socket */ | ||
18 | #define ENOPROTOOPT 42 /* Protocol not available */ | ||
19 | #define EPROTONOSUPPORT 43 /* Protocol not supported */ | ||
20 | #define ESOCKTNOSUPPORT 44 /* Socket type not supported */ | ||
21 | #define EOPNOTSUPP 45 /* Operation not supported on transport endpoint */ | ||
22 | #define EPFNOSUPPORT 46 /* Protocol family not supported */ | ||
23 | #define EAFNOSUPPORT 47 /* Address family not supported by protocol */ | ||
24 | #define EADDRINUSE 48 /* Address already in use */ | ||
25 | #define EADDRNOTAVAIL 49 /* Cannot assign requested address */ | ||
26 | #define ENETDOWN 50 /* Network is down */ | ||
27 | #define ENETUNREACH 51 /* Network is unreachable */ | ||
28 | #define ENETRESET 52 /* Network dropped connection because of reset */ | ||
29 | #define ECONNABORTED 53 /* Software caused connection abort */ | ||
30 | #define ECONNRESET 54 /* Connection reset by peer */ | ||
31 | #define ENOBUFS 55 /* No buffer space available */ | ||
32 | #define EISCONN 56 /* Transport endpoint is already connected */ | ||
33 | #define ENOTCONN 57 /* Transport endpoint is not connected */ | ||
34 | #define ESHUTDOWN 58 /* Cannot send after transport endpoint shutdown */ | ||
35 | #define ETOOMANYREFS 59 /* Too many references: cannot splice */ | ||
36 | #define ETIMEDOUT 60 /* Connection timed out */ | ||
37 | #define ECONNREFUSED 61 /* Connection refused */ | ||
38 | #define ELOOP 62 /* Too many symbolic links encountered */ | ||
39 | #define ENAMETOOLONG 63 /* File name too long */ | ||
40 | #define EHOSTDOWN 64 /* Host is down */ | ||
41 | #define EHOSTUNREACH 65 /* No route to host */ | ||
42 | #define ENOTEMPTY 66 /* Directory not empty */ | ||
43 | |||
44 | #define EUSERS 68 /* Too many users */ | ||
45 | #define EDQUOT 69 /* Quota exceeded */ | ||
46 | #define ESTALE 70 /* Stale NFS file handle */ | ||
47 | #define EREMOTE 71 /* Object is remote */ | ||
48 | |||
49 | #define ENOLCK 77 /* No record locks available */ | ||
50 | #define ENOSYS 78 /* Function not implemented */ | ||
51 | |||
52 | #define ENOMSG 80 /* No message of desired type */ | ||
53 | #define EIDRM 81 /* Identifier removed */ | ||
54 | #define ENOSR 82 /* Out of streams resources */ | ||
55 | #define ETIME 83 /* Timer expired */ | ||
56 | #define EBADMSG 84 /* Not a data message */ | ||
57 | #define EPROTO 85 /* Protocol error */ | ||
58 | #define ENODATA 86 /* No data available */ | ||
59 | #define ENOSTR 87 /* Device not a stream */ | ||
60 | |||
61 | #define ENOPKG 92 /* Package not installed */ | ||
62 | |||
63 | #define EILSEQ 116 /* Illegal byte sequence */ | ||
64 | |||
65 | /* The following are just random noise.. */ | ||
66 | #define ECHRNG 88 /* Channel number out of range */ | ||
67 | #define EL2NSYNC 89 /* Level 2 not synchronized */ | ||
68 | #define EL3HLT 90 /* Level 3 halted */ | ||
69 | #define EL3RST 91 /* Level 3 reset */ | ||
70 | |||
71 | #define ELNRNG 93 /* Link number out of range */ | ||
72 | #define EUNATCH 94 /* Protocol driver not attached */ | ||
73 | #define ENOCSI 95 /* No CSI structure available */ | ||
74 | #define EL2HLT 96 /* Level 2 halted */ | ||
75 | #define EBADE 97 /* Invalid exchange */ | ||
76 | #define EBADR 98 /* Invalid request descriptor */ | ||
77 | #define EXFULL 99 /* Exchange full */ | ||
78 | #define ENOANO 100 /* No anode */ | ||
79 | #define EBADRQC 101 /* Invalid request code */ | ||
80 | #define EBADSLT 102 /* Invalid slot */ | ||
81 | |||
82 | #define EDEADLOCK EDEADLK | ||
83 | |||
84 | #define EBFONT 104 /* Bad font file format */ | ||
85 | #define ENONET 105 /* Machine is not on the network */ | ||
86 | #define ENOLINK 106 /* Link has been severed */ | ||
87 | #define EADV 107 /* Advertise error */ | ||
88 | #define ESRMNT 108 /* Srmount error */ | ||
89 | #define ECOMM 109 /* Communication error on send */ | ||
90 | #define EMULTIHOP 110 /* Multihop attempted */ | ||
91 | #define EDOTDOT 111 /* RFS specific error */ | ||
92 | #define EOVERFLOW 112 /* Value too large for defined data type */ | ||
93 | #define ENOTUNIQ 113 /* Name not unique on network */ | ||
94 | #define EBADFD 114 /* File descriptor in bad state */ | ||
95 | #define EREMCHG 115 /* Remote address changed */ | ||
96 | |||
97 | #define EUCLEAN 117 /* Structure needs cleaning */ | ||
98 | #define ENOTNAM 118 /* Not a XENIX named type file */ | ||
99 | #define ENAVAIL 119 /* No XENIX semaphores available */ | ||
100 | #define EISNAM 120 /* Is a named type file */ | ||
101 | #define EREMOTEIO 121 /* Remote I/O error */ | ||
102 | |||
103 | #define ELIBACC 122 /* Can not access a needed shared library */ | ||
104 | #define ELIBBAD 123 /* Accessing a corrupted shared library */ | ||
105 | #define ELIBSCN 124 /* .lib section in a.out corrupted */ | ||
106 | #define ELIBMAX 125 /* Attempting to link in too many shared libraries */ | ||
107 | #define ELIBEXEC 126 /* Cannot exec a shared library directly */ | ||
108 | #define ERESTART 127 /* Interrupted system call should be restarted */ | ||
109 | #define ESTRPIPE 128 /* Streams pipe error */ | ||
110 | |||
111 | #define ENOMEDIUM 129 /* No medium found */ | ||
112 | #define EMEDIUMTYPE 130 /* Wrong medium type */ | ||
113 | #define ECANCELED 131 /* Operation Cancelled */ | ||
114 | #define ENOKEY 132 /* Required key not available */ | ||
115 | #define EKEYEXPIRED 133 /* Key has expired */ | ||
116 | #define EKEYREVOKED 134 /* Key has been revoked */ | ||
117 | #define EKEYREJECTED 135 /* Key was rejected by service */ | ||
118 | |||
119 | /* for robust mutexes */ | ||
120 | #define EOWNERDEAD 136 /* Owner died */ | ||
121 | #define ENOTRECOVERABLE 137 /* State not recoverable */ | ||
122 | |||
123 | #define ERFKILL 138 /* Operation not possible due to RF-kill */ | ||
124 | |||
125 | #define EHWPOISON 139 /* Memory page has hardware error */ | ||
126 | |||
127 | #endif | ||
diff --git a/arch/alpha/include/asm/fcntl.h b/arch/alpha/include/asm/fcntl.h new file mode 100644 index 00000000000..1b71ca70c9f --- /dev/null +++ b/arch/alpha/include/asm/fcntl.h | |||
@@ -0,0 +1,58 @@ | |||
1 | #ifndef _ALPHA_FCNTL_H | ||
2 | #define _ALPHA_FCNTL_H | ||
3 | |||
4 | #define O_CREAT 01000 /* not fcntl */ | ||
5 | #define O_TRUNC 02000 /* not fcntl */ | ||
6 | #define O_EXCL 04000 /* not fcntl */ | ||
7 | #define O_NOCTTY 010000 /* not fcntl */ | ||
8 | |||
9 | #define O_NONBLOCK 00004 | ||
10 | #define O_APPEND 00010 | ||
11 | #define O_DSYNC 040000 /* used to be O_SYNC, see below */ | ||
12 | #define O_DIRECTORY 0100000 /* must be a directory */ | ||
13 | #define O_NOFOLLOW 0200000 /* don't follow links */ | ||
14 | #define O_LARGEFILE 0400000 /* will be set by the kernel on every open */ | ||
15 | #define O_DIRECT 02000000 /* direct disk access - should check with OSF/1 */ | ||
16 | #define O_NOATIME 04000000 | ||
17 | #define O_CLOEXEC 010000000 /* set close_on_exec */ | ||
18 | /* | ||
19 | * Before Linux 2.6.33 only O_DSYNC semantics were implemented, but using | ||
20 | * the O_SYNC flag. We continue to use the existing numerical value | ||
21 | * for O_DSYNC semantics now, but using the correct symbolic name for it. | ||
22 | * This new value is used to request true Posix O_SYNC semantics. It is | ||
23 | * defined in this strange way to make sure applications compiled against | ||
24 | * new headers get at least O_DSYNC semantics on older kernels. | ||
25 | * | ||
26 | * This has the nice side-effect that we can simply test for O_DSYNC | ||
27 | * wherever we do not care if O_DSYNC or O_SYNC is used. | ||
28 | * | ||
29 | * Note: __O_SYNC must never be used directly. | ||
30 | */ | ||
31 | #define __O_SYNC 020000000 | ||
32 | #define O_SYNC (__O_SYNC|O_DSYNC) | ||
33 | |||
34 | #define O_PATH 040000000 | ||
35 | |||
36 | #define F_GETLK 7 | ||
37 | #define F_SETLK 8 | ||
38 | #define F_SETLKW 9 | ||
39 | |||
40 | #define F_SETOWN 5 /* for sockets. */ | ||
41 | #define F_GETOWN 6 /* for sockets. */ | ||
42 | #define F_SETSIG 10 /* for sockets. */ | ||
43 | #define F_GETSIG 11 /* for sockets. */ | ||
44 | |||
45 | /* for posix fcntl() and lockf() */ | ||
46 | #define F_RDLCK 1 | ||
47 | #define F_WRLCK 2 | ||
48 | #define F_UNLCK 8 | ||
49 | |||
50 | /* for old implementation of bsd flock () */ | ||
51 | #define F_EXLCK 16 /* or 3 */ | ||
52 | #define F_SHLCK 32 /* or 4 */ | ||
53 | |||
54 | #define F_INPROGRESS 64 | ||
55 | |||
56 | #include <asm-generic/fcntl.h> | ||
57 | |||
58 | #endif | ||
diff --git a/arch/alpha/include/asm/gentrap.h b/arch/alpha/include/asm/gentrap.h new file mode 100644 index 00000000000..ae50cc3192c --- /dev/null +++ b/arch/alpha/include/asm/gentrap.h | |||
@@ -0,0 +1,37 @@ | |||
1 | #ifndef _ASMAXP_GENTRAP_H | ||
2 | #define _ASMAXP_GENTRAP_H | ||
3 | |||
4 | /* | ||
5 | * Definitions for gentrap causes. They are generated by user-level | ||
6 | * programs and therefore should be compatible with the corresponding | ||
7 | * OSF/1 definitions. | ||
8 | */ | ||
9 | #define GEN_INTOVF -1 /* integer overflow */ | ||
10 | #define GEN_INTDIV -2 /* integer division by zero */ | ||
11 | #define GEN_FLTOVF -3 /* fp overflow */ | ||
12 | #define GEN_FLTDIV -4 /* fp division by zero */ | ||
13 | #define GEN_FLTUND -5 /* fp underflow */ | ||
14 | #define GEN_FLTINV -6 /* invalid fp operand */ | ||
15 | #define GEN_FLTINE -7 /* inexact fp operand */ | ||
16 | #define GEN_DECOVF -8 /* decimal overflow (for COBOL??) */ | ||
17 | #define GEN_DECDIV -9 /* decimal division by zero */ | ||
18 | #define GEN_DECINV -10 /* invalid decimal operand */ | ||
19 | #define GEN_ROPRAND -11 /* reserved operand */ | ||
20 | #define GEN_ASSERTERR -12 /* assertion error */ | ||
21 | #define GEN_NULPTRERR -13 /* null pointer error */ | ||
22 | #define GEN_STKOVF -14 /* stack overflow */ | ||
23 | #define GEN_STRLENERR -15 /* string length error */ | ||
24 | #define GEN_SUBSTRERR -16 /* substring error */ | ||
25 | #define GEN_RANGERR -17 /* range error */ | ||
26 | #define GEN_SUBRNG -18 | ||
27 | #define GEN_SUBRNG1 -19 | ||
28 | #define GEN_SUBRNG2 -20 | ||
29 | #define GEN_SUBRNG3 -21 /* these report range errors for */ | ||
30 | #define GEN_SUBRNG4 -22 /* subscripting (indexing) at levels 0..7 */ | ||
31 | #define GEN_SUBRNG5 -23 | ||
32 | #define GEN_SUBRNG6 -24 | ||
33 | #define GEN_SUBRNG7 -25 | ||
34 | |||
35 | /* the remaining codes (-26..-1023) are reserved. */ | ||
36 | |||
37 | #endif /* _ASMAXP_GENTRAP_H */ | ||
diff --git a/arch/alpha/include/asm/ioctl.h b/arch/alpha/include/asm/ioctl.h new file mode 100644 index 00000000000..fc63727f417 --- /dev/null +++ b/arch/alpha/include/asm/ioctl.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #ifndef _ALPHA_IOCTL_H | ||
2 | #define _ALPHA_IOCTL_H | ||
3 | |||
4 | /* | ||
5 | * The original linux ioctl numbering scheme was just a general | ||
6 | * "anything goes" setup, where more or less random numbers were | ||
7 | * assigned. Sorry, I was clueless when I started out on this. | ||
8 | * | ||
9 | * On the alpha, we'll try to clean it up a bit, using a more sane | ||
10 | * ioctl numbering, and also trying to be compatible with OSF/1 in | ||
11 | * the process. I'd like to clean it up for the i386 as well, but | ||
12 | * it's so painful recognizing both the new and the old numbers.. | ||
13 | */ | ||
14 | |||
15 | #define _IOC_NRBITS 8 | ||
16 | #define _IOC_TYPEBITS 8 | ||
17 | #define _IOC_SIZEBITS 13 | ||
18 | #define _IOC_DIRBITS 3 | ||
19 | |||
20 | #define _IOC_NRMASK ((1 << _IOC_NRBITS)-1) | ||
21 | #define _IOC_TYPEMASK ((1 << _IOC_TYPEBITS)-1) | ||
22 | #define _IOC_SIZEMASK ((1 << _IOC_SIZEBITS)-1) | ||
23 | #define _IOC_DIRMASK ((1 << _IOC_DIRBITS)-1) | ||
24 | |||
25 | #define _IOC_NRSHIFT 0 | ||
26 | #define _IOC_TYPESHIFT (_IOC_NRSHIFT+_IOC_NRBITS) | ||
27 | #define _IOC_SIZESHIFT (_IOC_TYPESHIFT+_IOC_TYPEBITS) | ||
28 | #define _IOC_DIRSHIFT (_IOC_SIZESHIFT+_IOC_SIZEBITS) | ||
29 | |||
30 | /* | ||
31 | * Direction bits _IOC_NONE could be 0, but OSF/1 gives it a bit. | ||
32 | * And this turns out useful to catch old ioctl numbers in header | ||
33 | * files for us. | ||
34 | */ | ||
35 | #define _IOC_NONE 1U | ||
36 | #define _IOC_READ 2U | ||
37 | #define _IOC_WRITE 4U | ||
38 | |||
39 | #define _IOC(dir,type,nr,size) \ | ||
40 | ((unsigned int) \ | ||
41 | (((dir) << _IOC_DIRSHIFT) | \ | ||
42 | ((type) << _IOC_TYPESHIFT) | \ | ||
43 | ((nr) << _IOC_NRSHIFT) | \ | ||
44 | ((size) << _IOC_SIZESHIFT))) | ||
45 | |||
46 | /* used to create numbers */ | ||
47 | #define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0) | ||
48 | #define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size)) | ||
49 | #define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size)) | ||
50 | #define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size)) | ||
51 | |||
52 | /* used to decode them.. */ | ||
53 | #define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK) | ||
54 | #define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK) | ||
55 | #define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK) | ||
56 | #define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK) | ||
57 | |||
58 | /* ...and for the drivers/sound files... */ | ||
59 | |||
60 | #define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT) | ||
61 | #define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT) | ||
62 | #define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT) | ||
63 | #define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT) | ||
64 | #define IOCSIZE_SHIFT (_IOC_SIZESHIFT) | ||
65 | |||
66 | #endif /* _ALPHA_IOCTL_H */ | ||
diff --git a/arch/alpha/include/asm/ioctls.h b/arch/alpha/include/asm/ioctls.h new file mode 100644 index 00000000000..80e1cee90f1 --- /dev/null +++ b/arch/alpha/include/asm/ioctls.h | |||
@@ -0,0 +1,114 @@ | |||
1 | #ifndef _ASM_ALPHA_IOCTLS_H | ||
2 | #define _ASM_ALPHA_IOCTLS_H | ||
3 | |||
4 | #include <asm/ioctl.h> | ||
5 | |||
6 | #define FIOCLEX _IO('f', 1) | ||
7 | #define FIONCLEX _IO('f', 2) | ||
8 | #define FIOASYNC _IOW('f', 125, int) | ||
9 | #define FIONBIO _IOW('f', 126, int) | ||
10 | #define FIONREAD _IOR('f', 127, int) | ||
11 | #define TIOCINQ FIONREAD | ||
12 | #define FIOQSIZE _IOR('f', 128, loff_t) | ||
13 | |||
14 | #define TIOCGETP _IOR('t', 8, struct sgttyb) | ||
15 | #define TIOCSETP _IOW('t', 9, struct sgttyb) | ||
16 | #define TIOCSETN _IOW('t', 10, struct sgttyb) /* TIOCSETP wo flush */ | ||
17 | |||
18 | #define TIOCSETC _IOW('t', 17, struct tchars) | ||
19 | #define TIOCGETC _IOR('t', 18, struct tchars) | ||
20 | #define TCGETS _IOR('t', 19, struct termios) | ||
21 | #define TCSETS _IOW('t', 20, struct termios) | ||
22 | #define TCSETSW _IOW('t', 21, struct termios) | ||
23 | #define TCSETSF _IOW('t', 22, struct termios) | ||
24 | |||
25 | #define TCGETA _IOR('t', 23, struct termio) | ||
26 | #define TCSETA _IOW('t', 24, struct termio) | ||
27 | #define TCSETAW _IOW('t', 25, struct termio) | ||
28 | #define TCSETAF _IOW('t', 28, struct termio) | ||
29 | |||
30 | #define TCSBRK _IO('t', 29) | ||
31 | #define TCXONC _IO('t', 30) | ||
32 | #define TCFLSH _IO('t', 31) | ||
33 | |||
34 | #define TIOCSWINSZ _IOW('t', 103, struct winsize) | ||
35 | #define TIOCGWINSZ _IOR('t', 104, struct winsize) | ||
36 | #define TIOCSTART _IO('t', 110) /* start output, like ^Q */ | ||
37 | #define TIOCSTOP _IO('t', 111) /* stop output, like ^S */ | ||
38 | #define TIOCOUTQ _IOR('t', 115, int) /* output queue size */ | ||
39 | |||
40 | #define TIOCGLTC _IOR('t', 116, struct ltchars) | ||
41 | #define TIOCSLTC _IOW('t', 117, struct ltchars) | ||
42 | #define TIOCSPGRP _IOW('t', 118, int) | ||
43 | #define TIOCGPGRP _IOR('t', 119, int) | ||
44 | |||
45 | #define TIOCEXCL 0x540C | ||
46 | #define TIOCNXCL 0x540D | ||
47 | #define TIOCSCTTY 0x540E | ||
48 | |||
49 | #define TIOCSTI 0x5412 | ||
50 | #define TIOCMGET 0x5415 | ||
51 | #define TIOCMBIS 0x5416 | ||
52 | #define TIOCMBIC 0x5417 | ||
53 | #define TIOCMSET 0x5418 | ||
54 | # define TIOCM_LE 0x001 | ||
55 | # define TIOCM_DTR 0x002 | ||
56 | # define TIOCM_RTS 0x004 | ||
57 | # define TIOCM_ST 0x008 | ||
58 | # define TIOCM_SR 0x010 | ||
59 | # define TIOCM_CTS 0x020 | ||
60 | # define TIOCM_CAR 0x040 | ||
61 | # define TIOCM_RNG 0x080 | ||
62 | # define TIOCM_DSR 0x100 | ||
63 | # define TIOCM_CD TIOCM_CAR | ||
64 | # define TIOCM_RI TIOCM_RNG | ||
65 | # define TIOCM_OUT1 0x2000 | ||
66 | # define TIOCM_OUT2 0x4000 | ||
67 | # define TIOCM_LOOP 0x8000 | ||
68 | |||
69 | #define TIOCGSOFTCAR 0x5419 | ||
70 | #define TIOCSSOFTCAR 0x541A | ||
71 | #define TIOCLINUX 0x541C | ||
72 | #define TIOCCONS 0x541D | ||
73 | #define TIOCGSERIAL 0x541E | ||
74 | #define TIOCSSERIAL 0x541F | ||
75 | #define TIOCPKT 0x5420 | ||
76 | # define TIOCPKT_DATA 0 | ||
77 | # define TIOCPKT_FLUSHREAD 1 | ||
78 | # define TIOCPKT_FLUSHWRITE 2 | ||
79 | # define TIOCPKT_STOP 4 | ||
80 | # define TIOCPKT_START 8 | ||
81 | # define TIOCPKT_NOSTOP 16 | ||
82 | # define TIOCPKT_DOSTOP 32 | ||
83 | # define TIOCPKT_IOCTL 64 | ||
84 | |||
85 | |||
86 | #define TIOCNOTTY 0x5422 | ||
87 | #define TIOCSETD 0x5423 | ||
88 | #define TIOCGETD 0x5424 | ||
89 | #define TCSBRKP 0x5425 /* Needed for POSIX tcsendbreak() */ | ||
90 | #define TIOCSBRK 0x5427 /* BSD compatibility */ | ||
91 | #define TIOCCBRK 0x5428 /* BSD compatibility */ | ||
92 | #define TIOCGSID 0x5429 /* Return the session ID of FD */ | ||
93 | #define TIOCGPTN _IOR('T',0x30, unsigned int) /* Get Pty Number (of pty-mux device) */ | ||
94 | #define TIOCSPTLCK _IOW('T',0x31, int) /* Lock/unlock Pty */ | ||
95 | #define TIOCGDEV _IOR('T',0x32, unsigned int) /* Get primary device node of /dev/console */ | ||
96 | #define TIOCSIG _IOW('T',0x36, int) /* Generate signal on Pty slave */ | ||
97 | #define TIOCVHANGUP 0x5437 | ||
98 | |||
99 | #define TIOCSERCONFIG 0x5453 | ||
100 | #define TIOCSERGWILD 0x5454 | ||
101 | #define TIOCSERSWILD 0x5455 | ||
102 | #define TIOCGLCKTRMIOS 0x5456 | ||
103 | #define TIOCSLCKTRMIOS 0x5457 | ||
104 | #define TIOCSERGSTRUCT 0x5458 /* For debugging only */ | ||
105 | #define TIOCSERGETLSR 0x5459 /* Get line status register */ | ||
106 | /* ioctl (fd, TIOCSERGETLSR, &result) where result may be as below */ | ||
107 | # define TIOCSER_TEMT 0x01 /* Transmitter physically empty */ | ||
108 | #define TIOCSERGETMULTI 0x545A /* Get multiport config */ | ||
109 | #define TIOCSERSETMULTI 0x545B /* Set multiport config */ | ||
110 | |||
111 | #define TIOCMIWAIT 0x545C /* wait for a change on serial input line(s) */ | ||
112 | #define TIOCGICOUNT 0x545D /* read serial port inline interrupt counts */ | ||
113 | |||
114 | #endif /* _ASM_ALPHA_IOCTLS_H */ | ||
diff --git a/arch/alpha/include/asm/ipcbuf.h b/arch/alpha/include/asm/ipcbuf.h new file mode 100644 index 00000000000..d9c0e1a5070 --- /dev/null +++ b/arch/alpha/include/asm/ipcbuf.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef _ALPHA_IPCBUF_H | ||
2 | #define _ALPHA_IPCBUF_H | ||
3 | |||
4 | /* | ||
5 | * The ipc64_perm structure for alpha architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 32-bit seq | ||
11 | * - 2 miscellaneous 64-bit values | ||
12 | */ | ||
13 | |||
14 | struct ipc64_perm | ||
15 | { | ||
16 | __kernel_key_t key; | ||
17 | __kernel_uid_t uid; | ||
18 | __kernel_gid_t gid; | ||
19 | __kernel_uid_t cuid; | ||
20 | __kernel_gid_t cgid; | ||
21 | __kernel_mode_t mode; | ||
22 | unsigned short seq; | ||
23 | unsigned short __pad1; | ||
24 | unsigned long __unused1; | ||
25 | unsigned long __unused2; | ||
26 | }; | ||
27 | |||
28 | #endif /* _ALPHA_IPCBUF_H */ | ||
diff --git a/arch/alpha/include/asm/mman.h b/arch/alpha/include/asm/mman.h new file mode 100644 index 00000000000..72db984f878 --- /dev/null +++ b/arch/alpha/include/asm/mman.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef __ALPHA_MMAN_H__ | ||
2 | #define __ALPHA_MMAN_H__ | ||
3 | |||
4 | #define PROT_READ 0x1 /* page can be read */ | ||
5 | #define PROT_WRITE 0x2 /* page can be written */ | ||
6 | #define PROT_EXEC 0x4 /* page can be executed */ | ||
7 | #define PROT_SEM 0x8 /* page may be used for atomic ops */ | ||
8 | #define PROT_NONE 0x0 /* page can not be accessed */ | ||
9 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | ||
10 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ | ||
11 | |||
12 | #define MAP_SHARED 0x01 /* Share changes */ | ||
13 | #define MAP_PRIVATE 0x02 /* Changes are private */ | ||
14 | #define MAP_TYPE 0x0f /* Mask for type of mapping (OSF/1 is _wrong_) */ | ||
15 | #define MAP_FIXED 0x100 /* Interpret addr exactly */ | ||
16 | #define MAP_ANONYMOUS 0x10 /* don't use a file */ | ||
17 | |||
18 | /* not used by linux, but here to make sure we don't clash with OSF/1 defines */ | ||
19 | #define _MAP_HASSEMAPHORE 0x0200 | ||
20 | #define _MAP_INHERIT 0x0400 | ||
21 | #define _MAP_UNALIGNED 0x0800 | ||
22 | |||
23 | /* These are linux-specific */ | ||
24 | #define MAP_GROWSDOWN 0x01000 /* stack-like segment */ | ||
25 | #define MAP_DENYWRITE 0x02000 /* ETXTBSY */ | ||
26 | #define MAP_EXECUTABLE 0x04000 /* mark it as an executable */ | ||
27 | #define MAP_LOCKED 0x08000 /* lock the mapping */ | ||
28 | #define MAP_NORESERVE 0x10000 /* don't check for reservations */ | ||
29 | #define MAP_POPULATE 0x20000 /* populate (prefault) pagetables */ | ||
30 | #define MAP_NONBLOCK 0x40000 /* do not block on IO */ | ||
31 | #define MAP_STACK 0x80000 /* give out an address that is best suited for process/thread stacks */ | ||
32 | #define MAP_HUGETLB 0x100000 /* create a huge page mapping */ | ||
33 | |||
34 | #define MS_ASYNC 1 /* sync memory asynchronously */ | ||
35 | #define MS_SYNC 2 /* synchronous memory sync */ | ||
36 | #define MS_INVALIDATE 4 /* invalidate the caches */ | ||
37 | |||
38 | #define MCL_CURRENT 8192 /* lock all currently mapped pages */ | ||
39 | #define MCL_FUTURE 16384 /* lock all additions to address space */ | ||
40 | |||
41 | #define MADV_NORMAL 0 /* no further special treatment */ | ||
42 | #define MADV_RANDOM 1 /* expect random page references */ | ||
43 | #define MADV_SEQUENTIAL 2 /* expect sequential page references */ | ||
44 | #define MADV_WILLNEED 3 /* will need these pages */ | ||
45 | #define MADV_SPACEAVAIL 5 /* ensure resources are available */ | ||
46 | #define MADV_DONTNEED 6 /* don't need these pages */ | ||
47 | |||
48 | /* common/generic parameters */ | ||
49 | #define MADV_REMOVE 9 /* remove these pages & resources */ | ||
50 | #define MADV_DONTFORK 10 /* don't inherit across fork */ | ||
51 | #define MADV_DOFORK 11 /* do inherit across fork */ | ||
52 | |||
53 | #define MADV_MERGEABLE 12 /* KSM may merge identical pages */ | ||
54 | #define MADV_UNMERGEABLE 13 /* KSM may not merge identical pages */ | ||
55 | |||
56 | #define MADV_HUGEPAGE 14 /* Worth backing with hugepages */ | ||
57 | #define MADV_NOHUGEPAGE 15 /* Not worth backing with hugepages */ | ||
58 | |||
59 | /* compatibility flags */ | ||
60 | #define MAP_FILE 0 | ||
61 | |||
62 | #endif /* __ALPHA_MMAN_H__ */ | ||
diff --git a/arch/alpha/include/asm/msgbuf.h b/arch/alpha/include/asm/msgbuf.h new file mode 100644 index 00000000000..98496501a2b --- /dev/null +++ b/arch/alpha/include/asm/msgbuf.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef _ALPHA_MSGBUF_H | ||
2 | #define _ALPHA_MSGBUF_H | ||
3 | |||
4 | /* | ||
5 | * The msqid64_ds structure for alpha architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 2 miscellaneous 64-bit values | ||
11 | */ | ||
12 | |||
13 | struct msqid64_ds { | ||
14 | struct ipc64_perm msg_perm; | ||
15 | __kernel_time_t msg_stime; /* last msgsnd time */ | ||
16 | __kernel_time_t msg_rtime; /* last msgrcv time */ | ||
17 | __kernel_time_t msg_ctime; /* last change time */ | ||
18 | unsigned long msg_cbytes; /* current number of bytes on queue */ | ||
19 | unsigned long msg_qnum; /* number of messages in queue */ | ||
20 | unsigned long msg_qbytes; /* max number of bytes on queue */ | ||
21 | __kernel_pid_t msg_lspid; /* pid of last msgsnd */ | ||
22 | __kernel_pid_t msg_lrpid; /* last receive pid */ | ||
23 | unsigned long __unused1; | ||
24 | unsigned long __unused2; | ||
25 | }; | ||
26 | |||
27 | #endif /* _ALPHA_MSGBUF_H */ | ||
diff --git a/arch/alpha/include/asm/poll.h b/arch/alpha/include/asm/poll.h new file mode 100644 index 00000000000..c98509d3149 --- /dev/null +++ b/arch/alpha/include/asm/poll.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/poll.h> | |||
diff --git a/arch/alpha/include/asm/posix_types.h b/arch/alpha/include/asm/posix_types.h new file mode 100644 index 00000000000..db167413300 --- /dev/null +++ b/arch/alpha/include/asm/posix_types.h | |||
@@ -0,0 +1,123 @@ | |||
1 | #ifndef _ALPHA_POSIX_TYPES_H | ||
2 | #define _ALPHA_POSIX_TYPES_H | ||
3 | |||
4 | /* | ||
5 | * This file is generally used by user-level software, so you need to | ||
6 | * be a little careful about namespace pollution etc. Also, we cannot | ||
7 | * assume GCC is being used. | ||
8 | */ | ||
9 | |||
10 | typedef unsigned int __kernel_ino_t; | ||
11 | typedef unsigned int __kernel_mode_t; | ||
12 | typedef unsigned int __kernel_nlink_t; | ||
13 | typedef long __kernel_off_t; | ||
14 | typedef long long __kernel_loff_t; | ||
15 | typedef int __kernel_pid_t; | ||
16 | typedef int __kernel_ipc_pid_t; | ||
17 | typedef unsigned int __kernel_uid_t; | ||
18 | typedef unsigned int __kernel_gid_t; | ||
19 | typedef unsigned long __kernel_size_t; | ||
20 | typedef long __kernel_ssize_t; | ||
21 | typedef long __kernel_ptrdiff_t; | ||
22 | typedef long __kernel_time_t; | ||
23 | typedef long __kernel_suseconds_t; | ||
24 | typedef long __kernel_clock_t; | ||
25 | typedef int __kernel_daddr_t; | ||
26 | typedef char * __kernel_caddr_t; | ||
27 | typedef unsigned long __kernel_sigset_t; /* at least 32 bits */ | ||
28 | typedef unsigned short __kernel_uid16_t; | ||
29 | typedef unsigned short __kernel_gid16_t; | ||
30 | typedef int __kernel_clockid_t; | ||
31 | typedef int __kernel_timer_t; | ||
32 | |||
33 | typedef struct { | ||
34 | int val[2]; | ||
35 | } __kernel_fsid_t; | ||
36 | |||
37 | typedef __kernel_uid_t __kernel_old_uid_t; | ||
38 | typedef __kernel_gid_t __kernel_old_gid_t; | ||
39 | typedef __kernel_uid_t __kernel_uid32_t; | ||
40 | typedef __kernel_gid_t __kernel_gid32_t; | ||
41 | |||
42 | typedef unsigned int __kernel_old_dev_t; | ||
43 | |||
44 | #ifdef __KERNEL__ | ||
45 | |||
46 | #ifndef __GNUC__ | ||
47 | |||
48 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | ||
49 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | ||
50 | #define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) | ||
51 | #define __FD_ZERO(set) \ | ||
52 | ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set))) | ||
53 | |||
54 | #else /* __GNUC__ */ | ||
55 | |||
56 | /* With GNU C, use inline functions instead so args are evaluated only once: */ | ||
57 | |||
58 | #undef __FD_SET | ||
59 | static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) | ||
60 | { | ||
61 | unsigned long _tmp = fd / __NFDBITS; | ||
62 | unsigned long _rem = fd % __NFDBITS; | ||
63 | fdsetp->fds_bits[_tmp] |= (1UL<<_rem); | ||
64 | } | ||
65 | |||
66 | #undef __FD_CLR | ||
67 | static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) | ||
68 | { | ||
69 | unsigned long _tmp = fd / __NFDBITS; | ||
70 | unsigned long _rem = fd % __NFDBITS; | ||
71 | fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); | ||
72 | } | ||
73 | |||
74 | #undef __FD_ISSET | ||
75 | static __inline__ int __FD_ISSET(unsigned long fd, const __kernel_fd_set *p) | ||
76 | { | ||
77 | unsigned long _tmp = fd / __NFDBITS; | ||
78 | unsigned long _rem = fd % __NFDBITS; | ||
79 | return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; | ||
80 | } | ||
81 | |||
82 | /* | ||
83 | * This will unroll the loop for the normal constant case (8 ints, | ||
84 | * for a 256-bit fd_set) | ||
85 | */ | ||
86 | #undef __FD_ZERO | ||
87 | static __inline__ void __FD_ZERO(__kernel_fd_set *p) | ||
88 | { | ||
89 | unsigned long *tmp = p->fds_bits; | ||
90 | int i; | ||
91 | |||
92 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
93 | switch (__FDSET_LONGS) { | ||
94 | case 16: | ||
95 | tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; | ||
96 | tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; | ||
97 | tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0; | ||
98 | tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0; | ||
99 | return; | ||
100 | |||
101 | case 8: | ||
102 | tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; | ||
103 | tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; | ||
104 | return; | ||
105 | |||
106 | case 4: | ||
107 | tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; | ||
108 | return; | ||
109 | } | ||
110 | } | ||
111 | i = __FDSET_LONGS; | ||
112 | while (i) { | ||
113 | i--; | ||
114 | *tmp = 0; | ||
115 | tmp++; | ||
116 | } | ||
117 | } | ||
118 | |||
119 | #endif /* __GNUC__ */ | ||
120 | |||
121 | #endif /* __KERNEL__ */ | ||
122 | |||
123 | #endif /* _ALPHA_POSIX_TYPES_H */ | ||
diff --git a/arch/alpha/include/asm/reg.h b/arch/alpha/include/asm/reg.h new file mode 100644 index 00000000000..86ff916fb06 --- /dev/null +++ b/arch/alpha/include/asm/reg.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef __reg_h__ | ||
2 | #define __reg_h__ | ||
3 | |||
4 | /* | ||
5 | * Exception frame offsets. | ||
6 | */ | ||
7 | #define EF_V0 0 | ||
8 | #define EF_T0 1 | ||
9 | #define EF_T1 2 | ||
10 | #define EF_T2 3 | ||
11 | #define EF_T3 4 | ||
12 | #define EF_T4 5 | ||
13 | #define EF_T5 6 | ||
14 | #define EF_T6 7 | ||
15 | #define EF_T7 8 | ||
16 | #define EF_S0 9 | ||
17 | #define EF_S1 10 | ||
18 | #define EF_S2 11 | ||
19 | #define EF_S3 12 | ||
20 | #define EF_S4 13 | ||
21 | #define EF_S5 14 | ||
22 | #define EF_S6 15 | ||
23 | #define EF_A3 16 | ||
24 | #define EF_A4 17 | ||
25 | #define EF_A5 18 | ||
26 | #define EF_T8 19 | ||
27 | #define EF_T9 20 | ||
28 | #define EF_T10 21 | ||
29 | #define EF_T11 22 | ||
30 | #define EF_RA 23 | ||
31 | #define EF_T12 24 | ||
32 | #define EF_AT 25 | ||
33 | #define EF_SP 26 | ||
34 | #define EF_PS 27 | ||
35 | #define EF_PC 28 | ||
36 | #define EF_GP 29 | ||
37 | #define EF_A0 30 | ||
38 | #define EF_A1 31 | ||
39 | #define EF_A2 32 | ||
40 | |||
41 | #define EF_SIZE (33*8) | ||
42 | #define HWEF_SIZE (6*8) /* size of PAL frame (PS-A2) */ | ||
43 | |||
44 | #define EF_SSIZE (EF_SIZE - HWEF_SIZE) | ||
45 | |||
46 | /* | ||
47 | * Map register number into core file offset. | ||
48 | */ | ||
49 | #define CORE_REG(reg, ubase) \ | ||
50 | (((unsigned long *)((unsigned long)(ubase)))[reg]) | ||
51 | |||
52 | #endif /* __reg_h__ */ | ||
diff --git a/arch/alpha/include/asm/regdef.h b/arch/alpha/include/asm/regdef.h new file mode 100644 index 00000000000..142df9c4f8b --- /dev/null +++ b/arch/alpha/include/asm/regdef.h | |||
@@ -0,0 +1,44 @@ | |||
1 | #ifndef __alpha_regdef_h__ | ||
2 | #define __alpha_regdef_h__ | ||
3 | |||
4 | #define v0 $0 /* function return value */ | ||
5 | |||
6 | #define t0 $1 /* temporary registers (caller-saved) */ | ||
7 | #define t1 $2 | ||
8 | #define t2 $3 | ||
9 | #define t3 $4 | ||
10 | #define t4 $5 | ||
11 | #define t5 $6 | ||
12 | #define t6 $7 | ||
13 | #define t7 $8 | ||
14 | |||
15 | #define s0 $9 /* saved-registers (callee-saved registers) */ | ||
16 | #define s1 $10 | ||
17 | #define s2 $11 | ||
18 | #define s3 $12 | ||
19 | #define s4 $13 | ||
20 | #define s5 $14 | ||
21 | #define s6 $15 | ||
22 | #define fp s6 /* frame-pointer (s6 in frame-less procedures) */ | ||
23 | |||
24 | #define a0 $16 /* argument registers (caller-saved) */ | ||
25 | #define a1 $17 | ||
26 | #define a2 $18 | ||
27 | #define a3 $19 | ||
28 | #define a4 $20 | ||
29 | #define a5 $21 | ||
30 | |||
31 | #define t8 $22 /* more temps (caller-saved) */ | ||
32 | #define t9 $23 | ||
33 | #define t10 $24 | ||
34 | #define t11 $25 | ||
35 | #define ra $26 /* return address register */ | ||
36 | #define t12 $27 | ||
37 | |||
38 | #define pv t12 /* procedure-variable register */ | ||
39 | #define AT $at /* assembler temporary */ | ||
40 | #define gp $29 /* global pointer */ | ||
41 | #define sp $30 /* stack pointer */ | ||
42 | #define zero $31 /* reads as zero, writes are noops */ | ||
43 | |||
44 | #endif /* __alpha_regdef_h__ */ | ||
diff --git a/arch/alpha/include/asm/resource.h b/arch/alpha/include/asm/resource.h new file mode 100644 index 00000000000..c10874ff597 --- /dev/null +++ b/arch/alpha/include/asm/resource.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef _ALPHA_RESOURCE_H | ||
2 | #define _ALPHA_RESOURCE_H | ||
3 | |||
4 | /* | ||
5 | * Alpha/Linux-specific ordering of these four resource limit IDs, | ||
6 | * the rest comes from the generic header: | ||
7 | */ | ||
8 | #define RLIMIT_NOFILE 6 /* max number of open files */ | ||
9 | #define RLIMIT_AS 7 /* address space limit */ | ||
10 | #define RLIMIT_NPROC 8 /* max number of processes */ | ||
11 | #define RLIMIT_MEMLOCK 9 /* max locked-in-memory address space */ | ||
12 | |||
13 | /* | ||
14 | * SuS says limits have to be unsigned. Fine, it's unsigned, but | ||
15 | * we retain the old value for compatibility, especially with DU. | ||
16 | * When you run into the 2^63 barrier, you call me. | ||
17 | */ | ||
18 | #define RLIM_INFINITY 0x7ffffffffffffffful | ||
19 | |||
20 | #include <asm-generic/resource.h> | ||
21 | |||
22 | #endif /* _ALPHA_RESOURCE_H */ | ||
diff --git a/arch/alpha/include/asm/sembuf.h b/arch/alpha/include/asm/sembuf.h new file mode 100644 index 00000000000..7b38b153478 --- /dev/null +++ b/arch/alpha/include/asm/sembuf.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef _ALPHA_SEMBUF_H | ||
2 | #define _ALPHA_SEMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The semid64_ds structure for alpha architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 2 miscellaneous 64-bit values | ||
11 | */ | ||
12 | |||
13 | struct semid64_ds { | ||
14 | struct ipc64_perm sem_perm; /* permissions .. see ipc.h */ | ||
15 | __kernel_time_t sem_otime; /* last semop time */ | ||
16 | __kernel_time_t sem_ctime; /* last change time */ | ||
17 | unsigned long sem_nsems; /* no. of semaphores in array */ | ||
18 | unsigned long __unused1; | ||
19 | unsigned long __unused2; | ||
20 | }; | ||
21 | |||
22 | #endif /* _ALPHA_SEMBUF_H */ | ||
diff --git a/arch/alpha/include/asm/setup.h b/arch/alpha/include/asm/setup.h new file mode 100644 index 00000000000..2e023a4aa31 --- /dev/null +++ b/arch/alpha/include/asm/setup.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __ALPHA_SETUP_H | ||
2 | #define __ALPHA_SETUP_H | ||
3 | |||
4 | #define COMMAND_LINE_SIZE 256 | ||
5 | |||
6 | #endif | ||
diff --git a/arch/alpha/include/asm/shmbuf.h b/arch/alpha/include/asm/shmbuf.h new file mode 100644 index 00000000000..37ee84f0508 --- /dev/null +++ b/arch/alpha/include/asm/shmbuf.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef _ALPHA_SHMBUF_H | ||
2 | #define _ALPHA_SHMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The shmid64_ds structure for alpha architecture. | ||
6 | * Note extra padding because this structure is passed back and forth | ||
7 | * between kernel and user space. | ||
8 | * | ||
9 | * Pad space is left for: | ||
10 | * - 2 miscellaneous 64-bit values | ||
11 | */ | ||
12 | |||
13 | struct shmid64_ds { | ||
14 | struct ipc64_perm shm_perm; /* operation perms */ | ||
15 | size_t shm_segsz; /* size of segment (bytes) */ | ||
16 | __kernel_time_t shm_atime; /* last attach time */ | ||
17 | __kernel_time_t shm_dtime; /* last detach time */ | ||
18 | __kernel_time_t shm_ctime; /* last change time */ | ||
19 | __kernel_pid_t shm_cpid; /* pid of creator */ | ||
20 | __kernel_pid_t shm_lpid; /* pid of last operator */ | ||
21 | unsigned long shm_nattch; /* no. of current attaches */ | ||
22 | unsigned long __unused1; | ||
23 | unsigned long __unused2; | ||
24 | }; | ||
25 | |||
26 | struct shminfo64 { | ||
27 | unsigned long shmmax; | ||
28 | unsigned long shmmin; | ||
29 | unsigned long shmmni; | ||
30 | unsigned long shmseg; | ||
31 | unsigned long shmall; | ||
32 | unsigned long __unused1; | ||
33 | unsigned long __unused2; | ||
34 | unsigned long __unused3; | ||
35 | unsigned long __unused4; | ||
36 | }; | ||
37 | |||
38 | #endif /* _ALPHA_SHMBUF_H */ | ||
diff --git a/arch/alpha/include/asm/sigcontext.h b/arch/alpha/include/asm/sigcontext.h new file mode 100644 index 00000000000..323cdb02619 --- /dev/null +++ b/arch/alpha/include/asm/sigcontext.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef _ASMAXP_SIGCONTEXT_H | ||
2 | #define _ASMAXP_SIGCONTEXT_H | ||
3 | |||
4 | struct sigcontext { | ||
5 | /* | ||
6 | * What should we have here? I'd probably better use the same | ||
7 | * stack layout as OSF/1, just in case we ever want to try | ||
8 | * running their binaries.. | ||
9 | * | ||
10 | * This is the basic layout, but I don't know if we'll ever | ||
11 | * actually fill in all the values.. | ||
12 | */ | ||
13 | long sc_onstack; | ||
14 | long sc_mask; | ||
15 | long sc_pc; | ||
16 | long sc_ps; | ||
17 | long sc_regs[32]; | ||
18 | long sc_ownedfp; | ||
19 | long sc_fpregs[32]; | ||
20 | unsigned long sc_fpcr; | ||
21 | unsigned long sc_fp_control; | ||
22 | unsigned long sc_reserved1, sc_reserved2; | ||
23 | unsigned long sc_ssize; | ||
24 | char * sc_sbase; | ||
25 | unsigned long sc_traparg_a0; | ||
26 | unsigned long sc_traparg_a1; | ||
27 | unsigned long sc_traparg_a2; | ||
28 | unsigned long sc_fp_trap_pc; | ||
29 | unsigned long sc_fp_trigger_sum; | ||
30 | unsigned long sc_fp_trigger_inst; | ||
31 | }; | ||
32 | |||
33 | |||
34 | #endif | ||
diff --git a/arch/alpha/include/asm/siginfo.h b/arch/alpha/include/asm/siginfo.h new file mode 100644 index 00000000000..9822362a842 --- /dev/null +++ b/arch/alpha/include/asm/siginfo.h | |||
@@ -0,0 +1,9 @@ | |||
1 | #ifndef _ALPHA_SIGINFO_H | ||
2 | #define _ALPHA_SIGINFO_H | ||
3 | |||
4 | #define __ARCH_SI_PREAMBLE_SIZE (4 * sizeof(int)) | ||
5 | #define __ARCH_SI_TRAPNO | ||
6 | |||
7 | #include <asm-generic/siginfo.h> | ||
8 | |||
9 | #endif | ||
diff --git a/arch/alpha/include/asm/sockios.h b/arch/alpha/include/asm/sockios.h new file mode 100644 index 00000000000..7932c7ab4a4 --- /dev/null +++ b/arch/alpha/include/asm/sockios.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _ASM_ALPHA_SOCKIOS_H | ||
2 | #define _ASM_ALPHA_SOCKIOS_H | ||
3 | |||
4 | /* Socket-level I/O control calls. */ | ||
5 | |||
6 | #define FIOGETOWN _IOR('f', 123, int) | ||
7 | #define FIOSETOWN _IOW('f', 124, int) | ||
8 | |||
9 | #define SIOCATMARK _IOR('s', 7, int) | ||
10 | #define SIOCSPGRP _IOW('s', 8, pid_t) | ||
11 | #define SIOCGPGRP _IOR('s', 9, pid_t) | ||
12 | |||
13 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
14 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
15 | |||
16 | #endif /* _ASM_ALPHA_SOCKIOS_H */ | ||
diff --git a/arch/alpha/include/asm/stat.h b/arch/alpha/include/asm/stat.h new file mode 100644 index 00000000000..07ad3e6b3f3 --- /dev/null +++ b/arch/alpha/include/asm/stat.h | |||
@@ -0,0 +1,48 @@ | |||
1 | #ifndef _ALPHA_STAT_H | ||
2 | #define _ALPHA_STAT_H | ||
3 | |||
4 | struct stat { | ||
5 | unsigned int st_dev; | ||
6 | unsigned int st_ino; | ||
7 | unsigned int st_mode; | ||
8 | unsigned int st_nlink; | ||
9 | unsigned int st_uid; | ||
10 | unsigned int st_gid; | ||
11 | unsigned int st_rdev; | ||
12 | long st_size; | ||
13 | unsigned long st_atime; | ||
14 | unsigned long st_mtime; | ||
15 | unsigned long st_ctime; | ||
16 | unsigned int st_blksize; | ||
17 | unsigned int st_blocks; | ||
18 | unsigned int st_flags; | ||
19 | unsigned int st_gen; | ||
20 | }; | ||
21 | |||
22 | /* The stat64 structure increases the size of dev_t, blkcnt_t, adds | ||
23 | nanosecond resolution times, and padding for expansion. */ | ||
24 | |||
25 | struct stat64 { | ||
26 | unsigned long st_dev; | ||
27 | unsigned long st_ino; | ||
28 | unsigned long st_rdev; | ||
29 | long st_size; | ||
30 | unsigned long st_blocks; | ||
31 | |||
32 | unsigned int st_mode; | ||
33 | unsigned int st_uid; | ||
34 | unsigned int st_gid; | ||
35 | unsigned int st_blksize; | ||
36 | unsigned int st_nlink; | ||
37 | unsigned int __pad0; | ||
38 | |||
39 | unsigned long st_atime; | ||
40 | unsigned long st_atime_nsec; | ||
41 | unsigned long st_mtime; | ||
42 | unsigned long st_mtime_nsec; | ||
43 | unsigned long st_ctime; | ||
44 | unsigned long st_ctime_nsec; | ||
45 | long __unused[3]; | ||
46 | }; | ||
47 | |||
48 | #endif | ||
diff --git a/arch/alpha/include/asm/statfs.h b/arch/alpha/include/asm/statfs.h new file mode 100644 index 00000000000..ccd2e186bfd --- /dev/null +++ b/arch/alpha/include/asm/statfs.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _ALPHA_STATFS_H | ||
2 | #define _ALPHA_STATFS_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Alpha is the only 64-bit platform with 32-bit statfs. And doesn't | ||
7 | even seem to implement statfs64 */ | ||
8 | #define __statfs_word __u32 | ||
9 | |||
10 | #include <asm-generic/statfs.h> | ||
11 | |||
12 | #endif | ||
diff --git a/arch/alpha/include/asm/swab.h b/arch/alpha/include/asm/swab.h new file mode 100644 index 00000000000..4d682b16c7c --- /dev/null +++ b/arch/alpha/include/asm/swab.h | |||
@@ -0,0 +1,42 @@ | |||
1 | #ifndef _ALPHA_SWAB_H | ||
2 | #define _ALPHA_SWAB_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/compiler.h> | ||
6 | #include <asm/compiler.h> | ||
7 | |||
8 | #ifdef __GNUC__ | ||
9 | |||
10 | static inline __attribute_const__ __u32 __arch_swab32(__u32 x) | ||
11 | { | ||
12 | /* | ||
13 | * Unfortunately, we can't use the 6 instruction sequence | ||
14 | * on ev6 since the latency of the UNPKBW is 3, which is | ||
15 | * pretty hard to hide. Just in case a future implementation | ||
16 | * has a lower latency, here's the sequence (also by Mike Burrows) | ||
17 | * | ||
18 | * UNPKBW a0, v0 v0: 00AA00BB00CC00DD | ||
19 | * SLL v0, 24, a0 a0: BB00CC00DD000000 | ||
20 | * BIS v0, a0, a0 a0: BBAACCBBDDCC00DD | ||
21 | * EXTWL a0, 6, v0 v0: 000000000000BBAA | ||
22 | * ZAP a0, 0xf3, a0 a0: 00000000DDCC0000 | ||
23 | * ADDL a0, v0, v0 v0: ssssssssDDCCBBAA | ||
24 | */ | ||
25 | |||
26 | __u64 t0, t1, t2, t3; | ||
27 | |||
28 | t0 = __kernel_inslh(x, 7); /* t0 : 0000000000AABBCC */ | ||
29 | t1 = __kernel_inswl(x, 3); /* t1 : 000000CCDD000000 */ | ||
30 | t1 |= t0; /* t1 : 000000CCDDAABBCC */ | ||
31 | t2 = t1 >> 16; /* t2 : 0000000000CCDDAA */ | ||
32 | t0 = t1 & 0xFF00FF00; /* t0 : 00000000DD00BB00 */ | ||
33 | t3 = t2 & 0x00FF00FF; /* t3 : 0000000000CC00AA */ | ||
34 | t1 = t0 + t3; /* t1 : ssssssssDDCCBBAA */ | ||
35 | |||
36 | return t1; | ||
37 | } | ||
38 | #define __arch_swab32 __arch_swab32 | ||
39 | |||
40 | #endif /* __GNUC__ */ | ||
41 | |||
42 | #endif /* _ALPHA_SWAB_H */ | ||
diff --git a/arch/alpha/include/asm/sysinfo.h b/arch/alpha/include/asm/sysinfo.h new file mode 100644 index 00000000000..e77d77cd07b --- /dev/null +++ b/arch/alpha/include/asm/sysinfo.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * include/asm-alpha/sysinfo.h | ||
3 | */ | ||
4 | |||
5 | #ifndef __ASM_ALPHA_SYSINFO_H | ||
6 | #define __ASM_ALPHA_SYSINFO_H | ||
7 | |||
8 | /* This defines the subset of the OSF/1 getsysinfo/setsysinfo calls | ||
9 | that we support. */ | ||
10 | |||
11 | #define GSI_UACPROC 8 | ||
12 | #define GSI_IEEE_FP_CONTROL 45 | ||
13 | #define GSI_IEEE_STATE_AT_SIGNAL 46 | ||
14 | #define GSI_PROC_TYPE 60 | ||
15 | #define GSI_GET_HWRPB 101 | ||
16 | |||
17 | #define SSI_NVPAIRS 1 | ||
18 | #define SSI_IEEE_FP_CONTROL 14 | ||
19 | #define SSI_IEEE_STATE_AT_SIGNAL 15 | ||
20 | #define SSI_IEEE_IGNORE_STATE_AT_SIGNAL 16 | ||
21 | #define SSI_IEEE_RAISE_EXCEPTION 1001 /* linux specific */ | ||
22 | |||
23 | #define SSIN_UACPROC 6 | ||
24 | |||
25 | #define UAC_BITMASK 7 | ||
26 | #define UAC_NOPRINT 1 | ||
27 | #define UAC_NOFIX 2 | ||
28 | #define UAC_SIGBUS 4 | ||
29 | |||
30 | #endif /* __ASM_ALPHA_SYSINFO_H */ | ||
diff --git a/arch/alpha/include/asm/system.h b/arch/alpha/include/asm/system.h new file mode 100644 index 00000000000..9f78e693463 --- /dev/null +++ b/arch/alpha/include/asm/system.h | |||
@@ -0,0 +1,354 @@ | |||
1 | #ifndef __ALPHA_SYSTEM_H | ||
2 | #define __ALPHA_SYSTEM_H | ||
3 | |||
4 | #include <asm/pal.h> | ||
5 | #include <asm/page.h> | ||
6 | #include <asm/barrier.h> | ||
7 | |||
8 | /* | ||
9 | * System defines.. Note that this is included both from .c and .S | ||
10 | * files, so it does only defines, not any C code. | ||
11 | */ | ||
12 | |||
13 | /* | ||
14 | * We leave one page for the initial stack page, and one page for | ||
15 | * the initial process structure. Also, the console eats 3 MB for | ||
16 | * the initial bootloader (one of which we can reclaim later). | ||
17 | */ | ||
18 | #define BOOT_PCB 0x20000000 | ||
19 | #define BOOT_ADDR 0x20000000 | ||
20 | /* Remove when official MILO sources have ELF support: */ | ||
21 | #define BOOT_SIZE (16*1024) | ||
22 | |||
23 | #ifdef CONFIG_ALPHA_LEGACY_START_ADDRESS | ||
24 | #define KERNEL_START_PHYS 0x300000 /* Old bootloaders hardcoded this. */ | ||
25 | #else | ||
26 | #define KERNEL_START_PHYS 0x1000000 /* required: Wildfire/Titan/Marvel */ | ||
27 | #endif | ||
28 | |||
29 | #define KERNEL_START (PAGE_OFFSET+KERNEL_START_PHYS) | ||
30 | #define SWAPPER_PGD KERNEL_START | ||
31 | #define INIT_STACK (PAGE_OFFSET+KERNEL_START_PHYS+0x02000) | ||
32 | #define EMPTY_PGT (PAGE_OFFSET+KERNEL_START_PHYS+0x04000) | ||
33 | #define EMPTY_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x08000) | ||
34 | #define ZERO_PGE (PAGE_OFFSET+KERNEL_START_PHYS+0x0A000) | ||
35 | |||
36 | #define START_ADDR (PAGE_OFFSET+KERNEL_START_PHYS+0x10000) | ||
37 | |||
38 | /* | ||
39 | * This is setup by the secondary bootstrap loader. Because | ||
40 | * the zero page is zeroed out as soon as the vm system is | ||
41 | * initialized, we need to copy things out into a more permanent | ||
42 | * place. | ||
43 | */ | ||
44 | #define PARAM ZERO_PGE | ||
45 | #define COMMAND_LINE ((char*)(PARAM + 0x0000)) | ||
46 | #define INITRD_START (*(unsigned long *) (PARAM+0x100)) | ||
47 | #define INITRD_SIZE (*(unsigned long *) (PARAM+0x108)) | ||
48 | |||
49 | #ifndef __ASSEMBLY__ | ||
50 | #include <linux/kernel.h> | ||
51 | #define AT_VECTOR_SIZE_ARCH 4 /* entries in ARCH_DLINFO */ | ||
52 | |||
53 | /* | ||
54 | * This is the logout header that should be common to all platforms | ||
55 | * (assuming they are running OSF/1 PALcode, I guess). | ||
56 | */ | ||
57 | struct el_common { | ||
58 | unsigned int size; /* size in bytes of logout area */ | ||
59 | unsigned int sbz1 : 30; /* should be zero */ | ||
60 | unsigned int err2 : 1; /* second error */ | ||
61 | unsigned int retry : 1; /* retry flag */ | ||
62 | unsigned int proc_offset; /* processor-specific offset */ | ||
63 | unsigned int sys_offset; /* system-specific offset */ | ||
64 | unsigned int code; /* machine check code */ | ||
65 | unsigned int frame_rev; /* frame revision */ | ||
66 | }; | ||
67 | |||
68 | /* Machine Check Frame for uncorrectable errors (Large format) | ||
69 | * --- This is used to log uncorrectable errors such as | ||
70 | * double bit ECC errors. | ||
71 | * --- These errors are detected by both processor and systems. | ||
72 | */ | ||
73 | struct el_common_EV5_uncorrectable_mcheck { | ||
74 | unsigned long shadow[8]; /* Shadow reg. 8-14, 25 */ | ||
75 | unsigned long paltemp[24]; /* PAL TEMP REGS. */ | ||
76 | unsigned long exc_addr; /* Address of excepting instruction*/ | ||
77 | unsigned long exc_sum; /* Summary of arithmetic traps. */ | ||
78 | unsigned long exc_mask; /* Exception mask (from exc_sum). */ | ||
79 | unsigned long pal_base; /* Base address for PALcode. */ | ||
80 | unsigned long isr; /* Interrupt Status Reg. */ | ||
81 | unsigned long icsr; /* CURRENT SETUP OF EV5 IBOX */ | ||
82 | unsigned long ic_perr_stat; /* I-CACHE Reg. <11> set Data parity | ||
83 | <12> set TAG parity*/ | ||
84 | unsigned long dc_perr_stat; /* D-CACHE error Reg. Bits set to 1: | ||
85 | <2> Data error in bank 0 | ||
86 | <3> Data error in bank 1 | ||
87 | <4> Tag error in bank 0 | ||
88 | <5> Tag error in bank 1 */ | ||
89 | unsigned long va; /* Effective VA of fault or miss. */ | ||
90 | unsigned long mm_stat; /* Holds the reason for D-stream | ||
91 | fault or D-cache parity errors */ | ||
92 | unsigned long sc_addr; /* Address that was being accessed | ||
93 | when EV5 detected Secondary cache | ||
94 | failure. */ | ||
95 | unsigned long sc_stat; /* Helps determine if the error was | ||
96 | TAG/Data parity(Secondary Cache)*/ | ||
97 | unsigned long bc_tag_addr; /* Contents of EV5 BC_TAG_ADDR */ | ||
98 | unsigned long ei_addr; /* Physical address of any transfer | ||
99 | that is logged in EV5 EI_STAT */ | ||
100 | unsigned long fill_syndrome; /* For correcting ECC errors. */ | ||
101 | unsigned long ei_stat; /* Helps identify reason of any | ||
102 | processor uncorrectable error | ||
103 | at its external interface. */ | ||
104 | unsigned long ld_lock; /* Contents of EV5 LD_LOCK register*/ | ||
105 | }; | ||
106 | |||
107 | struct el_common_EV6_mcheck { | ||
108 | unsigned int FrameSize; /* Bytes, including this field */ | ||
109 | unsigned int FrameFlags; /* <31> = Retry, <30> = Second Error */ | ||
110 | unsigned int CpuOffset; /* Offset to CPU-specific info */ | ||
111 | unsigned int SystemOffset; /* Offset to system-specific info */ | ||
112 | unsigned int MCHK_Code; | ||
113 | unsigned int MCHK_Frame_Rev; | ||
114 | unsigned long I_STAT; /* EV6 Internal Processor Registers */ | ||
115 | unsigned long DC_STAT; /* (See the 21264 Spec) */ | ||
116 | unsigned long C_ADDR; | ||
117 | unsigned long DC1_SYNDROME; | ||
118 | unsigned long DC0_SYNDROME; | ||
119 | unsigned long C_STAT; | ||
120 | unsigned long C_STS; | ||
121 | unsigned long MM_STAT; | ||
122 | unsigned long EXC_ADDR; | ||
123 | unsigned long IER_CM; | ||
124 | unsigned long ISUM; | ||
125 | unsigned long RESERVED0; | ||
126 | unsigned long PAL_BASE; | ||
127 | unsigned long I_CTL; | ||
128 | unsigned long PCTX; | ||
129 | }; | ||
130 | |||
131 | extern void halt(void) __attribute__((noreturn)); | ||
132 | #define __halt() __asm__ __volatile__ ("call_pal %0 #halt" : : "i" (PAL_halt)) | ||
133 | |||
134 | #define switch_to(P,N,L) \ | ||
135 | do { \ | ||
136 | (L) = alpha_switch_to(virt_to_phys(&task_thread_info(N)->pcb), (P)); \ | ||
137 | check_mmu_context(); \ | ||
138 | } while (0) | ||
139 | |||
140 | struct task_struct; | ||
141 | extern struct task_struct *alpha_switch_to(unsigned long, struct task_struct*); | ||
142 | |||
143 | #define imb() \ | ||
144 | __asm__ __volatile__ ("call_pal %0 #imb" : : "i" (PAL_imb) : "memory") | ||
145 | |||
146 | #define draina() \ | ||
147 | __asm__ __volatile__ ("call_pal %0 #draina" : : "i" (PAL_draina) : "memory") | ||
148 | |||
149 | enum implver_enum { | ||
150 | IMPLVER_EV4, | ||
151 | IMPLVER_EV5, | ||
152 | IMPLVER_EV6 | ||
153 | }; | ||
154 | |||
155 | #ifdef CONFIG_ALPHA_GENERIC | ||
156 | #define implver() \ | ||
157 | ({ unsigned long __implver; \ | ||
158 | __asm__ ("implver %0" : "=r"(__implver)); \ | ||
159 | (enum implver_enum) __implver; }) | ||
160 | #else | ||
161 | /* Try to eliminate some dead code. */ | ||
162 | #ifdef CONFIG_ALPHA_EV4 | ||
163 | #define implver() IMPLVER_EV4 | ||
164 | #endif | ||
165 | #ifdef CONFIG_ALPHA_EV5 | ||
166 | #define implver() IMPLVER_EV5 | ||
167 | #endif | ||
168 | #if defined(CONFIG_ALPHA_EV6) | ||
169 | #define implver() IMPLVER_EV6 | ||
170 | #endif | ||
171 | #endif | ||
172 | |||
173 | enum amask_enum { | ||
174 | AMASK_BWX = (1UL << 0), | ||
175 | AMASK_FIX = (1UL << 1), | ||
176 | AMASK_CIX = (1UL << 2), | ||
177 | AMASK_MAX = (1UL << 8), | ||
178 | AMASK_PRECISE_TRAP = (1UL << 9), | ||
179 | }; | ||
180 | |||
181 | #define amask(mask) \ | ||
182 | ({ unsigned long __amask, __input = (mask); \ | ||
183 | __asm__ ("amask %1,%0" : "=r"(__amask) : "rI"(__input)); \ | ||
184 | __amask; }) | ||
185 | |||
186 | #define __CALL_PAL_R0(NAME, TYPE) \ | ||
187 | extern inline TYPE NAME(void) \ | ||
188 | { \ | ||
189 | register TYPE __r0 __asm__("$0"); \ | ||
190 | __asm__ __volatile__( \ | ||
191 | "call_pal %1 # " #NAME \ | ||
192 | :"=r" (__r0) \ | ||
193 | :"i" (PAL_ ## NAME) \ | ||
194 | :"$1", "$16", "$22", "$23", "$24", "$25"); \ | ||
195 | return __r0; \ | ||
196 | } | ||
197 | |||
198 | #define __CALL_PAL_W1(NAME, TYPE0) \ | ||
199 | extern inline void NAME(TYPE0 arg0) \ | ||
200 | { \ | ||
201 | register TYPE0 __r16 __asm__("$16") = arg0; \ | ||
202 | __asm__ __volatile__( \ | ||
203 | "call_pal %1 # "#NAME \ | ||
204 | : "=r"(__r16) \ | ||
205 | : "i"(PAL_ ## NAME), "0"(__r16) \ | ||
206 | : "$1", "$22", "$23", "$24", "$25"); \ | ||
207 | } | ||
208 | |||
209 | #define __CALL_PAL_W2(NAME, TYPE0, TYPE1) \ | ||
210 | extern inline void NAME(TYPE0 arg0, TYPE1 arg1) \ | ||
211 | { \ | ||
212 | register TYPE0 __r16 __asm__("$16") = arg0; \ | ||
213 | register TYPE1 __r17 __asm__("$17") = arg1; \ | ||
214 | __asm__ __volatile__( \ | ||
215 | "call_pal %2 # "#NAME \ | ||
216 | : "=r"(__r16), "=r"(__r17) \ | ||
217 | : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \ | ||
218 | : "$1", "$22", "$23", "$24", "$25"); \ | ||
219 | } | ||
220 | |||
221 | #define __CALL_PAL_RW1(NAME, RTYPE, TYPE0) \ | ||
222 | extern inline RTYPE NAME(TYPE0 arg0) \ | ||
223 | { \ | ||
224 | register RTYPE __r0 __asm__("$0"); \ | ||
225 | register TYPE0 __r16 __asm__("$16") = arg0; \ | ||
226 | __asm__ __volatile__( \ | ||
227 | "call_pal %2 # "#NAME \ | ||
228 | : "=r"(__r16), "=r"(__r0) \ | ||
229 | : "i"(PAL_ ## NAME), "0"(__r16) \ | ||
230 | : "$1", "$22", "$23", "$24", "$25"); \ | ||
231 | return __r0; \ | ||
232 | } | ||
233 | |||
234 | #define __CALL_PAL_RW2(NAME, RTYPE, TYPE0, TYPE1) \ | ||
235 | extern inline RTYPE NAME(TYPE0 arg0, TYPE1 arg1) \ | ||
236 | { \ | ||
237 | register RTYPE __r0 __asm__("$0"); \ | ||
238 | register TYPE0 __r16 __asm__("$16") = arg0; \ | ||
239 | register TYPE1 __r17 __asm__("$17") = arg1; \ | ||
240 | __asm__ __volatile__( \ | ||
241 | "call_pal %3 # "#NAME \ | ||
242 | : "=r"(__r16), "=r"(__r17), "=r"(__r0) \ | ||
243 | : "i"(PAL_ ## NAME), "0"(__r16), "1"(__r17) \ | ||
244 | : "$1", "$22", "$23", "$24", "$25"); \ | ||
245 | return __r0; \ | ||
246 | } | ||
247 | |||
248 | __CALL_PAL_W1(cflush, unsigned long); | ||
249 | __CALL_PAL_R0(rdmces, unsigned long); | ||
250 | __CALL_PAL_R0(rdps, unsigned long); | ||
251 | __CALL_PAL_R0(rdusp, unsigned long); | ||
252 | __CALL_PAL_RW1(swpipl, unsigned long, unsigned long); | ||
253 | __CALL_PAL_R0(whami, unsigned long); | ||
254 | __CALL_PAL_W2(wrent, void*, unsigned long); | ||
255 | __CALL_PAL_W1(wripir, unsigned long); | ||
256 | __CALL_PAL_W1(wrkgp, unsigned long); | ||
257 | __CALL_PAL_W1(wrmces, unsigned long); | ||
258 | __CALL_PAL_RW2(wrperfmon, unsigned long, unsigned long, unsigned long); | ||
259 | __CALL_PAL_W1(wrusp, unsigned long); | ||
260 | __CALL_PAL_W1(wrvptptr, unsigned long); | ||
261 | |||
262 | /* | ||
263 | * TB routines.. | ||
264 | */ | ||
265 | #define __tbi(nr,arg,arg1...) \ | ||
266 | ({ \ | ||
267 | register unsigned long __r16 __asm__("$16") = (nr); \ | ||
268 | register unsigned long __r17 __asm__("$17"); arg; \ | ||
269 | __asm__ __volatile__( \ | ||
270 | "call_pal %3 #__tbi" \ | ||
271 | :"=r" (__r16),"=r" (__r17) \ | ||
272 | :"0" (__r16),"i" (PAL_tbi) ,##arg1 \ | ||
273 | :"$0", "$1", "$22", "$23", "$24", "$25"); \ | ||
274 | }) | ||
275 | |||
276 | #define tbi(x,y) __tbi(x,__r17=(y),"1" (__r17)) | ||
277 | #define tbisi(x) __tbi(1,__r17=(x),"1" (__r17)) | ||
278 | #define tbisd(x) __tbi(2,__r17=(x),"1" (__r17)) | ||
279 | #define tbis(x) __tbi(3,__r17=(x),"1" (__r17)) | ||
280 | #define tbiap() __tbi(-1, /* no second argument */) | ||
281 | #define tbia() __tbi(-2, /* no second argument */) | ||
282 | |||
283 | /* | ||
284 | * Atomic exchange routines. | ||
285 | */ | ||
286 | |||
287 | #define __ASM__MB | ||
288 | #define ____xchg(type, args...) __xchg ## type ## _local(args) | ||
289 | #define ____cmpxchg(type, args...) __cmpxchg ## type ## _local(args) | ||
290 | #include <asm/xchg.h> | ||
291 | |||
292 | #define xchg_local(ptr,x) \ | ||
293 | ({ \ | ||
294 | __typeof__(*(ptr)) _x_ = (x); \ | ||
295 | (__typeof__(*(ptr))) __xchg_local((ptr), (unsigned long)_x_, \ | ||
296 | sizeof(*(ptr))); \ | ||
297 | }) | ||
298 | |||
299 | #define cmpxchg_local(ptr, o, n) \ | ||
300 | ({ \ | ||
301 | __typeof__(*(ptr)) _o_ = (o); \ | ||
302 | __typeof__(*(ptr)) _n_ = (n); \ | ||
303 | (__typeof__(*(ptr))) __cmpxchg_local((ptr), (unsigned long)_o_, \ | ||
304 | (unsigned long)_n_, \ | ||
305 | sizeof(*(ptr))); \ | ||
306 | }) | ||
307 | |||
308 | #define cmpxchg64_local(ptr, o, n) \ | ||
309 | ({ \ | ||
310 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
311 | cmpxchg_local((ptr), (o), (n)); \ | ||
312 | }) | ||
313 | |||
314 | #ifdef CONFIG_SMP | ||
315 | #undef __ASM__MB | ||
316 | #define __ASM__MB "\tmb\n" | ||
317 | #endif | ||
318 | #undef ____xchg | ||
319 | #undef ____cmpxchg | ||
320 | #define ____xchg(type, args...) __xchg ##type(args) | ||
321 | #define ____cmpxchg(type, args...) __cmpxchg ##type(args) | ||
322 | #include <asm/xchg.h> | ||
323 | |||
324 | #define xchg(ptr,x) \ | ||
325 | ({ \ | ||
326 | __typeof__(*(ptr)) _x_ = (x); \ | ||
327 | (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, \ | ||
328 | sizeof(*(ptr))); \ | ||
329 | }) | ||
330 | |||
331 | #define cmpxchg(ptr, o, n) \ | ||
332 | ({ \ | ||
333 | __typeof__(*(ptr)) _o_ = (o); \ | ||
334 | __typeof__(*(ptr)) _n_ = (n); \ | ||
335 | (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_, \ | ||
336 | (unsigned long)_n_, sizeof(*(ptr)));\ | ||
337 | }) | ||
338 | |||
339 | #define cmpxchg64(ptr, o, n) \ | ||
340 | ({ \ | ||
341 | BUILD_BUG_ON(sizeof(*(ptr)) != 8); \ | ||
342 | cmpxchg((ptr), (o), (n)); \ | ||
343 | }) | ||
344 | |||
345 | #undef __ASM__MB | ||
346 | #undef ____cmpxchg | ||
347 | |||
348 | #define __HAVE_ARCH_CMPXCHG 1 | ||
349 | |||
350 | #endif /* __ASSEMBLY__ */ | ||
351 | |||
352 | #define arch_align_stack(x) (x) | ||
353 | |||
354 | #endif | ||
diff --git a/arch/alpha/include/asm/termbits.h b/arch/alpha/include/asm/termbits.h new file mode 100644 index 00000000000..879dd358992 --- /dev/null +++ b/arch/alpha/include/asm/termbits.h | |||
@@ -0,0 +1,201 @@ | |||
1 | #ifndef _ALPHA_TERMBITS_H | ||
2 | #define _ALPHA_TERMBITS_H | ||
3 | |||
4 | #include <linux/posix_types.h> | ||
5 | |||
6 | typedef unsigned char cc_t; | ||
7 | typedef unsigned int speed_t; | ||
8 | typedef unsigned int tcflag_t; | ||
9 | |||
10 | /* | ||
11 | * termios type and macro definitions. Be careful about adding stuff | ||
12 | * to this file since it's used in GNU libc and there are strict rules | ||
13 | * concerning namespace pollution. | ||
14 | */ | ||
15 | |||
16 | #define NCCS 19 | ||
17 | struct termios { | ||
18 | tcflag_t c_iflag; /* input mode flags */ | ||
19 | tcflag_t c_oflag; /* output mode flags */ | ||
20 | tcflag_t c_cflag; /* control mode flags */ | ||
21 | tcflag_t c_lflag; /* local mode flags */ | ||
22 | cc_t c_cc[NCCS]; /* control characters */ | ||
23 | cc_t c_line; /* line discipline (== c_cc[19]) */ | ||
24 | speed_t c_ispeed; /* input speed */ | ||
25 | speed_t c_ospeed; /* output speed */ | ||
26 | }; | ||
27 | |||
28 | /* Alpha has matching termios and ktermios */ | ||
29 | |||
30 | struct ktermios { | ||
31 | tcflag_t c_iflag; /* input mode flags */ | ||
32 | tcflag_t c_oflag; /* output mode flags */ | ||
33 | tcflag_t c_cflag; /* control mode flags */ | ||
34 | tcflag_t c_lflag; /* local mode flags */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | cc_t c_line; /* line discipline (== c_cc[19]) */ | ||
37 | speed_t c_ispeed; /* input speed */ | ||
38 | speed_t c_ospeed; /* output speed */ | ||
39 | }; | ||
40 | |||
41 | /* c_cc characters */ | ||
42 | #define VEOF 0 | ||
43 | #define VEOL 1 | ||
44 | #define VEOL2 2 | ||
45 | #define VERASE 3 | ||
46 | #define VWERASE 4 | ||
47 | #define VKILL 5 | ||
48 | #define VREPRINT 6 | ||
49 | #define VSWTC 7 | ||
50 | #define VINTR 8 | ||
51 | #define VQUIT 9 | ||
52 | #define VSUSP 10 | ||
53 | #define VSTART 12 | ||
54 | #define VSTOP 13 | ||
55 | #define VLNEXT 14 | ||
56 | #define VDISCARD 15 | ||
57 | #define VMIN 16 | ||
58 | #define VTIME 17 | ||
59 | |||
60 | /* c_iflag bits */ | ||
61 | #define IGNBRK 0000001 | ||
62 | #define BRKINT 0000002 | ||
63 | #define IGNPAR 0000004 | ||
64 | #define PARMRK 0000010 | ||
65 | #define INPCK 0000020 | ||
66 | #define ISTRIP 0000040 | ||
67 | #define INLCR 0000100 | ||
68 | #define IGNCR 0000200 | ||
69 | #define ICRNL 0000400 | ||
70 | #define IXON 0001000 | ||
71 | #define IXOFF 0002000 | ||
72 | #define IXANY 0004000 | ||
73 | #define IUCLC 0010000 | ||
74 | #define IMAXBEL 0020000 | ||
75 | #define IUTF8 0040000 | ||
76 | |||
77 | /* c_oflag bits */ | ||
78 | #define OPOST 0000001 | ||
79 | #define ONLCR 0000002 | ||
80 | #define OLCUC 0000004 | ||
81 | |||
82 | #define OCRNL 0000010 | ||
83 | #define ONOCR 0000020 | ||
84 | #define ONLRET 0000040 | ||
85 | |||
86 | #define OFILL 00000100 | ||
87 | #define OFDEL 00000200 | ||
88 | #define NLDLY 00001400 | ||
89 | #define NL0 00000000 | ||
90 | #define NL1 00000400 | ||
91 | #define NL2 00001000 | ||
92 | #define NL3 00001400 | ||
93 | #define TABDLY 00006000 | ||
94 | #define TAB0 00000000 | ||
95 | #define TAB1 00002000 | ||
96 | #define TAB2 00004000 | ||
97 | #define TAB3 00006000 | ||
98 | #define CRDLY 00030000 | ||
99 | #define CR0 00000000 | ||
100 | #define CR1 00010000 | ||
101 | #define CR2 00020000 | ||
102 | #define CR3 00030000 | ||
103 | #define FFDLY 00040000 | ||
104 | #define FF0 00000000 | ||
105 | #define FF1 00040000 | ||
106 | #define BSDLY 00100000 | ||
107 | #define BS0 00000000 | ||
108 | #define BS1 00100000 | ||
109 | #define VTDLY 00200000 | ||
110 | #define VT0 00000000 | ||
111 | #define VT1 00200000 | ||
112 | #define XTABS 01000000 /* Hmm.. Linux/i386 considers this part of TABDLY.. */ | ||
113 | |||
114 | /* c_cflag bit meaning */ | ||
115 | #define CBAUD 0000037 | ||
116 | #define B0 0000000 /* hang up */ | ||
117 | #define B50 0000001 | ||
118 | #define B75 0000002 | ||
119 | #define B110 0000003 | ||
120 | #define B134 0000004 | ||
121 | #define B150 0000005 | ||
122 | #define B200 0000006 | ||
123 | #define B300 0000007 | ||
124 | #define B600 0000010 | ||
125 | #define B1200 0000011 | ||
126 | #define B1800 0000012 | ||
127 | #define B2400 0000013 | ||
128 | #define B4800 0000014 | ||
129 | #define B9600 0000015 | ||
130 | #define B19200 0000016 | ||
131 | #define B38400 0000017 | ||
132 | #define EXTA B19200 | ||
133 | #define EXTB B38400 | ||
134 | #define CBAUDEX 0000000 | ||
135 | #define B57600 00020 | ||
136 | #define B115200 00021 | ||
137 | #define B230400 00022 | ||
138 | #define B460800 00023 | ||
139 | #define B500000 00024 | ||
140 | #define B576000 00025 | ||
141 | #define B921600 00026 | ||
142 | #define B1000000 00027 | ||
143 | #define B1152000 00030 | ||
144 | #define B1500000 00031 | ||
145 | #define B2000000 00032 | ||
146 | #define B2500000 00033 | ||
147 | #define B3000000 00034 | ||
148 | #define B3500000 00035 | ||
149 | #define B4000000 00036 | ||
150 | |||
151 | #define CSIZE 00001400 | ||
152 | #define CS5 00000000 | ||
153 | #define CS6 00000400 | ||
154 | #define CS7 00001000 | ||
155 | #define CS8 00001400 | ||
156 | |||
157 | #define CSTOPB 00002000 | ||
158 | #define CREAD 00004000 | ||
159 | #define PARENB 00010000 | ||
160 | #define PARODD 00020000 | ||
161 | #define HUPCL 00040000 | ||
162 | |||
163 | #define CLOCAL 00100000 | ||
164 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
165 | #define CRTSCTS 020000000000 /* flow control */ | ||
166 | |||
167 | /* c_lflag bits */ | ||
168 | #define ISIG 0x00000080 | ||
169 | #define ICANON 0x00000100 | ||
170 | #define XCASE 0x00004000 | ||
171 | #define ECHO 0x00000008 | ||
172 | #define ECHOE 0x00000002 | ||
173 | #define ECHOK 0x00000004 | ||
174 | #define ECHONL 0x00000010 | ||
175 | #define NOFLSH 0x80000000 | ||
176 | #define TOSTOP 0x00400000 | ||
177 | #define ECHOCTL 0x00000040 | ||
178 | #define ECHOPRT 0x00000020 | ||
179 | #define ECHOKE 0x00000001 | ||
180 | #define FLUSHO 0x00800000 | ||
181 | #define PENDIN 0x20000000 | ||
182 | #define IEXTEN 0x00000400 | ||
183 | #define EXTPROC 0x10000000 | ||
184 | |||
185 | /* Values for the ACTION argument to `tcflow'. */ | ||
186 | #define TCOOFF 0 | ||
187 | #define TCOON 1 | ||
188 | #define TCIOFF 2 | ||
189 | #define TCION 3 | ||
190 | |||
191 | /* Values for the QUEUE_SELECTOR argument to `tcflush'. */ | ||
192 | #define TCIFLUSH 0 | ||
193 | #define TCOFLUSH 1 | ||
194 | #define TCIOFLUSH 2 | ||
195 | |||
196 | /* Values for the OPTIONAL_ACTIONS argument to `tcsetattr'. */ | ||
197 | #define TCSANOW 0 | ||
198 | #define TCSADRAIN 1 | ||
199 | #define TCSAFLUSH 2 | ||
200 | |||
201 | #endif /* _ALPHA_TERMBITS_H */ | ||