diff options
Diffstat (limited to 'arch/ia64/include')
34 files changed, 2093 insertions, 0 deletions
diff --git a/arch/ia64/include/asm/auxvec.h b/arch/ia64/include/asm/auxvec.h new file mode 100644 index 00000000000..23cebe5685b --- /dev/null +++ b/arch/ia64/include/asm/auxvec.h | |||
@@ -0,0 +1,11 @@ | |||
1 | #ifndef _ASM_IA64_AUXVEC_H | ||
2 | #define _ASM_IA64_AUXVEC_H | ||
3 | |||
4 | /* | ||
5 | * Architecture-neutral AT_ values are in the range 0-17. Leave some room for more of | ||
6 | * them, start the architecture-specific ones at 32. | ||
7 | */ | ||
8 | #define AT_SYSINFO 32 | ||
9 | #define AT_SYSINFO_EHDR 33 | ||
10 | |||
11 | #endif /* _ASM_IA64_AUXVEC_H */ | ||
diff --git a/arch/ia64/include/asm/bitsperlong.h b/arch/ia64/include/asm/bitsperlong.h new file mode 100644 index 00000000000..ec4db3c970b --- /dev/null +++ b/arch/ia64/include/asm/bitsperlong.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __ASM_IA64_BITSPERLONG_H | ||
2 | #define __ASM_IA64_BITSPERLONG_H | ||
3 | |||
4 | #define __BITS_PER_LONG 64 | ||
5 | |||
6 | #include <asm-generic/bitsperlong.h> | ||
7 | |||
8 | #endif /* __ASM_IA64_BITSPERLONG_H */ | ||
diff --git a/arch/ia64/include/asm/break.h b/arch/ia64/include/asm/break.h new file mode 100644 index 00000000000..e90c40ec9ed --- /dev/null +++ b/arch/ia64/include/asm/break.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef _ASM_IA64_BREAK_H | ||
2 | #define _ASM_IA64_BREAK_H | ||
3 | |||
4 | /* | ||
5 | * IA-64 Linux break numbers. | ||
6 | * | ||
7 | * Copyright (C) 1999 Hewlett-Packard Co | ||
8 | * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com> | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * OS-specific debug break numbers: | ||
13 | */ | ||
14 | #define __IA64_BREAK_KDB 0x80100 | ||
15 | #define __IA64_BREAK_KPROBE 0x81000 /* .. 0x81fff */ | ||
16 | #define __IA64_BREAK_JPROBE 0x82000 | ||
17 | |||
18 | /* | ||
19 | * OS-specific break numbers: | ||
20 | */ | ||
21 | #define __IA64_BREAK_SYSCALL 0x100000 | ||
22 | |||
23 | /* | ||
24 | * Xen specific break numbers: | ||
25 | */ | ||
26 | #define __IA64_XEN_HYPERCALL 0x1000 | ||
27 | /* [__IA64_XEN_HYPERPRIVOP_START, __IA64_XEN_HYPERPRIVOP_MAX] is used | ||
28 | for xen hyperprivops */ | ||
29 | #define __IA64_XEN_HYPERPRIVOP_START 0x1 | ||
30 | #define __IA64_XEN_HYPERPRIVOP_MAX 0x1a | ||
31 | |||
32 | #endif /* _ASM_IA64_BREAK_H */ | ||
diff --git a/arch/ia64/include/asm/byteorder.h b/arch/ia64/include/asm/byteorder.h new file mode 100644 index 00000000000..a8dd7355815 --- /dev/null +++ b/arch/ia64/include/asm/byteorder.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_IA64_BYTEORDER_H | ||
2 | #define _ASM_IA64_BYTEORDER_H | ||
3 | |||
4 | #include <linux/byteorder/little_endian.h> | ||
5 | |||
6 | #endif /* _ASM_IA64_BYTEORDER_H */ | ||
diff --git a/arch/ia64/include/asm/errno.h b/arch/ia64/include/asm/errno.h new file mode 100644 index 00000000000..4c82b503d92 --- /dev/null +++ b/arch/ia64/include/asm/errno.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/errno.h> | |||
diff --git a/arch/ia64/include/asm/fcntl.h b/arch/ia64/include/asm/fcntl.h new file mode 100644 index 00000000000..1dd275dc8f6 --- /dev/null +++ b/arch/ia64/include/asm/fcntl.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #ifndef _ASM_IA64_FCNTL_H | ||
2 | #define _ASM_IA64_FCNTL_H | ||
3 | /* | ||
4 | * Modified 1998-2000 | ||
5 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co. | ||
6 | */ | ||
7 | |||
8 | #define force_o_largefile() \ | ||
9 | (personality(current->personality) != PER_LINUX32) | ||
10 | |||
11 | #include <asm-generic/fcntl.h> | ||
12 | |||
13 | #endif /* _ASM_IA64_FCNTL_H */ | ||
diff --git a/arch/ia64/include/asm/fpu.h b/arch/ia64/include/asm/fpu.h new file mode 100644 index 00000000000..b6395ad1500 --- /dev/null +++ b/arch/ia64/include/asm/fpu.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #ifndef _ASM_IA64_FPU_H | ||
2 | #define _ASM_IA64_FPU_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 1998, 1999, 2002, 2003 Hewlett-Packard Co | ||
6 | * David Mosberger-Tang <davidm@hpl.hp.com> | ||
7 | */ | ||
8 | |||
9 | #include <linux/types.h> | ||
10 | |||
11 | /* floating point status register: */ | ||
12 | #define FPSR_TRAP_VD (1 << 0) /* invalid op trap disabled */ | ||
13 | #define FPSR_TRAP_DD (1 << 1) /* denormal trap disabled */ | ||
14 | #define FPSR_TRAP_ZD (1 << 2) /* zero-divide trap disabled */ | ||
15 | #define FPSR_TRAP_OD (1 << 3) /* overflow trap disabled */ | ||
16 | #define FPSR_TRAP_UD (1 << 4) /* underflow trap disabled */ | ||
17 | #define FPSR_TRAP_ID (1 << 5) /* inexact trap disabled */ | ||
18 | #define FPSR_S0(x) ((x) << 6) | ||
19 | #define FPSR_S1(x) ((x) << 19) | ||
20 | #define FPSR_S2(x) (__IA64_UL(x) << 32) | ||
21 | #define FPSR_S3(x) (__IA64_UL(x) << 45) | ||
22 | |||
23 | /* floating-point status field controls: */ | ||
24 | #define FPSF_FTZ (1 << 0) /* flush-to-zero */ | ||
25 | #define FPSF_WRE (1 << 1) /* widest-range exponent */ | ||
26 | #define FPSF_PC(x) (((x) & 0x3) << 2) /* precision control */ | ||
27 | #define FPSF_RC(x) (((x) & 0x3) << 4) /* rounding control */ | ||
28 | #define FPSF_TD (1 << 6) /* trap disabled */ | ||
29 | |||
30 | /* floating-point status field flags: */ | ||
31 | #define FPSF_V (1 << 7) /* invalid operation flag */ | ||
32 | #define FPSF_D (1 << 8) /* denormal/unnormal operand flag */ | ||
33 | #define FPSF_Z (1 << 9) /* zero divide (IEEE) flag */ | ||
34 | #define FPSF_O (1 << 10) /* overflow (IEEE) flag */ | ||
35 | #define FPSF_U (1 << 11) /* underflow (IEEE) flag */ | ||
36 | #define FPSF_I (1 << 12) /* inexact (IEEE) flag) */ | ||
37 | |||
38 | /* floating-point rounding control: */ | ||
39 | #define FPRC_NEAREST 0x0 | ||
40 | #define FPRC_NEGINF 0x1 | ||
41 | #define FPRC_POSINF 0x2 | ||
42 | #define FPRC_TRUNC 0x3 | ||
43 | |||
44 | #define FPSF_DEFAULT (FPSF_PC (0x3) | FPSF_RC (FPRC_NEAREST)) | ||
45 | |||
46 | /* This default value is the same as HP-UX uses. Don't change it | ||
47 | without a very good reason. */ | ||
48 | #define FPSR_DEFAULT (FPSR_TRAP_VD | FPSR_TRAP_DD | FPSR_TRAP_ZD \ | ||
49 | | FPSR_TRAP_OD | FPSR_TRAP_UD | FPSR_TRAP_ID \ | ||
50 | | FPSR_S0 (FPSF_DEFAULT) \ | ||
51 | | FPSR_S1 (FPSF_DEFAULT | FPSF_TD | FPSF_WRE) \ | ||
52 | | FPSR_S2 (FPSF_DEFAULT | FPSF_TD) \ | ||
53 | | FPSR_S3 (FPSF_DEFAULT | FPSF_TD)) | ||
54 | |||
55 | # ifndef __ASSEMBLY__ | ||
56 | |||
57 | struct ia64_fpreg { | ||
58 | union { | ||
59 | unsigned long bits[2]; | ||
60 | long double __dummy; /* force 16-byte alignment */ | ||
61 | } u; | ||
62 | }; | ||
63 | |||
64 | # endif /* __ASSEMBLY__ */ | ||
65 | |||
66 | #endif /* _ASM_IA64_FPU_H */ | ||
diff --git a/arch/ia64/include/asm/ia64regs.h b/arch/ia64/include/asm/ia64regs.h new file mode 100644 index 00000000000..1757f1c11ad --- /dev/null +++ b/arch/ia64/include/asm/ia64regs.h | |||
@@ -0,0 +1,100 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002,2003 Intel Corp. | ||
3 | * Jun Nakajima <jun.nakajima@intel.com> | ||
4 | * Suresh Siddha <suresh.b.siddha@intel.com> | ||
5 | */ | ||
6 | |||
7 | #ifndef _ASM_IA64_IA64REGS_H | ||
8 | #define _ASM_IA64_IA64REGS_H | ||
9 | |||
10 | /* | ||
11 | * Register Names for getreg() and setreg(). | ||
12 | * | ||
13 | * The "magic" numbers happen to match the values used by the Intel compiler's | ||
14 | * getreg()/setreg() intrinsics. | ||
15 | */ | ||
16 | |||
17 | /* Special Registers */ | ||
18 | |||
19 | #define _IA64_REG_IP 1016 /* getreg only */ | ||
20 | #define _IA64_REG_PSR 1019 | ||
21 | #define _IA64_REG_PSR_L 1019 | ||
22 | |||
23 | /* General Integer Registers */ | ||
24 | |||
25 | #define _IA64_REG_GP 1025 /* R1 */ | ||
26 | #define _IA64_REG_R8 1032 /* R8 */ | ||
27 | #define _IA64_REG_R9 1033 /* R9 */ | ||
28 | #define _IA64_REG_SP 1036 /* R12 */ | ||
29 | #define _IA64_REG_TP 1037 /* R13 */ | ||
30 | |||
31 | /* Application Registers */ | ||
32 | |||
33 | #define _IA64_REG_AR_KR0 3072 | ||
34 | #define _IA64_REG_AR_KR1 3073 | ||
35 | #define _IA64_REG_AR_KR2 3074 | ||
36 | #define _IA64_REG_AR_KR3 3075 | ||
37 | #define _IA64_REG_AR_KR4 3076 | ||
38 | #define _IA64_REG_AR_KR5 3077 | ||
39 | #define _IA64_REG_AR_KR6 3078 | ||
40 | #define _IA64_REG_AR_KR7 3079 | ||
41 | #define _IA64_REG_AR_RSC 3088 | ||
42 | #define _IA64_REG_AR_BSP 3089 | ||
43 | #define _IA64_REG_AR_BSPSTORE 3090 | ||
44 | #define _IA64_REG_AR_RNAT 3091 | ||
45 | #define _IA64_REG_AR_FCR 3093 | ||
46 | #define _IA64_REG_AR_EFLAG 3096 | ||
47 | #define _IA64_REG_AR_CSD 3097 | ||
48 | #define _IA64_REG_AR_SSD 3098 | ||
49 | #define _IA64_REG_AR_CFLAG 3099 | ||
50 | #define _IA64_REG_AR_FSR 3100 | ||
51 | #define _IA64_REG_AR_FIR 3101 | ||
52 | #define _IA64_REG_AR_FDR 3102 | ||
53 | #define _IA64_REG_AR_CCV 3104 | ||
54 | #define _IA64_REG_AR_UNAT 3108 | ||
55 | #define _IA64_REG_AR_FPSR 3112 | ||
56 | #define _IA64_REG_AR_ITC 3116 | ||
57 | #define _IA64_REG_AR_PFS 3136 | ||
58 | #define _IA64_REG_AR_LC 3137 | ||
59 | #define _IA64_REG_AR_EC 3138 | ||
60 | |||
61 | /* Control Registers */ | ||
62 | |||
63 | #define _IA64_REG_CR_DCR 4096 | ||
64 | #define _IA64_REG_CR_ITM 4097 | ||
65 | #define _IA64_REG_CR_IVA 4098 | ||
66 | #define _IA64_REG_CR_PTA 4104 | ||
67 | #define _IA64_REG_CR_IPSR 4112 | ||
68 | #define _IA64_REG_CR_ISR 4113 | ||
69 | #define _IA64_REG_CR_IIP 4115 | ||
70 | #define _IA64_REG_CR_IFA 4116 | ||
71 | #define _IA64_REG_CR_ITIR 4117 | ||
72 | #define _IA64_REG_CR_IIPA 4118 | ||
73 | #define _IA64_REG_CR_IFS 4119 | ||
74 | #define _IA64_REG_CR_IIM 4120 | ||
75 | #define _IA64_REG_CR_IHA 4121 | ||
76 | #define _IA64_REG_CR_LID 4160 | ||
77 | #define _IA64_REG_CR_IVR 4161 /* getreg only */ | ||
78 | #define _IA64_REG_CR_TPR 4162 | ||
79 | #define _IA64_REG_CR_EOI 4163 | ||
80 | #define _IA64_REG_CR_IRR0 4164 /* getreg only */ | ||
81 | #define _IA64_REG_CR_IRR1 4165 /* getreg only */ | ||
82 | #define _IA64_REG_CR_IRR2 4166 /* getreg only */ | ||
83 | #define _IA64_REG_CR_IRR3 4167 /* getreg only */ | ||
84 | #define _IA64_REG_CR_ITV 4168 | ||
85 | #define _IA64_REG_CR_PMV 4169 | ||
86 | #define _IA64_REG_CR_CMCV 4170 | ||
87 | #define _IA64_REG_CR_LRR0 4176 | ||
88 | #define _IA64_REG_CR_LRR1 4177 | ||
89 | |||
90 | /* Indirect Registers for getindreg() and setindreg() */ | ||
91 | |||
92 | #define _IA64_REG_INDR_CPUID 9000 /* getindreg only */ | ||
93 | #define _IA64_REG_INDR_DBR 9001 | ||
94 | #define _IA64_REG_INDR_IBR 9002 | ||
95 | #define _IA64_REG_INDR_PKR 9003 | ||
96 | #define _IA64_REG_INDR_PMC 9004 | ||
97 | #define _IA64_REG_INDR_PMD 9005 | ||
98 | #define _IA64_REG_INDR_RR 9006 | ||
99 | |||
100 | #endif /* _ASM_IA64_IA64REGS_H */ | ||
diff --git a/arch/ia64/include/asm/intel_intrin.h b/arch/ia64/include/asm/intel_intrin.h new file mode 100644 index 00000000000..53cec577558 --- /dev/null +++ b/arch/ia64/include/asm/intel_intrin.h | |||
@@ -0,0 +1,161 @@ | |||
1 | #ifndef _ASM_IA64_INTEL_INTRIN_H | ||
2 | #define _ASM_IA64_INTEL_INTRIN_H | ||
3 | /* | ||
4 | * Intel Compiler Intrinsics | ||
5 | * | ||
6 | * Copyright (C) 2002,2003 Jun Nakajima <jun.nakajima@intel.com> | ||
7 | * Copyright (C) 2002,2003 Suresh Siddha <suresh.b.siddha@intel.com> | ||
8 | * Copyright (C) 2005,2006 Hongjiu Lu <hongjiu.lu@intel.com> | ||
9 | * | ||
10 | */ | ||
11 | #include <ia64intrin.h> | ||
12 | |||
13 | #define ia64_barrier() __memory_barrier() | ||
14 | |||
15 | #define ia64_stop() /* Nothing: As of now stop bit is generated for each | ||
16 | * intrinsic | ||
17 | */ | ||
18 | |||
19 | #define ia64_native_getreg __getReg | ||
20 | #define ia64_native_setreg __setReg | ||
21 | |||
22 | #define ia64_hint __hint | ||
23 | #define ia64_hint_pause __hint_pause | ||
24 | |||
25 | #define ia64_mux1_brcst _m64_mux1_brcst | ||
26 | #define ia64_mux1_mix _m64_mux1_mix | ||
27 | #define ia64_mux1_shuf _m64_mux1_shuf | ||
28 | #define ia64_mux1_alt _m64_mux1_alt | ||
29 | #define ia64_mux1_rev _m64_mux1_rev | ||
30 | |||
31 | #define ia64_mux1(x,v) _m_to_int64(_m64_mux1(_m_from_int64(x), (v))) | ||
32 | #define ia64_popcnt _m64_popcnt | ||
33 | #define ia64_getf_exp __getf_exp | ||
34 | #define ia64_shrp _m64_shrp | ||
35 | |||
36 | #define ia64_tpa __tpa | ||
37 | #define ia64_invala __invala | ||
38 | #define ia64_invala_gr __invala_gr | ||
39 | #define ia64_invala_fr __invala_fr | ||
40 | #define ia64_nop __nop | ||
41 | #define ia64_sum __sum | ||
42 | #define ia64_native_ssm __ssm | ||
43 | #define ia64_rum __rum | ||
44 | #define ia64_native_rsm __rsm | ||
45 | #define ia64_native_fc __fc | ||
46 | |||
47 | #define ia64_ldfs __ldfs | ||
48 | #define ia64_ldfd __ldfd | ||
49 | #define ia64_ldfe __ldfe | ||
50 | #define ia64_ldf8 __ldf8 | ||
51 | #define ia64_ldf_fill __ldf_fill | ||
52 | |||
53 | #define ia64_stfs __stfs | ||
54 | #define ia64_stfd __stfd | ||
55 | #define ia64_stfe __stfe | ||
56 | #define ia64_stf8 __stf8 | ||
57 | #define ia64_stf_spill __stf_spill | ||
58 | |||
59 | #define ia64_mf __mf | ||
60 | #define ia64_mfa __mfa | ||
61 | |||
62 | #define ia64_fetchadd4_acq __fetchadd4_acq | ||
63 | #define ia64_fetchadd4_rel __fetchadd4_rel | ||
64 | #define ia64_fetchadd8_acq __fetchadd8_acq | ||
65 | #define ia64_fetchadd8_rel __fetchadd8_rel | ||
66 | |||
67 | #define ia64_xchg1 _InterlockedExchange8 | ||
68 | #define ia64_xchg2 _InterlockedExchange16 | ||
69 | #define ia64_xchg4 _InterlockedExchange | ||
70 | #define ia64_xchg8 _InterlockedExchange64 | ||
71 | |||
72 | #define ia64_cmpxchg1_rel _InterlockedCompareExchange8_rel | ||
73 | #define ia64_cmpxchg1_acq _InterlockedCompareExchange8_acq | ||
74 | #define ia64_cmpxchg2_rel _InterlockedCompareExchange16_rel | ||
75 | #define ia64_cmpxchg2_acq _InterlockedCompareExchange16_acq | ||
76 | #define ia64_cmpxchg4_rel _InterlockedCompareExchange_rel | ||
77 | #define ia64_cmpxchg4_acq _InterlockedCompareExchange_acq | ||
78 | #define ia64_cmpxchg8_rel _InterlockedCompareExchange64_rel | ||
79 | #define ia64_cmpxchg8_acq _InterlockedCompareExchange64_acq | ||
80 | |||
81 | #define __ia64_set_dbr(index, val) \ | ||
82 | __setIndReg(_IA64_REG_INDR_DBR, index, val) | ||
83 | #define ia64_set_ibr(index, val) \ | ||
84 | __setIndReg(_IA64_REG_INDR_IBR, index, val) | ||
85 | #define ia64_set_pkr(index, val) \ | ||
86 | __setIndReg(_IA64_REG_INDR_PKR, index, val) | ||
87 | #define ia64_set_pmc(index, val) \ | ||
88 | __setIndReg(_IA64_REG_INDR_PMC, index, val) | ||
89 | #define ia64_set_pmd(index, val) \ | ||
90 | __setIndReg(_IA64_REG_INDR_PMD, index, val) | ||
91 | #define ia64_native_set_rr(index, val) \ | ||
92 | __setIndReg(_IA64_REG_INDR_RR, index, val) | ||
93 | |||
94 | #define ia64_native_get_cpuid(index) \ | ||
95 | __getIndReg(_IA64_REG_INDR_CPUID, index) | ||
96 | #define __ia64_get_dbr(index) __getIndReg(_IA64_REG_INDR_DBR, index) | ||
97 | #define ia64_get_ibr(index) __getIndReg(_IA64_REG_INDR_IBR, index) | ||
98 | #define ia64_get_pkr(index) __getIndReg(_IA64_REG_INDR_PKR, index) | ||
99 | #define ia64_get_pmc(index) __getIndReg(_IA64_REG_INDR_PMC, index) | ||
100 | #define ia64_native_get_pmd(index) __getIndReg(_IA64_REG_INDR_PMD, index) | ||
101 | #define ia64_native_get_rr(index) __getIndReg(_IA64_REG_INDR_RR, index) | ||
102 | |||
103 | #define ia64_srlz_d __dsrlz | ||
104 | #define ia64_srlz_i __isrlz | ||
105 | |||
106 | #define ia64_dv_serialize_data() | ||
107 | #define ia64_dv_serialize_instruction() | ||
108 | |||
109 | #define ia64_st1_rel __st1_rel | ||
110 | #define ia64_st2_rel __st2_rel | ||
111 | #define ia64_st4_rel __st4_rel | ||
112 | #define ia64_st8_rel __st8_rel | ||
113 | |||
114 | /* FIXME: need st4.rel.nta intrinsic */ | ||
115 | #define ia64_st4_rel_nta __st4_rel | ||
116 | |||
117 | #define ia64_ld1_acq __ld1_acq | ||
118 | #define ia64_ld2_acq __ld2_acq | ||
119 | #define ia64_ld4_acq __ld4_acq | ||
120 | #define ia64_ld8_acq __ld8_acq | ||
121 | |||
122 | #define ia64_sync_i __synci | ||
123 | #define ia64_native_thash __thash | ||
124 | #define ia64_native_ttag __ttag | ||
125 | #define ia64_itcd __itcd | ||
126 | #define ia64_itci __itci | ||
127 | #define ia64_itrd __itrd | ||
128 | #define ia64_itri __itri | ||
129 | #define ia64_ptce __ptce | ||
130 | #define ia64_ptcl __ptcl | ||
131 | #define ia64_native_ptcg __ptcg | ||
132 | #define ia64_native_ptcga __ptcga | ||
133 | #define ia64_ptri __ptri | ||
134 | #define ia64_ptrd __ptrd | ||
135 | #define ia64_dep_mi _m64_dep_mi | ||
136 | |||
137 | /* Values for lfhint in __lfetch and __lfetch_fault */ | ||
138 | |||
139 | #define ia64_lfhint_none __lfhint_none | ||
140 | #define ia64_lfhint_nt1 __lfhint_nt1 | ||
141 | #define ia64_lfhint_nt2 __lfhint_nt2 | ||
142 | #define ia64_lfhint_nta __lfhint_nta | ||
143 | |||
144 | #define ia64_lfetch __lfetch | ||
145 | #define ia64_lfetch_excl __lfetch_excl | ||
146 | #define ia64_lfetch_fault __lfetch_fault | ||
147 | #define ia64_lfetch_fault_excl __lfetch_fault_excl | ||
148 | |||
149 | #define ia64_native_intrin_local_irq_restore(x) \ | ||
150 | do { \ | ||
151 | if ((x) != 0) { \ | ||
152 | ia64_native_ssm(IA64_PSR_I); \ | ||
153 | ia64_srlz_d(); \ | ||
154 | } else { \ | ||
155 | ia64_native_rsm(IA64_PSR_I); \ | ||
156 | } \ | ||
157 | } while (0) | ||
158 | |||
159 | #define __builtin_trap() __break(0); | ||
160 | |||
161 | #endif /* _ASM_IA64_INTEL_INTRIN_H */ | ||
diff --git a/arch/ia64/include/asm/ioctl.h b/arch/ia64/include/asm/ioctl.h new file mode 100644 index 00000000000..b279fe06dfe --- /dev/null +++ b/arch/ia64/include/asm/ioctl.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/ioctl.h> | |||
diff --git a/arch/ia64/include/asm/ioctls.h b/arch/ia64/include/asm/ioctls.h new file mode 100644 index 00000000000..f3aab5512e9 --- /dev/null +++ b/arch/ia64/include/asm/ioctls.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef _ASM_IA64_IOCTLS_H | ||
2 | #define _ASM_IA64_IOCTLS_H | ||
3 | |||
4 | #include <asm-generic/ioctls.h> | ||
5 | |||
6 | #endif /* _ASM_IA64_IOCTLS_H */ | ||
diff --git a/arch/ia64/include/asm/ipcbuf.h b/arch/ia64/include/asm/ipcbuf.h new file mode 100644 index 00000000000..079899ae7d3 --- /dev/null +++ b/arch/ia64/include/asm/ipcbuf.h | |||
@@ -0,0 +1,28 @@ | |||
1 | #ifndef _ASM_IA64_IPCBUF_H | ||
2 | #define _ASM_IA64_IPCBUF_H | ||
3 | |||
4 | /* | ||
5 | * The ipc64_perm structure for IA-64 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 /* _ASM_IA64_IPCBUF_H */ | ||
diff --git a/arch/ia64/include/asm/kvm.h b/arch/ia64/include/asm/kvm.h new file mode 100644 index 00000000000..bc90c75adf6 --- /dev/null +++ b/arch/ia64/include/asm/kvm.h | |||
@@ -0,0 +1,264 @@ | |||
1 | #ifndef __ASM_IA64_KVM_H | ||
2 | #define __ASM_IA64_KVM_H | ||
3 | |||
4 | /* | ||
5 | * kvm structure definitions for ia64 | ||
6 | * | ||
7 | * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms and conditions of the GNU General Public License, | ||
11 | * version 2, as published by the Free Software Foundation. | ||
12 | * | ||
13 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
16 | * more details. | ||
17 | * | ||
18 | * You should have received a copy of the GNU General Public License along with | ||
19 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
20 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #include <linux/types.h> | ||
25 | #include <linux/ioctl.h> | ||
26 | |||
27 | /* Select x86 specific features in <linux/kvm.h> */ | ||
28 | #define __KVM_HAVE_IOAPIC | ||
29 | #define __KVM_HAVE_DEVICE_ASSIGNMENT | ||
30 | |||
31 | /* Architectural interrupt line count. */ | ||
32 | #define KVM_NR_INTERRUPTS 256 | ||
33 | |||
34 | #define KVM_IOAPIC_NUM_PINS 48 | ||
35 | |||
36 | struct kvm_ioapic_state { | ||
37 | __u64 base_address; | ||
38 | __u32 ioregsel; | ||
39 | __u32 id; | ||
40 | __u32 irr; | ||
41 | __u32 pad; | ||
42 | union { | ||
43 | __u64 bits; | ||
44 | struct { | ||
45 | __u8 vector; | ||
46 | __u8 delivery_mode:3; | ||
47 | __u8 dest_mode:1; | ||
48 | __u8 delivery_status:1; | ||
49 | __u8 polarity:1; | ||
50 | __u8 remote_irr:1; | ||
51 | __u8 trig_mode:1; | ||
52 | __u8 mask:1; | ||
53 | __u8 reserve:7; | ||
54 | __u8 reserved[4]; | ||
55 | __u8 dest_id; | ||
56 | } fields; | ||
57 | } redirtbl[KVM_IOAPIC_NUM_PINS]; | ||
58 | }; | ||
59 | |||
60 | #define KVM_IRQCHIP_PIC_MASTER 0 | ||
61 | #define KVM_IRQCHIP_PIC_SLAVE 1 | ||
62 | #define KVM_IRQCHIP_IOAPIC 2 | ||
63 | #define KVM_NR_IRQCHIPS 3 | ||
64 | |||
65 | #define KVM_CONTEXT_SIZE 8*1024 | ||
66 | |||
67 | struct kvm_fpreg { | ||
68 | union { | ||
69 | unsigned long bits[2]; | ||
70 | long double __dummy; /* force 16-byte alignment */ | ||
71 | } u; | ||
72 | }; | ||
73 | |||
74 | union context { | ||
75 | /* 8K size */ | ||
76 | char dummy[KVM_CONTEXT_SIZE]; | ||
77 | struct { | ||
78 | unsigned long psr; | ||
79 | unsigned long pr; | ||
80 | unsigned long caller_unat; | ||
81 | unsigned long pad; | ||
82 | unsigned long gr[32]; | ||
83 | unsigned long ar[128]; | ||
84 | unsigned long br[8]; | ||
85 | unsigned long cr[128]; | ||
86 | unsigned long rr[8]; | ||
87 | unsigned long ibr[8]; | ||
88 | unsigned long dbr[8]; | ||
89 | unsigned long pkr[8]; | ||
90 | struct kvm_fpreg fr[128]; | ||
91 | }; | ||
92 | }; | ||
93 | |||
94 | struct thash_data { | ||
95 | union { | ||
96 | struct { | ||
97 | unsigned long p : 1; /* 0 */ | ||
98 | unsigned long rv1 : 1; /* 1 */ | ||
99 | unsigned long ma : 3; /* 2-4 */ | ||
100 | unsigned long a : 1; /* 5 */ | ||
101 | unsigned long d : 1; /* 6 */ | ||
102 | unsigned long pl : 2; /* 7-8 */ | ||
103 | unsigned long ar : 3; /* 9-11 */ | ||
104 | unsigned long ppn : 38; /* 12-49 */ | ||
105 | unsigned long rv2 : 2; /* 50-51 */ | ||
106 | unsigned long ed : 1; /* 52 */ | ||
107 | unsigned long ig1 : 11; /* 53-63 */ | ||
108 | }; | ||
109 | struct { | ||
110 | unsigned long __rv1 : 53; /* 0-52 */ | ||
111 | unsigned long contiguous : 1; /*53 */ | ||
112 | unsigned long tc : 1; /* 54 TR or TC */ | ||
113 | unsigned long cl : 1; | ||
114 | /* 55 I side or D side cache line */ | ||
115 | unsigned long len : 4; /* 56-59 */ | ||
116 | unsigned long io : 1; /* 60 entry is for io or not */ | ||
117 | unsigned long nomap : 1; | ||
118 | /* 61 entry cann't be inserted into machine TLB.*/ | ||
119 | unsigned long checked : 1; | ||
120 | /* 62 for VTLB/VHPT sanity check */ | ||
121 | unsigned long invalid : 1; | ||
122 | /* 63 invalid entry */ | ||
123 | }; | ||
124 | unsigned long page_flags; | ||
125 | }; /* same for VHPT and TLB */ | ||
126 | |||
127 | union { | ||
128 | struct { | ||
129 | unsigned long rv3 : 2; | ||
130 | unsigned long ps : 6; | ||
131 | unsigned long key : 24; | ||
132 | unsigned long rv4 : 32; | ||
133 | }; | ||
134 | unsigned long itir; | ||
135 | }; | ||
136 | union { | ||
137 | struct { | ||
138 | unsigned long ig2 : 12; | ||
139 | unsigned long vpn : 49; | ||
140 | unsigned long vrn : 3; | ||
141 | }; | ||
142 | unsigned long ifa; | ||
143 | unsigned long vadr; | ||
144 | struct { | ||
145 | unsigned long tag : 63; | ||
146 | unsigned long ti : 1; | ||
147 | }; | ||
148 | unsigned long etag; | ||
149 | }; | ||
150 | union { | ||
151 | struct thash_data *next; | ||
152 | unsigned long rid; | ||
153 | unsigned long gpaddr; | ||
154 | }; | ||
155 | }; | ||
156 | |||
157 | #define NITRS 8 | ||
158 | #define NDTRS 8 | ||
159 | |||
160 | struct saved_vpd { | ||
161 | unsigned long vhpi; | ||
162 | unsigned long vgr[16]; | ||
163 | unsigned long vbgr[16]; | ||
164 | unsigned long vnat; | ||
165 | unsigned long vbnat; | ||
166 | unsigned long vcpuid[5]; | ||
167 | unsigned long vpsr; | ||
168 | unsigned long vpr; | ||
169 | union { | ||
170 | unsigned long vcr[128]; | ||
171 | struct { | ||
172 | unsigned long dcr; | ||
173 | unsigned long itm; | ||
174 | unsigned long iva; | ||
175 | unsigned long rsv1[5]; | ||
176 | unsigned long pta; | ||
177 | unsigned long rsv2[7]; | ||
178 | unsigned long ipsr; | ||
179 | unsigned long isr; | ||
180 | unsigned long rsv3; | ||
181 | unsigned long iip; | ||
182 | unsigned long ifa; | ||
183 | unsigned long itir; | ||
184 | unsigned long iipa; | ||
185 | unsigned long ifs; | ||
186 | unsigned long iim; | ||
187 | unsigned long iha; | ||
188 | unsigned long rsv4[38]; | ||
189 | unsigned long lid; | ||
190 | unsigned long ivr; | ||
191 | unsigned long tpr; | ||
192 | unsigned long eoi; | ||
193 | unsigned long irr[4]; | ||
194 | unsigned long itv; | ||
195 | unsigned long pmv; | ||
196 | unsigned long cmcv; | ||
197 | unsigned long rsv5[5]; | ||
198 | unsigned long lrr0; | ||
199 | unsigned long lrr1; | ||
200 | unsigned long rsv6[46]; | ||
201 | }; | ||
202 | }; | ||
203 | }; | ||
204 | |||
205 | struct kvm_regs { | ||
206 | struct saved_vpd vpd; | ||
207 | /*Arch-regs*/ | ||
208 | int mp_state; | ||
209 | unsigned long vmm_rr; | ||
210 | /* TR and TC. */ | ||
211 | struct thash_data itrs[NITRS]; | ||
212 | struct thash_data dtrs[NDTRS]; | ||
213 | /* Bit is set if there is a tr/tc for the region. */ | ||
214 | unsigned char itr_regions; | ||
215 | unsigned char dtr_regions; | ||
216 | unsigned char tc_regions; | ||
217 | |||
218 | char irq_check; | ||
219 | unsigned long saved_itc; | ||
220 | unsigned long itc_check; | ||
221 | unsigned long timer_check; | ||
222 | unsigned long timer_pending; | ||
223 | unsigned long last_itc; | ||
224 | |||
225 | unsigned long vrr[8]; | ||
226 | unsigned long ibr[8]; | ||
227 | unsigned long dbr[8]; | ||
228 | unsigned long insvc[4]; /* Interrupt in service. */ | ||
229 | unsigned long xtp; | ||
230 | |||
231 | unsigned long metaphysical_rr0; /* from kvm_arch (so is pinned) */ | ||
232 | unsigned long metaphysical_rr4; /* from kvm_arch (so is pinned) */ | ||
233 | unsigned long metaphysical_saved_rr0; /* from kvm_arch */ | ||
234 | unsigned long metaphysical_saved_rr4; /* from kvm_arch */ | ||
235 | unsigned long fp_psr; /*used for lazy float register */ | ||
236 | unsigned long saved_gp; | ||
237 | /*for phycial emulation */ | ||
238 | |||
239 | union context saved_guest; | ||
240 | |||
241 | unsigned long reserved[64]; /* for future use */ | ||
242 | }; | ||
243 | |||
244 | struct kvm_sregs { | ||
245 | }; | ||
246 | |||
247 | struct kvm_fpu { | ||
248 | }; | ||
249 | |||
250 | #define KVM_IA64_VCPU_STACK_SHIFT 16 | ||
251 | #define KVM_IA64_VCPU_STACK_SIZE (1UL << KVM_IA64_VCPU_STACK_SHIFT) | ||
252 | |||
253 | struct kvm_ia64_vcpu_stack { | ||
254 | unsigned char stack[KVM_IA64_VCPU_STACK_SIZE]; | ||
255 | }; | ||
256 | |||
257 | struct kvm_debug_exit_arch { | ||
258 | }; | ||
259 | |||
260 | /* for KVM_SET_GUEST_DEBUG */ | ||
261 | struct kvm_guest_debug_arch { | ||
262 | }; | ||
263 | |||
264 | #endif | ||
diff --git a/arch/ia64/include/asm/kvm_para.h b/arch/ia64/include/asm/kvm_para.h new file mode 100644 index 00000000000..1588aee781a --- /dev/null +++ b/arch/ia64/include/asm/kvm_para.h | |||
@@ -0,0 +1,31 @@ | |||
1 | #ifndef __IA64_KVM_PARA_H | ||
2 | #define __IA64_KVM_PARA_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2007 Xiantao Zhang <xiantao.zhang@intel.com> | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms and conditions of the GNU General Public License, | ||
9 | * version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
14 | * more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License along with | ||
17 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
18 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
19 | * | ||
20 | */ | ||
21 | |||
22 | #ifdef __KERNEL__ | ||
23 | |||
24 | static inline unsigned int kvm_arch_para_features(void) | ||
25 | { | ||
26 | return 0; | ||
27 | } | ||
28 | |||
29 | #endif | ||
30 | |||
31 | #endif | ||
diff --git a/arch/ia64/include/asm/msgbuf.h b/arch/ia64/include/asm/msgbuf.h new file mode 100644 index 00000000000..6c64c0d2aae --- /dev/null +++ b/arch/ia64/include/asm/msgbuf.h | |||
@@ -0,0 +1,27 @@ | |||
1 | #ifndef _ASM_IA64_MSGBUF_H | ||
2 | #define _ASM_IA64_MSGBUF_H | ||
3 | |||
4 | /* | ||
5 | * The msqid64_ds structure for IA-64 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 /* _ASM_IA64_MSGBUF_H */ | ||
diff --git a/arch/ia64/include/asm/perfmon_default_smpl.h b/arch/ia64/include/asm/perfmon_default_smpl.h new file mode 100644 index 00000000000..a2d560c6723 --- /dev/null +++ b/arch/ia64/include/asm/perfmon_default_smpl.h | |||
@@ -0,0 +1,83 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2002-2003 Hewlett-Packard Co | ||
3 | * Stephane Eranian <eranian@hpl.hp.com> | ||
4 | * | ||
5 | * This file implements the default sampling buffer format | ||
6 | * for Linux/ia64 perfmon subsystem. | ||
7 | */ | ||
8 | #ifndef __PERFMON_DEFAULT_SMPL_H__ | ||
9 | #define __PERFMON_DEFAULT_SMPL_H__ 1 | ||
10 | |||
11 | #define PFM_DEFAULT_SMPL_UUID { \ | ||
12 | 0x4d, 0x72, 0xbe, 0xc0, 0x06, 0x64, 0x41, 0x43, 0x82, 0xb4, 0xd3, 0xfd, 0x27, 0x24, 0x3c, 0x97} | ||
13 | |||
14 | /* | ||
15 | * format specific parameters (passed at context creation) | ||
16 | */ | ||
17 | typedef struct { | ||
18 | unsigned long buf_size; /* size of the buffer in bytes */ | ||
19 | unsigned int flags; /* buffer specific flags */ | ||
20 | unsigned int res1; /* for future use */ | ||
21 | unsigned long reserved[2]; /* for future use */ | ||
22 | } pfm_default_smpl_arg_t; | ||
23 | |||
24 | /* | ||
25 | * combined context+format specific structure. Can be passed | ||
26 | * to PFM_CONTEXT_CREATE | ||
27 | */ | ||
28 | typedef struct { | ||
29 | pfarg_context_t ctx_arg; | ||
30 | pfm_default_smpl_arg_t buf_arg; | ||
31 | } pfm_default_smpl_ctx_arg_t; | ||
32 | |||
33 | /* | ||
34 | * This header is at the beginning of the sampling buffer returned to the user. | ||
35 | * It is directly followed by the first record. | ||
36 | */ | ||
37 | typedef struct { | ||
38 | unsigned long hdr_count; /* how many valid entries */ | ||
39 | unsigned long hdr_cur_offs; /* current offset from top of buffer */ | ||
40 | unsigned long hdr_reserved2; /* reserved for future use */ | ||
41 | |||
42 | unsigned long hdr_overflows; /* how many times the buffer overflowed */ | ||
43 | unsigned long hdr_buf_size; /* how many bytes in the buffer */ | ||
44 | |||
45 | unsigned int hdr_version; /* contains perfmon version (smpl format diffs) */ | ||
46 | unsigned int hdr_reserved1; /* for future use */ | ||
47 | unsigned long hdr_reserved[10]; /* for future use */ | ||
48 | } pfm_default_smpl_hdr_t; | ||
49 | |||
50 | /* | ||
51 | * Entry header in the sampling buffer. The header is directly followed | ||
52 | * with the values of the PMD registers of interest saved in increasing | ||
53 | * index order: PMD4, PMD5, and so on. How many PMDs are present depends | ||
54 | * on how the session was programmed. | ||
55 | * | ||
56 | * In the case where multiple counters overflow at the same time, multiple | ||
57 | * entries are written consecutively. | ||
58 | * | ||
59 | * last_reset_value member indicates the initial value of the overflowed PMD. | ||
60 | */ | ||
61 | typedef struct { | ||
62 | int pid; /* thread id (for NPTL, this is gettid()) */ | ||
63 | unsigned char reserved1[3]; /* reserved for future use */ | ||
64 | unsigned char ovfl_pmd; /* index of overflowed PMD */ | ||
65 | |||
66 | unsigned long last_reset_val; /* initial value of overflowed PMD */ | ||
67 | unsigned long ip; /* where did the overflow interrupt happened */ | ||
68 | unsigned long tstamp; /* ar.itc when entering perfmon intr. handler */ | ||
69 | |||
70 | unsigned short cpu; /* cpu on which the overflow occurred */ | ||
71 | unsigned short set; /* event set active when overflow occurred */ | ||
72 | int tgid; /* thread group id (for NPTL, this is getpid()) */ | ||
73 | } pfm_default_smpl_entry_t; | ||
74 | |||
75 | #define PFM_DEFAULT_MAX_PMDS 64 /* how many pmds supported by data structures (sizeof(unsigned long) */ | ||
76 | #define PFM_DEFAULT_MAX_ENTRY_SIZE (sizeof(pfm_default_smpl_entry_t)+(sizeof(unsigned long)*PFM_DEFAULT_MAX_PMDS)) | ||
77 | #define PFM_DEFAULT_SMPL_MIN_BUF_SIZE (sizeof(pfm_default_smpl_hdr_t)+PFM_DEFAULT_MAX_ENTRY_SIZE) | ||
78 | |||
79 | #define PFM_DEFAULT_SMPL_VERSION_MAJ 2U | ||
80 | #define PFM_DEFAULT_SMPL_VERSION_MIN 0U | ||
81 | #define PFM_DEFAULT_SMPL_VERSION (((PFM_DEFAULT_SMPL_VERSION_MAJ&0xffff)<<16)|(PFM_DEFAULT_SMPL_VERSION_MIN & 0xffff)) | ||
82 | |||
83 | #endif /* __PERFMON_DEFAULT_SMPL_H__ */ | ||
diff --git a/arch/ia64/include/asm/poll.h b/arch/ia64/include/asm/poll.h new file mode 100644 index 00000000000..c98509d3149 --- /dev/null +++ b/arch/ia64/include/asm/poll.h | |||
@@ -0,0 +1 @@ | |||
#include <asm-generic/poll.h> | |||
diff --git a/arch/ia64/include/asm/posix_types.h b/arch/ia64/include/asm/posix_types.h new file mode 100644 index 00000000000..17885567b73 --- /dev/null +++ b/arch/ia64/include/asm/posix_types.h | |||
@@ -0,0 +1,126 @@ | |||
1 | #ifndef _ASM_IA64_POSIX_TYPES_H | ||
2 | #define _ASM_IA64_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 | * Based on <asm-alpha/posix_types.h>. | ||
10 | * | ||
11 | * Modified 1998-2000, 2003 | ||
12 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
13 | */ | ||
14 | |||
15 | typedef unsigned long __kernel_ino_t; | ||
16 | typedef unsigned int __kernel_mode_t; | ||
17 | typedef unsigned int __kernel_nlink_t; | ||
18 | typedef long __kernel_off_t; | ||
19 | typedef long long __kernel_loff_t; | ||
20 | typedef int __kernel_pid_t; | ||
21 | typedef int __kernel_ipc_pid_t; | ||
22 | typedef unsigned int __kernel_uid_t; | ||
23 | typedef unsigned int __kernel_gid_t; | ||
24 | typedef unsigned long __kernel_size_t; | ||
25 | typedef long __kernel_ssize_t; | ||
26 | typedef long __kernel_ptrdiff_t; | ||
27 | typedef long __kernel_time_t; | ||
28 | typedef long __kernel_suseconds_t; | ||
29 | typedef long __kernel_clock_t; | ||
30 | typedef int __kernel_timer_t; | ||
31 | typedef int __kernel_clockid_t; | ||
32 | typedef int __kernel_daddr_t; | ||
33 | typedef char * __kernel_caddr_t; | ||
34 | typedef unsigned long __kernel_sigset_t; /* at least 32 bits */ | ||
35 | typedef unsigned short __kernel_uid16_t; | ||
36 | typedef unsigned short __kernel_gid16_t; | ||
37 | |||
38 | typedef struct { | ||
39 | int val[2]; | ||
40 | } __kernel_fsid_t; | ||
41 | |||
42 | typedef __kernel_uid_t __kernel_old_uid_t; | ||
43 | typedef __kernel_gid_t __kernel_old_gid_t; | ||
44 | typedef __kernel_uid_t __kernel_uid32_t; | ||
45 | typedef __kernel_gid_t __kernel_gid32_t; | ||
46 | |||
47 | typedef unsigned int __kernel_old_dev_t; | ||
48 | |||
49 | # ifdef __KERNEL__ | ||
50 | |||
51 | # ifndef __GNUC__ | ||
52 | |||
53 | #define __FD_SET(d, set) ((set)->fds_bits[__FDELT(d)] |= __FDMASK(d)) | ||
54 | #define __FD_CLR(d, set) ((set)->fds_bits[__FDELT(d)] &= ~__FDMASK(d)) | ||
55 | #define __FD_ISSET(d, set) (((set)->fds_bits[__FDELT(d)] & __FDMASK(d)) != 0) | ||
56 | #define __FD_ZERO(set) \ | ||
57 | ((void) memset ((void *) (set), 0, sizeof (__kernel_fd_set))) | ||
58 | |||
59 | # else /* !__GNUC__ */ | ||
60 | |||
61 | /* With GNU C, use inline functions instead so args are evaluated only once: */ | ||
62 | |||
63 | #undef __FD_SET | ||
64 | static __inline__ void __FD_SET(unsigned long fd, __kernel_fd_set *fdsetp) | ||
65 | { | ||
66 | unsigned long _tmp = fd / __NFDBITS; | ||
67 | unsigned long _rem = fd % __NFDBITS; | ||
68 | fdsetp->fds_bits[_tmp] |= (1UL<<_rem); | ||
69 | } | ||
70 | |||
71 | #undef __FD_CLR | ||
72 | static __inline__ void __FD_CLR(unsigned long fd, __kernel_fd_set *fdsetp) | ||
73 | { | ||
74 | unsigned long _tmp = fd / __NFDBITS; | ||
75 | unsigned long _rem = fd % __NFDBITS; | ||
76 | fdsetp->fds_bits[_tmp] &= ~(1UL<<_rem); | ||
77 | } | ||
78 | |||
79 | #undef __FD_ISSET | ||
80 | static __inline__ int __FD_ISSET(unsigned long fd, const __kernel_fd_set *p) | ||
81 | { | ||
82 | unsigned long _tmp = fd / __NFDBITS; | ||
83 | unsigned long _rem = fd % __NFDBITS; | ||
84 | return (p->fds_bits[_tmp] & (1UL<<_rem)) != 0; | ||
85 | } | ||
86 | |||
87 | /* | ||
88 | * This will unroll the loop for the normal constant case (8 ints, | ||
89 | * for a 256-bit fd_set) | ||
90 | */ | ||
91 | #undef __FD_ZERO | ||
92 | static __inline__ void __FD_ZERO(__kernel_fd_set *p) | ||
93 | { | ||
94 | unsigned long *tmp = p->fds_bits; | ||
95 | int i; | ||
96 | |||
97 | if (__builtin_constant_p(__FDSET_LONGS)) { | ||
98 | switch (__FDSET_LONGS) { | ||
99 | case 16: | ||
100 | tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; | ||
101 | tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; | ||
102 | tmp[ 8] = 0; tmp[ 9] = 0; tmp[10] = 0; tmp[11] = 0; | ||
103 | tmp[12] = 0; tmp[13] = 0; tmp[14] = 0; tmp[15] = 0; | ||
104 | return; | ||
105 | |||
106 | case 8: | ||
107 | tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; | ||
108 | tmp[ 4] = 0; tmp[ 5] = 0; tmp[ 6] = 0; tmp[ 7] = 0; | ||
109 | return; | ||
110 | |||
111 | case 4: | ||
112 | tmp[ 0] = 0; tmp[ 1] = 0; tmp[ 2] = 0; tmp[ 3] = 0; | ||
113 | return; | ||
114 | } | ||
115 | } | ||
116 | i = __FDSET_LONGS; | ||
117 | while (i) { | ||
118 | i--; | ||
119 | *tmp = 0; | ||
120 | tmp++; | ||
121 | } | ||
122 | } | ||
123 | |||
124 | # endif /* !__GNUC__ */ | ||
125 | # endif /* __KERNEL__ */ | ||
126 | #endif /* _ASM_IA64_POSIX_TYPES_H */ | ||
diff --git a/arch/ia64/include/asm/ptrace_offsets.h b/arch/ia64/include/asm/ptrace_offsets.h new file mode 100644 index 00000000000..b712773c759 --- /dev/null +++ b/arch/ia64/include/asm/ptrace_offsets.h | |||
@@ -0,0 +1,268 @@ | |||
1 | #ifndef _ASM_IA64_PTRACE_OFFSETS_H | ||
2 | #define _ASM_IA64_PTRACE_OFFSETS_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 1999, 2003 Hewlett-Packard Co | ||
6 | * David Mosberger-Tang <davidm@hpl.hp.com> | ||
7 | */ | ||
8 | /* | ||
9 | * The "uarea" that can be accessed via PEEKUSER and POKEUSER is a | ||
10 | * virtual structure that would have the following definition: | ||
11 | * | ||
12 | * struct uarea { | ||
13 | * struct ia64_fpreg fph[96]; // f32-f127 | ||
14 | * unsigned long nat_bits; | ||
15 | * unsigned long empty1; | ||
16 | * struct ia64_fpreg f2; // f2-f5 | ||
17 | * : | ||
18 | * struct ia64_fpreg f5; | ||
19 | * struct ia64_fpreg f10; // f10-f31 | ||
20 | * : | ||
21 | * struct ia64_fpreg f31; | ||
22 | * unsigned long r4; // r4-r7 | ||
23 | * : | ||
24 | * unsigned long r7; | ||
25 | * unsigned long b1; // b1-b5 | ||
26 | * : | ||
27 | * unsigned long b5; | ||
28 | * unsigned long ar_ec; | ||
29 | * unsigned long ar_lc; | ||
30 | * unsigned long empty2[5]; | ||
31 | * unsigned long cr_ipsr; | ||
32 | * unsigned long cr_iip; | ||
33 | * unsigned long cfm; | ||
34 | * unsigned long ar_unat; | ||
35 | * unsigned long ar_pfs; | ||
36 | * unsigned long ar_rsc; | ||
37 | * unsigned long ar_rnat; | ||
38 | * unsigned long ar_bspstore; | ||
39 | * unsigned long pr; | ||
40 | * unsigned long b6; | ||
41 | * unsigned long ar_bsp; | ||
42 | * unsigned long r1; | ||
43 | * unsigned long r2; | ||
44 | * unsigned long r3; | ||
45 | * unsigned long r12; | ||
46 | * unsigned long r13; | ||
47 | * unsigned long r14; | ||
48 | * unsigned long r15; | ||
49 | * unsigned long r8; | ||
50 | * unsigned long r9; | ||
51 | * unsigned long r10; | ||
52 | * unsigned long r11; | ||
53 | * unsigned long r16; | ||
54 | * : | ||
55 | * unsigned long r31; | ||
56 | * unsigned long ar_ccv; | ||
57 | * unsigned long ar_fpsr; | ||
58 | * unsigned long b0; | ||
59 | * unsigned long b7; | ||
60 | * unsigned long f6; | ||
61 | * unsigned long f7; | ||
62 | * unsigned long f8; | ||
63 | * unsigned long f9; | ||
64 | * unsigned long ar_csd; | ||
65 | * unsigned long ar_ssd; | ||
66 | * unsigned long rsvd1[710]; | ||
67 | * unsigned long dbr[8]; | ||
68 | * unsigned long rsvd2[504]; | ||
69 | * unsigned long ibr[8]; | ||
70 | * unsigned long rsvd3[504]; | ||
71 | * unsigned long pmd[4]; | ||
72 | * } | ||
73 | */ | ||
74 | |||
75 | /* fph: */ | ||
76 | #define PT_F32 0x0000 | ||
77 | #define PT_F33 0x0010 | ||
78 | #define PT_F34 0x0020 | ||
79 | #define PT_F35 0x0030 | ||
80 | #define PT_F36 0x0040 | ||
81 | #define PT_F37 0x0050 | ||
82 | #define PT_F38 0x0060 | ||
83 | #define PT_F39 0x0070 | ||
84 | #define PT_F40 0x0080 | ||
85 | #define PT_F41 0x0090 | ||
86 | #define PT_F42 0x00a0 | ||
87 | #define PT_F43 0x00b0 | ||
88 | #define PT_F44 0x00c0 | ||
89 | #define PT_F45 0x00d0 | ||
90 | #define PT_F46 0x00e0 | ||
91 | #define PT_F47 0x00f0 | ||
92 | #define PT_F48 0x0100 | ||
93 | #define PT_F49 0x0110 | ||
94 | #define PT_F50 0x0120 | ||
95 | #define PT_F51 0x0130 | ||
96 | #define PT_F52 0x0140 | ||
97 | #define PT_F53 0x0150 | ||
98 | #define PT_F54 0x0160 | ||
99 | #define PT_F55 0x0170 | ||
100 | #define PT_F56 0x0180 | ||
101 | #define PT_F57 0x0190 | ||
102 | #define PT_F58 0x01a0 | ||
103 | #define PT_F59 0x01b0 | ||
104 | #define PT_F60 0x01c0 | ||
105 | #define PT_F61 0x01d0 | ||
106 | #define PT_F62 0x01e0 | ||
107 | #define PT_F63 0x01f0 | ||
108 | #define PT_F64 0x0200 | ||
109 | #define PT_F65 0x0210 | ||
110 | #define PT_F66 0x0220 | ||
111 | #define PT_F67 0x0230 | ||
112 | #define PT_F68 0x0240 | ||
113 | #define PT_F69 0x0250 | ||
114 | #define PT_F70 0x0260 | ||
115 | #define PT_F71 0x0270 | ||
116 | #define PT_F72 0x0280 | ||
117 | #define PT_F73 0x0290 | ||
118 | #define PT_F74 0x02a0 | ||
119 | #define PT_F75 0x02b0 | ||
120 | #define PT_F76 0x02c0 | ||
121 | #define PT_F77 0x02d0 | ||
122 | #define PT_F78 0x02e0 | ||
123 | #define PT_F79 0x02f0 | ||
124 | #define PT_F80 0x0300 | ||
125 | #define PT_F81 0x0310 | ||
126 | #define PT_F82 0x0320 | ||
127 | #define PT_F83 0x0330 | ||
128 | #define PT_F84 0x0340 | ||
129 | #define PT_F85 0x0350 | ||
130 | #define PT_F86 0x0360 | ||
131 | #define PT_F87 0x0370 | ||
132 | #define PT_F88 0x0380 | ||
133 | #define PT_F89 0x0390 | ||
134 | #define PT_F90 0x03a0 | ||
135 | #define PT_F91 0x03b0 | ||
136 | #define PT_F92 0x03c0 | ||
137 | #define PT_F93 0x03d0 | ||
138 | #define PT_F94 0x03e0 | ||
139 | #define PT_F95 0x03f0 | ||
140 | #define PT_F96 0x0400 | ||
141 | #define PT_F97 0x0410 | ||
142 | #define PT_F98 0x0420 | ||
143 | #define PT_F99 0x0430 | ||
144 | #define PT_F100 0x0440 | ||
145 | #define PT_F101 0x0450 | ||
146 | #define PT_F102 0x0460 | ||
147 | #define PT_F103 0x0470 | ||
148 | #define PT_F104 0x0480 | ||
149 | #define PT_F105 0x0490 | ||
150 | #define PT_F106 0x04a0 | ||
151 | #define PT_F107 0x04b0 | ||
152 | #define PT_F108 0x04c0 | ||
153 | #define PT_F109 0x04d0 | ||
154 | #define PT_F110 0x04e0 | ||
155 | #define PT_F111 0x04f0 | ||
156 | #define PT_F112 0x0500 | ||
157 | #define PT_F113 0x0510 | ||
158 | #define PT_F114 0x0520 | ||
159 | #define PT_F115 0x0530 | ||
160 | #define PT_F116 0x0540 | ||
161 | #define PT_F117 0x0550 | ||
162 | #define PT_F118 0x0560 | ||
163 | #define PT_F119 0x0570 | ||
164 | #define PT_F120 0x0580 | ||
165 | #define PT_F121 0x0590 | ||
166 | #define PT_F122 0x05a0 | ||
167 | #define PT_F123 0x05b0 | ||
168 | #define PT_F124 0x05c0 | ||
169 | #define PT_F125 0x05d0 | ||
170 | #define PT_F126 0x05e0 | ||
171 | #define PT_F127 0x05f0 | ||
172 | |||
173 | #define PT_NAT_BITS 0x0600 | ||
174 | |||
175 | #define PT_F2 0x0610 | ||
176 | #define PT_F3 0x0620 | ||
177 | #define PT_F4 0x0630 | ||
178 | #define PT_F5 0x0640 | ||
179 | #define PT_F10 0x0650 | ||
180 | #define PT_F11 0x0660 | ||
181 | #define PT_F12 0x0670 | ||
182 | #define PT_F13 0x0680 | ||
183 | #define PT_F14 0x0690 | ||
184 | #define PT_F15 0x06a0 | ||
185 | #define PT_F16 0x06b0 | ||
186 | #define PT_F17 0x06c0 | ||
187 | #define PT_F18 0x06d0 | ||
188 | #define PT_F19 0x06e0 | ||
189 | #define PT_F20 0x06f0 | ||
190 | #define PT_F21 0x0700 | ||
191 | #define PT_F22 0x0710 | ||
192 | #define PT_F23 0x0720 | ||
193 | #define PT_F24 0x0730 | ||
194 | #define PT_F25 0x0740 | ||
195 | #define PT_F26 0x0750 | ||
196 | #define PT_F27 0x0760 | ||
197 | #define PT_F28 0x0770 | ||
198 | #define PT_F29 0x0780 | ||
199 | #define PT_F30 0x0790 | ||
200 | #define PT_F31 0x07a0 | ||
201 | #define PT_R4 0x07b0 | ||
202 | #define PT_R5 0x07b8 | ||
203 | #define PT_R6 0x07c0 | ||
204 | #define PT_R7 0x07c8 | ||
205 | |||
206 | #define PT_B1 0x07d8 | ||
207 | #define PT_B2 0x07e0 | ||
208 | #define PT_B3 0x07e8 | ||
209 | #define PT_B4 0x07f0 | ||
210 | #define PT_B5 0x07f8 | ||
211 | |||
212 | #define PT_AR_EC 0x0800 | ||
213 | #define PT_AR_LC 0x0808 | ||
214 | |||
215 | #define PT_CR_IPSR 0x0830 | ||
216 | #define PT_CR_IIP 0x0838 | ||
217 | #define PT_CFM 0x0840 | ||
218 | #define PT_AR_UNAT 0x0848 | ||
219 | #define PT_AR_PFS 0x0850 | ||
220 | #define PT_AR_RSC 0x0858 | ||
221 | #define PT_AR_RNAT 0x0860 | ||
222 | #define PT_AR_BSPSTORE 0x0868 | ||
223 | #define PT_PR 0x0870 | ||
224 | #define PT_B6 0x0878 | ||
225 | #define PT_AR_BSP 0x0880 /* note: this points to the *end* of the backing store! */ | ||
226 | #define PT_R1 0x0888 | ||
227 | #define PT_R2 0x0890 | ||
228 | #define PT_R3 0x0898 | ||
229 | #define PT_R12 0x08a0 | ||
230 | #define PT_R13 0x08a8 | ||
231 | #define PT_R14 0x08b0 | ||
232 | #define PT_R15 0x08b8 | ||
233 | #define PT_R8 0x08c0 | ||
234 | #define PT_R9 0x08c8 | ||
235 | #define PT_R10 0x08d0 | ||
236 | #define PT_R11 0x08d8 | ||
237 | #define PT_R16 0x08e0 | ||
238 | #define PT_R17 0x08e8 | ||
239 | #define PT_R18 0x08f0 | ||
240 | #define PT_R19 0x08f8 | ||
241 | #define PT_R20 0x0900 | ||
242 | #define PT_R21 0x0908 | ||
243 | #define PT_R22 0x0910 | ||
244 | #define PT_R23 0x0918 | ||
245 | #define PT_R24 0x0920 | ||
246 | #define PT_R25 0x0928 | ||
247 | #define PT_R26 0x0930 | ||
248 | #define PT_R27 0x0938 | ||
249 | #define PT_R28 0x0940 | ||
250 | #define PT_R29 0x0948 | ||
251 | #define PT_R30 0x0950 | ||
252 | #define PT_R31 0x0958 | ||
253 | #define PT_AR_CCV 0x0960 | ||
254 | #define PT_AR_FPSR 0x0968 | ||
255 | #define PT_B0 0x0970 | ||
256 | #define PT_B7 0x0978 | ||
257 | #define PT_F6 0x0980 | ||
258 | #define PT_F7 0x0990 | ||
259 | #define PT_F8 0x09a0 | ||
260 | #define PT_F9 0x09b0 | ||
261 | #define PT_AR_CSD 0x09c0 | ||
262 | #define PT_AR_SSD 0x09c8 | ||
263 | |||
264 | #define PT_DBR 0x2000 /* data breakpoint registers */ | ||
265 | #define PT_IBR 0x3000 /* instruction breakpoint registers */ | ||
266 | #define PT_PMD 0x4000 /* performance monitoring counters */ | ||
267 | |||
268 | #endif /* _ASM_IA64_PTRACE_OFFSETS_H */ | ||
diff --git a/arch/ia64/include/asm/resource.h b/arch/ia64/include/asm/resource.h new file mode 100644 index 00000000000..ba2272a87fc --- /dev/null +++ b/arch/ia64/include/asm/resource.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef _ASM_IA64_RESOURCE_H | ||
2 | #define _ASM_IA64_RESOURCE_H | ||
3 | |||
4 | #include <asm/ustack.h> | ||
5 | #include <asm-generic/resource.h> | ||
6 | |||
7 | #endif /* _ASM_IA64_RESOURCE_H */ | ||
diff --git a/arch/ia64/include/asm/rse.h b/arch/ia64/include/asm/rse.h new file mode 100644 index 00000000000..02830a3b019 --- /dev/null +++ b/arch/ia64/include/asm/rse.h | |||
@@ -0,0 +1,66 @@ | |||
1 | #ifndef _ASM_IA64_RSE_H | ||
2 | #define _ASM_IA64_RSE_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 1998, 1999 Hewlett-Packard Co | ||
6 | * Copyright (C) 1998, 1999 David Mosberger-Tang <davidm@hpl.hp.com> | ||
7 | * | ||
8 | * Register stack engine related helper functions. This file may be | ||
9 | * used in applications, so be careful about the name-space and give | ||
10 | * some consideration to non-GNU C compilers (though __inline__ is | ||
11 | * fine). | ||
12 | */ | ||
13 | |||
14 | static __inline__ unsigned long | ||
15 | ia64_rse_slot_num (unsigned long *addr) | ||
16 | { | ||
17 | return (((unsigned long) addr) >> 3) & 0x3f; | ||
18 | } | ||
19 | |||
20 | /* | ||
21 | * Return TRUE if ADDR is the address of an RNAT slot. | ||
22 | */ | ||
23 | static __inline__ unsigned long | ||
24 | ia64_rse_is_rnat_slot (unsigned long *addr) | ||
25 | { | ||
26 | return ia64_rse_slot_num(addr) == 0x3f; | ||
27 | } | ||
28 | |||
29 | /* | ||
30 | * Returns the address of the RNAT slot that covers the slot at | ||
31 | * address SLOT_ADDR. | ||
32 | */ | ||
33 | static __inline__ unsigned long * | ||
34 | ia64_rse_rnat_addr (unsigned long *slot_addr) | ||
35 | { | ||
36 | return (unsigned long *) ((unsigned long) slot_addr | (0x3f << 3)); | ||
37 | } | ||
38 | |||
39 | /* | ||
40 | * Calculate the number of registers in the dirty partition starting at BSPSTORE and | ||
41 | * ending at BSP. This isn't simply (BSP-BSPSTORE)/8 because every 64th slot stores | ||
42 | * ar.rnat. | ||
43 | */ | ||
44 | static __inline__ unsigned long | ||
45 | ia64_rse_num_regs (unsigned long *bspstore, unsigned long *bsp) | ||
46 | { | ||
47 | unsigned long slots = (bsp - bspstore); | ||
48 | |||
49 | return slots - (ia64_rse_slot_num(bspstore) + slots)/0x40; | ||
50 | } | ||
51 | |||
52 | /* | ||
53 | * The inverse of the above: given bspstore and the number of | ||
54 | * registers, calculate ar.bsp. | ||
55 | */ | ||
56 | static __inline__ unsigned long * | ||
57 | ia64_rse_skip_regs (unsigned long *addr, long num_regs) | ||
58 | { | ||
59 | long delta = ia64_rse_slot_num(addr) + num_regs; | ||
60 | |||
61 | if (num_regs < 0) | ||
62 | delta -= 0x3e; | ||
63 | return addr + num_regs + delta/0x3f; | ||
64 | } | ||
65 | |||
66 | #endif /* _ASM_IA64_RSE_H */ | ||
diff --git a/arch/ia64/include/asm/sembuf.h b/arch/ia64/include/asm/sembuf.h new file mode 100644 index 00000000000..1340fbc04d3 --- /dev/null +++ b/arch/ia64/include/asm/sembuf.h | |||
@@ -0,0 +1,22 @@ | |||
1 | #ifndef _ASM_IA64_SEMBUF_H | ||
2 | #define _ASM_IA64_SEMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The semid64_ds structure for IA-64 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 /* _ASM_IA64_SEMBUF_H */ | ||
diff --git a/arch/ia64/include/asm/setup.h b/arch/ia64/include/asm/setup.h new file mode 100644 index 00000000000..4399a44355b --- /dev/null +++ b/arch/ia64/include/asm/setup.h | |||
@@ -0,0 +1,6 @@ | |||
1 | #ifndef __IA64_SETUP_H | ||
2 | #define __IA64_SETUP_H | ||
3 | |||
4 | #define COMMAND_LINE_SIZE 2048 | ||
5 | |||
6 | #endif | ||
diff --git a/arch/ia64/include/asm/shmbuf.h b/arch/ia64/include/asm/shmbuf.h new file mode 100644 index 00000000000..585002a77ac --- /dev/null +++ b/arch/ia64/include/asm/shmbuf.h | |||
@@ -0,0 +1,38 @@ | |||
1 | #ifndef _ASM_IA64_SHMBUF_H | ||
2 | #define _ASM_IA64_SHMBUF_H | ||
3 | |||
4 | /* | ||
5 | * The shmid64_ds structure for IA-64 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 /* _ASM_IA64_SHMBUF_H */ | ||
diff --git a/arch/ia64/include/asm/sigcontext.h b/arch/ia64/include/asm/sigcontext.h new file mode 100644 index 00000000000..57ff777bcc4 --- /dev/null +++ b/arch/ia64/include/asm/sigcontext.h | |||
@@ -0,0 +1,70 @@ | |||
1 | #ifndef _ASM_IA64_SIGCONTEXT_H | ||
2 | #define _ASM_IA64_SIGCONTEXT_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 1998, 1999, 2001 Hewlett-Packard Co | ||
6 | * Copyright (C) 1998, 1999, 2001 David Mosberger-Tang <davidm@hpl.hp.com> | ||
7 | */ | ||
8 | |||
9 | #include <asm/fpu.h> | ||
10 | |||
11 | #define IA64_SC_FLAG_ONSTACK_BIT 0 /* is handler running on signal stack? */ | ||
12 | #define IA64_SC_FLAG_IN_SYSCALL_BIT 1 /* did signal interrupt a syscall? */ | ||
13 | #define IA64_SC_FLAG_FPH_VALID_BIT 2 /* is state in f[32]-f[127] valid? */ | ||
14 | |||
15 | #define IA64_SC_FLAG_ONSTACK (1 << IA64_SC_FLAG_ONSTACK_BIT) | ||
16 | #define IA64_SC_FLAG_IN_SYSCALL (1 << IA64_SC_FLAG_IN_SYSCALL_BIT) | ||
17 | #define IA64_SC_FLAG_FPH_VALID (1 << IA64_SC_FLAG_FPH_VALID_BIT) | ||
18 | |||
19 | # ifndef __ASSEMBLY__ | ||
20 | |||
21 | /* | ||
22 | * Note on handling of register backing store: sc_ar_bsp contains the address that would | ||
23 | * be found in ar.bsp after executing a "cover" instruction the context in which the | ||
24 | * signal was raised. If signal delivery required switching to an alternate signal stack | ||
25 | * (sc_rbs_base is not NULL), the "dirty" partition (as it would exist after executing the | ||
26 | * imaginary "cover" instruction) is backed by the *alternate* signal stack, not the | ||
27 | * original one. In this case, sc_rbs_base contains the base address of the new register | ||
28 | * backing store. The number of registers in the dirty partition can be calculated as: | ||
29 | * | ||
30 | * ndirty = ia64_rse_num_regs(sc_rbs_base, sc_rbs_base + (sc_loadrs >> 16)) | ||
31 | * | ||
32 | */ | ||
33 | |||
34 | struct sigcontext { | ||
35 | unsigned long sc_flags; /* see manifest constants above */ | ||
36 | unsigned long sc_nat; /* bit i == 1 iff scratch reg gr[i] is a NaT */ | ||
37 | stack_t sc_stack; /* previously active stack */ | ||
38 | |||
39 | unsigned long sc_ip; /* instruction pointer */ | ||
40 | unsigned long sc_cfm; /* current frame marker */ | ||
41 | unsigned long sc_um; /* user mask bits */ | ||
42 | unsigned long sc_ar_rsc; /* register stack configuration register */ | ||
43 | unsigned long sc_ar_bsp; /* backing store pointer */ | ||
44 | unsigned long sc_ar_rnat; /* RSE NaT collection register */ | ||
45 | unsigned long sc_ar_ccv; /* compare and exchange compare value register */ | ||
46 | unsigned long sc_ar_unat; /* ar.unat of interrupted context */ | ||
47 | unsigned long sc_ar_fpsr; /* floating-point status register */ | ||
48 | unsigned long sc_ar_pfs; /* previous function state */ | ||
49 | unsigned long sc_ar_lc; /* loop count register */ | ||
50 | unsigned long sc_pr; /* predicate registers */ | ||
51 | unsigned long sc_br[8]; /* branch registers */ | ||
52 | /* Note: sc_gr[0] is used as the "uc_link" member of ucontext_t */ | ||
53 | unsigned long sc_gr[32]; /* general registers (static partition) */ | ||
54 | struct ia64_fpreg sc_fr[128]; /* floating-point registers */ | ||
55 | |||
56 | unsigned long sc_rbs_base; /* NULL or new base of sighandler's rbs */ | ||
57 | unsigned long sc_loadrs; /* see description above */ | ||
58 | |||
59 | unsigned long sc_ar25; /* cmp8xchg16 uses this */ | ||
60 | unsigned long sc_ar26; /* rsvd for scratch use */ | ||
61 | unsigned long sc_rsvd[12]; /* reserved for future use */ | ||
62 | /* | ||
63 | * The mask must come last so we can increase _NSIG_WORDS | ||
64 | * without breaking binary compatibility. | ||
65 | */ | ||
66 | sigset_t sc_mask; /* signal mask to restore after handler returns */ | ||
67 | }; | ||
68 | |||
69 | # endif /* __ASSEMBLY__ */ | ||
70 | #endif /* _ASM_IA64_SIGCONTEXT_H */ | ||
diff --git a/arch/ia64/include/asm/socket.h b/arch/ia64/include/asm/socket.h new file mode 100644 index 00000000000..51427eaa51b --- /dev/null +++ b/arch/ia64/include/asm/socket.h | |||
@@ -0,0 +1,74 @@ | |||
1 | #ifndef _ASM_IA64_SOCKET_H | ||
2 | #define _ASM_IA64_SOCKET_H | ||
3 | |||
4 | /* | ||
5 | * Socket related defines. | ||
6 | * | ||
7 | * Based on <asm-i386/socket.h>. | ||
8 | * | ||
9 | * Modified 1998-2000 | ||
10 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
11 | */ | ||
12 | |||
13 | #include <asm/sockios.h> | ||
14 | |||
15 | /* For setsockopt(2) */ | ||
16 | #define SOL_SOCKET 1 | ||
17 | |||
18 | #define SO_DEBUG 1 | ||
19 | #define SO_REUSEADDR 2 | ||
20 | #define SO_TYPE 3 | ||
21 | #define SO_ERROR 4 | ||
22 | #define SO_DONTROUTE 5 | ||
23 | #define SO_BROADCAST 6 | ||
24 | #define SO_SNDBUF 7 | ||
25 | #define SO_RCVBUF 8 | ||
26 | #define SO_SNDBUFFORCE 32 | ||
27 | #define SO_RCVBUFFORCE 33 | ||
28 | #define SO_KEEPALIVE 9 | ||
29 | #define SO_OOBINLINE 10 | ||
30 | #define SO_NO_CHECK 11 | ||
31 | #define SO_PRIORITY 12 | ||
32 | #define SO_LINGER 13 | ||
33 | #define SO_BSDCOMPAT 14 | ||
34 | /* To add :#define SO_REUSEPORT 15 */ | ||
35 | #define SO_PASSCRED 16 | ||
36 | #define SO_PEERCRED 17 | ||
37 | #define SO_RCVLOWAT 18 | ||
38 | #define SO_SNDLOWAT 19 | ||
39 | #define SO_RCVTIMEO 20 | ||
40 | #define SO_SNDTIMEO 21 | ||
41 | |||
42 | /* Security levels - as per NRL IPv6 - don't actually do anything */ | ||
43 | #define SO_SECURITY_AUTHENTICATION 22 | ||
44 | #define SO_SECURITY_ENCRYPTION_TRANSPORT 23 | ||
45 | #define SO_SECURITY_ENCRYPTION_NETWORK 24 | ||
46 | |||
47 | #define SO_BINDTODEVICE 25 | ||
48 | |||
49 | /* Socket filtering */ | ||
50 | #define SO_ATTACH_FILTER 26 | ||
51 | #define SO_DETACH_FILTER 27 | ||
52 | |||
53 | #define SO_PEERNAME 28 | ||
54 | #define SO_TIMESTAMP 29 | ||
55 | #define SCM_TIMESTAMP SO_TIMESTAMP | ||
56 | |||
57 | #define SO_ACCEPTCONN 30 | ||
58 | |||
59 | #define SO_PEERSEC 31 | ||
60 | #define SO_PASSSEC 34 | ||
61 | #define SO_TIMESTAMPNS 35 | ||
62 | #define SCM_TIMESTAMPNS SO_TIMESTAMPNS | ||
63 | |||
64 | #define SO_MARK 36 | ||
65 | |||
66 | #define SO_TIMESTAMPING 37 | ||
67 | #define SCM_TIMESTAMPING SO_TIMESTAMPING | ||
68 | |||
69 | #define SO_PROTOCOL 38 | ||
70 | #define SO_DOMAIN 39 | ||
71 | |||
72 | #define SO_RXQ_OVFL 40 | ||
73 | |||
74 | #endif /* _ASM_IA64_SOCKET_H */ | ||
diff --git a/arch/ia64/include/asm/sockios.h b/arch/ia64/include/asm/sockios.h new file mode 100644 index 00000000000..15c92468ad3 --- /dev/null +++ b/arch/ia64/include/asm/sockios.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _ASM_IA64_SOCKIOS_H | ||
2 | #define _ASM_IA64_SOCKIOS_H | ||
3 | |||
4 | /* | ||
5 | * Socket-level I/O control calls. | ||
6 | * | ||
7 | * Based on <asm-i386/sockios.h>. | ||
8 | * | ||
9 | * Modified 1998, 1999 | ||
10 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
11 | */ | ||
12 | #define FIOSETOWN 0x8901 | ||
13 | #define SIOCSPGRP 0x8902 | ||
14 | #define FIOGETOWN 0x8903 | ||
15 | #define SIOCGPGRP 0x8904 | ||
16 | #define SIOCATMARK 0x8905 | ||
17 | #define SIOCGSTAMP 0x8906 /* Get stamp (timeval) */ | ||
18 | #define SIOCGSTAMPNS 0x8907 /* Get stamp (timespec) */ | ||
19 | |||
20 | #endif /* _ASM_IA64_SOCKIOS_H */ | ||
diff --git a/arch/ia64/include/asm/stat.h b/arch/ia64/include/asm/stat.h new file mode 100644 index 00000000000..367bb90cdff --- /dev/null +++ b/arch/ia64/include/asm/stat.h | |||
@@ -0,0 +1,51 @@ | |||
1 | #ifndef _ASM_IA64_STAT_H | ||
2 | #define _ASM_IA64_STAT_H | ||
3 | |||
4 | /* | ||
5 | * Modified 1998, 1999 | ||
6 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
7 | */ | ||
8 | |||
9 | struct stat { | ||
10 | unsigned long st_dev; | ||
11 | unsigned long st_ino; | ||
12 | unsigned long st_nlink; | ||
13 | unsigned int st_mode; | ||
14 | unsigned int st_uid; | ||
15 | unsigned int st_gid; | ||
16 | unsigned int __pad0; | ||
17 | unsigned long st_rdev; | ||
18 | unsigned long st_size; | ||
19 | unsigned long st_atime; | ||
20 | unsigned long st_atime_nsec; | ||
21 | unsigned long st_mtime; | ||
22 | unsigned long st_mtime_nsec; | ||
23 | unsigned long st_ctime; | ||
24 | unsigned long st_ctime_nsec; | ||
25 | unsigned long st_blksize; | ||
26 | long st_blocks; | ||
27 | unsigned long __unused[3]; | ||
28 | }; | ||
29 | |||
30 | #define STAT_HAVE_NSEC 1 | ||
31 | |||
32 | struct ia64_oldstat { | ||
33 | unsigned int st_dev; | ||
34 | unsigned int st_ino; | ||
35 | unsigned int st_mode; | ||
36 | unsigned int st_nlink; | ||
37 | unsigned int st_uid; | ||
38 | unsigned int st_gid; | ||
39 | unsigned int st_rdev; | ||
40 | unsigned int __pad1; | ||
41 | unsigned long st_size; | ||
42 | unsigned long st_atime; | ||
43 | unsigned long st_mtime; | ||
44 | unsigned long st_ctime; | ||
45 | unsigned int st_blksize; | ||
46 | int st_blocks; | ||
47 | unsigned int __unused1; | ||
48 | unsigned int __unused2; | ||
49 | }; | ||
50 | |||
51 | #endif /* _ASM_IA64_STAT_H */ | ||
diff --git a/arch/ia64/include/asm/statfs.h b/arch/ia64/include/asm/statfs.h new file mode 100644 index 00000000000..1e589669de5 --- /dev/null +++ b/arch/ia64/include/asm/statfs.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef _ASM_IA64_STATFS_H | ||
2 | #define _ASM_IA64_STATFS_H | ||
3 | |||
4 | /* | ||
5 | * Based on <asm-i386/statfs.h>. | ||
6 | * | ||
7 | * Modified 1998, 1999, 2003 | ||
8 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
9 | */ | ||
10 | |||
11 | /* | ||
12 | * We need compat_statfs64 to be packed, because the i386 ABI won't | ||
13 | * add padding at the end to bring it to a multiple of 8 bytes, but | ||
14 | * the IA64 ABI will. | ||
15 | */ | ||
16 | #define ARCH_PACK_COMPAT_STATFS64 __attribute__((packed,aligned(4))) | ||
17 | |||
18 | #include <asm-generic/statfs.h> | ||
19 | |||
20 | #endif /* _ASM_IA64_STATFS_H */ | ||
diff --git a/arch/ia64/include/asm/swab.h b/arch/ia64/include/asm/swab.h new file mode 100644 index 00000000000..c89a8cb5d8a --- /dev/null +++ b/arch/ia64/include/asm/swab.h | |||
@@ -0,0 +1,34 @@ | |||
1 | #ifndef _ASM_IA64_SWAB_H | ||
2 | #define _ASM_IA64_SWAB_H | ||
3 | |||
4 | /* | ||
5 | * Modified 1998, 1999 | ||
6 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co. | ||
7 | */ | ||
8 | |||
9 | #include <linux/types.h> | ||
10 | #include <asm/intrinsics.h> | ||
11 | #include <linux/compiler.h> | ||
12 | |||
13 | static __inline__ __attribute_const__ __u64 __arch_swab64(__u64 x) | ||
14 | { | ||
15 | __u64 result; | ||
16 | |||
17 | result = ia64_mux1(x, ia64_mux1_rev); | ||
18 | return result; | ||
19 | } | ||
20 | #define __arch_swab64 __arch_swab64 | ||
21 | |||
22 | static __inline__ __attribute_const__ __u32 __arch_swab32(__u32 x) | ||
23 | { | ||
24 | return __arch_swab64(x) >> 32; | ||
25 | } | ||
26 | #define __arch_swab32 __arch_swab32 | ||
27 | |||
28 | static __inline__ __attribute_const__ __u16 __arch_swab16(__u16 x) | ||
29 | { | ||
30 | return __arch_swab64(x) >> 48; | ||
31 | } | ||
32 | #define __arch_swab16 __arch_swab16 | ||
33 | |||
34 | #endif /* _ASM_IA64_SWAB_H */ | ||
diff --git a/arch/ia64/include/asm/system.h b/arch/ia64/include/asm/system.h new file mode 100644 index 00000000000..6cca30705d5 --- /dev/null +++ b/arch/ia64/include/asm/system.h | |||
@@ -0,0 +1,203 @@ | |||
1 | #ifndef _ASM_IA64_SYSTEM_H | ||
2 | #define _ASM_IA64_SYSTEM_H | ||
3 | |||
4 | /* | ||
5 | * System defines. Note that this is included both from .c and .S | ||
6 | * files, so it does only defines, not any C code. This is based | ||
7 | * on information published in the Processor Abstraction Layer | ||
8 | * and the System Abstraction Layer manual. | ||
9 | * | ||
10 | * Copyright (C) 1998-2003 Hewlett-Packard Co | ||
11 | * David Mosberger-Tang <davidm@hpl.hp.com> | ||
12 | * Copyright (C) 1999 Asit Mallick <asit.k.mallick@intel.com> | ||
13 | * Copyright (C) 1999 Don Dugger <don.dugger@intel.com> | ||
14 | */ | ||
15 | |||
16 | #include <asm/kregs.h> | ||
17 | #include <asm/page.h> | ||
18 | #include <asm/pal.h> | ||
19 | #include <asm/percpu.h> | ||
20 | |||
21 | #define GATE_ADDR RGN_BASE(RGN_GATE) | ||
22 | |||
23 | /* | ||
24 | * 0xa000000000000000+2*PERCPU_PAGE_SIZE | ||
25 | * - 0xa000000000000000+3*PERCPU_PAGE_SIZE remain unmapped (guard page) | ||
26 | */ | ||
27 | #define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000)) | ||
28 | #define PERCPU_ADDR (-PERCPU_PAGE_SIZE) | ||
29 | #define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE) | ||
30 | |||
31 | #ifndef __ASSEMBLY__ | ||
32 | |||
33 | #include <linux/kernel.h> | ||
34 | #include <linux/types.h> | ||
35 | |||
36 | #define AT_VECTOR_SIZE_ARCH 2 /* entries in ARCH_DLINFO */ | ||
37 | |||
38 | struct pci_vector_struct { | ||
39 | __u16 segment; /* PCI Segment number */ | ||
40 | __u16 bus; /* PCI Bus number */ | ||
41 | __u32 pci_id; /* ACPI split 16 bits device, 16 bits function (see section 6.1.1) */ | ||
42 | __u8 pin; /* PCI PIN (0 = A, 1 = B, 2 = C, 3 = D) */ | ||
43 | __u32 irq; /* IRQ assigned */ | ||
44 | }; | ||
45 | |||
46 | extern struct ia64_boot_param { | ||
47 | __u64 command_line; /* physical address of command line arguments */ | ||
48 | __u64 efi_systab; /* physical address of EFI system table */ | ||
49 | __u64 efi_memmap; /* physical address of EFI memory map */ | ||
50 | __u64 efi_memmap_size; /* size of EFI memory map */ | ||
51 | __u64 efi_memdesc_size; /* size of an EFI memory map descriptor */ | ||
52 | __u32 efi_memdesc_version; /* memory descriptor version */ | ||
53 | struct { | ||
54 | __u16 num_cols; /* number of columns on console output device */ | ||
55 | __u16 num_rows; /* number of rows on console output device */ | ||
56 | __u16 orig_x; /* cursor's x position */ | ||
57 | __u16 orig_y; /* cursor's y position */ | ||
58 | } console_info; | ||
59 | __u64 fpswa; /* physical address of the fpswa interface */ | ||
60 | __u64 initrd_start; | ||
61 | __u64 initrd_size; | ||
62 | } *ia64_boot_param; | ||
63 | |||
64 | /* | ||
65 | * Macros to force memory ordering. In these descriptions, "previous" | ||
66 | * and "subsequent" refer to program order; "visible" means that all | ||
67 | * architecturally visible effects of a memory access have occurred | ||
68 | * (at a minimum, this means the memory has been read or written). | ||
69 | * | ||
70 | * wmb(): Guarantees that all preceding stores to memory- | ||
71 | * like regions are visible before any subsequent | ||
72 | * stores and that all following stores will be | ||
73 | * visible only after all previous stores. | ||
74 | * rmb(): Like wmb(), but for reads. | ||
75 | * mb(): wmb()/rmb() combo, i.e., all previous memory | ||
76 | * accesses are visible before all subsequent | ||
77 | * accesses and vice versa. This is also known as | ||
78 | * a "fence." | ||
79 | * | ||
80 | * Note: "mb()" and its variants cannot be used as a fence to order | ||
81 | * accesses to memory mapped I/O registers. For that, mf.a needs to | ||
82 | * be used. However, we don't want to always use mf.a because (a) | ||
83 | * it's (presumably) much slower than mf and (b) mf.a is supported for | ||
84 | * sequential memory pages only. | ||
85 | */ | ||
86 | #define mb() ia64_mf() | ||
87 | #define rmb() mb() | ||
88 | #define wmb() mb() | ||
89 | #define read_barrier_depends() do { } while(0) | ||
90 | |||
91 | #ifdef CONFIG_SMP | ||
92 | # define smp_mb() mb() | ||
93 | # define smp_rmb() rmb() | ||
94 | # define smp_wmb() wmb() | ||
95 | # define smp_read_barrier_depends() read_barrier_depends() | ||
96 | #else | ||
97 | # define smp_mb() barrier() | ||
98 | # define smp_rmb() barrier() | ||
99 | # define smp_wmb() barrier() | ||
100 | # define smp_read_barrier_depends() do { } while(0) | ||
101 | #endif | ||
102 | |||
103 | /* | ||
104 | * XXX check on this ---I suspect what Linus really wants here is | ||
105 | * acquire vs release semantics but we can't discuss this stuff with | ||
106 | * Linus just yet. Grrr... | ||
107 | */ | ||
108 | #define set_mb(var, value) do { (var) = (value); mb(); } while (0) | ||
109 | |||
110 | /* | ||
111 | * The group barrier in front of the rsm & ssm are necessary to ensure | ||
112 | * that none of the previous instructions in the same group are | ||
113 | * affected by the rsm/ssm. | ||
114 | */ | ||
115 | |||
116 | #ifdef __KERNEL__ | ||
117 | |||
118 | /* | ||
119 | * Context switch from one thread to another. If the two threads have | ||
120 | * different address spaces, schedule() has already taken care of | ||
121 | * switching to the new address space by calling switch_mm(). | ||
122 | * | ||
123 | * Disabling access to the fph partition and the debug-register | ||
124 | * context switch MUST be done before calling ia64_switch_to() since a | ||
125 | * newly created thread returns directly to | ||
126 | * ia64_ret_from_syscall_clear_r8. | ||
127 | */ | ||
128 | extern struct task_struct *ia64_switch_to (void *next_task); | ||
129 | |||
130 | struct task_struct; | ||
131 | |||
132 | extern void ia64_save_extra (struct task_struct *task); | ||
133 | extern void ia64_load_extra (struct task_struct *task); | ||
134 | |||
135 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
136 | extern void ia64_account_on_switch (struct task_struct *prev, struct task_struct *next); | ||
137 | # define IA64_ACCOUNT_ON_SWITCH(p,n) ia64_account_on_switch(p,n) | ||
138 | #else | ||
139 | # define IA64_ACCOUNT_ON_SWITCH(p,n) | ||
140 | #endif | ||
141 | |||
142 | #ifdef CONFIG_PERFMON | ||
143 | DECLARE_PER_CPU(unsigned long, pfm_syst_info); | ||
144 | # define PERFMON_IS_SYSWIDE() (__get_cpu_var(pfm_syst_info) & 0x1) | ||
145 | #else | ||
146 | # define PERFMON_IS_SYSWIDE() (0) | ||
147 | #endif | ||
148 | |||
149 | #define IA64_HAS_EXTRA_STATE(t) \ | ||
150 | ((t)->thread.flags & (IA64_THREAD_DBG_VALID|IA64_THREAD_PM_VALID) \ | ||
151 | || PERFMON_IS_SYSWIDE()) | ||
152 | |||
153 | #define __switch_to(prev,next,last) do { \ | ||
154 | IA64_ACCOUNT_ON_SWITCH(prev, next); \ | ||
155 | if (IA64_HAS_EXTRA_STATE(prev)) \ | ||
156 | ia64_save_extra(prev); \ | ||
157 | if (IA64_HAS_EXTRA_STATE(next)) \ | ||
158 | ia64_load_extra(next); \ | ||
159 | ia64_psr(task_pt_regs(next))->dfh = !ia64_is_local_fpu_owner(next); \ | ||
160 | (last) = ia64_switch_to((next)); \ | ||
161 | } while (0) | ||
162 | |||
163 | #ifdef CONFIG_SMP | ||
164 | /* | ||
165 | * In the SMP case, we save the fph state when context-switching away from a thread that | ||
166 | * modified fph. This way, when the thread gets scheduled on another CPU, the CPU can | ||
167 | * pick up the state from task->thread.fph, avoiding the complication of having to fetch | ||
168 | * the latest fph state from another CPU. In other words: eager save, lazy restore. | ||
169 | */ | ||
170 | # define switch_to(prev,next,last) do { \ | ||
171 | if (ia64_psr(task_pt_regs(prev))->mfh && ia64_is_local_fpu_owner(prev)) { \ | ||
172 | ia64_psr(task_pt_regs(prev))->mfh = 0; \ | ||
173 | (prev)->thread.flags |= IA64_THREAD_FPH_VALID; \ | ||
174 | __ia64_save_fpu((prev)->thread.fph); \ | ||
175 | } \ | ||
176 | __switch_to(prev, next, last); \ | ||
177 | /* "next" in old context is "current" in new context */ \ | ||
178 | if (unlikely((current->thread.flags & IA64_THREAD_MIGRATION) && \ | ||
179 | (task_cpu(current) != \ | ||
180 | task_thread_info(current)->last_cpu))) { \ | ||
181 | platform_migrate(current); \ | ||
182 | task_thread_info(current)->last_cpu = task_cpu(current); \ | ||
183 | } \ | ||
184 | } while (0) | ||
185 | #else | ||
186 | # define switch_to(prev,next,last) __switch_to(prev, next, last) | ||
187 | #endif | ||
188 | |||
189 | #define __ARCH_WANT_UNLOCKED_CTXSW | ||
190 | #define ARCH_HAS_PREFETCH_SWITCH_STACK | ||
191 | #define ia64_platform_is(x) (strcmp(x, platform_name) == 0) | ||
192 | |||
193 | void cpu_idle_wait(void); | ||
194 | |||
195 | #define arch_align_stack(x) (x) | ||
196 | |||
197 | void default_idle(void); | ||
198 | |||
199 | #endif /* __KERNEL__ */ | ||
200 | |||
201 | #endif /* __ASSEMBLY__ */ | ||
202 | |||
203 | #endif /* _ASM_IA64_SYSTEM_H */ | ||
diff --git a/arch/ia64/include/asm/termbits.h b/arch/ia64/include/asm/termbits.h new file mode 100644 index 00000000000..c009b94e58d --- /dev/null +++ b/arch/ia64/include/asm/termbits.h | |||
@@ -0,0 +1,208 @@ | |||
1 | #ifndef _ASM_IA64_TERMBITS_H | ||
2 | #define _ASM_IA64_TERMBITS_H | ||
3 | |||
4 | /* | ||
5 | * Based on <asm-i386/termbits.h>. | ||
6 | * | ||
7 | * Modified 1999 | ||
8 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | ||
9 | * | ||
10 | * 99/01/28 Added new baudrates | ||
11 | */ | ||
12 | |||
13 | #include <linux/posix_types.h> | ||
14 | |||
15 | typedef unsigned char cc_t; | ||
16 | typedef unsigned int speed_t; | ||
17 | typedef unsigned int tcflag_t; | ||
18 | |||
19 | #define NCCS 19 | ||
20 | struct termios { | ||
21 | tcflag_t c_iflag; /* input mode flags */ | ||
22 | tcflag_t c_oflag; /* output mode flags */ | ||
23 | tcflag_t c_cflag; /* control mode flags */ | ||
24 | tcflag_t c_lflag; /* local mode flags */ | ||
25 | cc_t c_line; /* line discipline */ | ||
26 | cc_t c_cc[NCCS]; /* control characters */ | ||
27 | }; | ||
28 | |||
29 | struct termios2 { | ||
30 | tcflag_t c_iflag; /* input mode flags */ | ||
31 | tcflag_t c_oflag; /* output mode flags */ | ||
32 | tcflag_t c_cflag; /* control mode flags */ | ||
33 | tcflag_t c_lflag; /* local mode flags */ | ||
34 | cc_t c_line; /* line discipline */ | ||
35 | cc_t c_cc[NCCS]; /* control characters */ | ||
36 | speed_t c_ispeed; /* input speed */ | ||
37 | speed_t c_ospeed; /* output speed */ | ||
38 | }; | ||
39 | |||
40 | struct ktermios { | ||
41 | tcflag_t c_iflag; /* input mode flags */ | ||
42 | tcflag_t c_oflag; /* output mode flags */ | ||
43 | tcflag_t c_cflag; /* control mode flags */ | ||
44 | tcflag_t c_lflag; /* local mode flags */ | ||
45 | cc_t c_line; /* line discipline */ | ||
46 | cc_t c_cc[NCCS]; /* control characters */ | ||
47 | speed_t c_ispeed; /* input speed */ | ||
48 | speed_t c_ospeed; /* output speed */ | ||
49 | }; | ||
50 | |||
51 | /* c_cc characters */ | ||
52 | #define VINTR 0 | ||
53 | #define VQUIT 1 | ||
54 | #define VERASE 2 | ||
55 | #define VKILL 3 | ||
56 | #define VEOF 4 | ||
57 | #define VTIME 5 | ||
58 | #define VMIN 6 | ||
59 | #define VSWTC 7 | ||
60 | #define VSTART 8 | ||
61 | #define VSTOP 9 | ||
62 | #define VSUSP 10 | ||
63 | #define VEOL 11 | ||
64 | #define VREPRINT 12 | ||
65 | #define VDISCARD 13 | ||
66 | #define VWERASE 14 | ||
67 | #define VLNEXT 15 | ||
68 | #define VEOL2 16 | ||
69 | |||
70 | /* c_iflag bits */ | ||
71 | #define IGNBRK 0000001 | ||
72 | #define BRKINT 0000002 | ||
73 | #define IGNPAR 0000004 | ||
74 | #define PARMRK 0000010 | ||
75 | #define INPCK 0000020 | ||
76 | #define ISTRIP 0000040 | ||
77 | #define INLCR 0000100 | ||
78 | #define IGNCR 0000200 | ||
79 | #define ICRNL 0000400 | ||
80 | #define IUCLC 0001000 | ||
81 | #define IXON 0002000 | ||
82 | #define IXANY 0004000 | ||
83 | #define IXOFF 0010000 | ||
84 | #define IMAXBEL 0020000 | ||
85 | #define IUTF8 0040000 | ||
86 | |||
87 | /* c_oflag bits */ | ||
88 | #define OPOST 0000001 | ||
89 | #define OLCUC 0000002 | ||
90 | #define ONLCR 0000004 | ||
91 | #define OCRNL 0000010 | ||
92 | #define ONOCR 0000020 | ||
93 | #define ONLRET 0000040 | ||
94 | #define OFILL 0000100 | ||
95 | #define OFDEL 0000200 | ||
96 | #define NLDLY 0000400 | ||
97 | #define NL0 0000000 | ||
98 | #define NL1 0000400 | ||
99 | #define CRDLY 0003000 | ||
100 | #define CR0 0000000 | ||
101 | #define CR1 0001000 | ||
102 | #define CR2 0002000 | ||
103 | #define CR3 0003000 | ||
104 | #define TABDLY 0014000 | ||
105 | #define TAB0 0000000 | ||
106 | #define TAB1 0004000 | ||
107 | #define TAB2 0010000 | ||
108 | #define TAB3 0014000 | ||
109 | #define XTABS 0014000 | ||
110 | #define BSDLY 0020000 | ||
111 | #define BS0 0000000 | ||
112 | #define BS1 0020000 | ||
113 | #define VTDLY 0040000 | ||
114 | #define VT0 0000000 | ||
115 | #define VT1 0040000 | ||
116 | #define FFDLY 0100000 | ||
117 | #define FF0 0000000 | ||
118 | #define FF1 0100000 | ||
119 | |||
120 | /* c_cflag bit meaning */ | ||
121 | #define CBAUD 0010017 | ||
122 | #define B0 0000000 /* hang up */ | ||
123 | #define B50 0000001 | ||
124 | #define B75 0000002 | ||
125 | #define B110 0000003 | ||
126 | #define B134 0000004 | ||
127 | #define B150 0000005 | ||
128 | #define B200 0000006 | ||
129 | #define B300 0000007 | ||
130 | #define B600 0000010 | ||
131 | #define B1200 0000011 | ||
132 | #define B1800 0000012 | ||
133 | #define B2400 0000013 | ||
134 | #define B4800 0000014 | ||
135 | #define B9600 0000015 | ||
136 | #define B19200 0000016 | ||
137 | #define B38400 0000017 | ||
138 | #define EXTA B19200 | ||
139 | #define EXTB B38400 | ||
140 | #define CSIZE 0000060 | ||
141 | #define CS5 0000000 | ||
142 | #define CS6 0000020 | ||
143 | #define CS7 0000040 | ||
144 | #define CS8 0000060 | ||
145 | #define CSTOPB 0000100 | ||
146 | #define CREAD 0000200 | ||
147 | #define PARENB 0000400 | ||
148 | #define PARODD 0001000 | ||
149 | #define HUPCL 0002000 | ||
150 | #define CLOCAL 0004000 | ||
151 | #define CBAUDEX 0010000 | ||
152 | #define BOTHER 0010000 | ||
153 | #define B57600 0010001 | ||
154 | #define B115200 0010002 | ||
155 | #define B230400 0010003 | ||
156 | #define B460800 0010004 | ||
157 | #define B500000 0010005 | ||
158 | #define B576000 0010006 | ||
159 | #define B921600 0010007 | ||
160 | #define B1000000 0010010 | ||
161 | #define B1152000 0010011 | ||
162 | #define B1500000 0010012 | ||
163 | #define B2000000 0010013 | ||
164 | #define B2500000 0010014 | ||
165 | #define B3000000 0010015 | ||
166 | #define B3500000 0010016 | ||
167 | #define B4000000 0010017 | ||
168 | #define CIBAUD 002003600000 /* input baud rate */ | ||
169 | #define CMSPAR 010000000000 /* mark or space (stick) parity */ | ||
170 | #define CRTSCTS 020000000000 /* flow control */ | ||
171 | |||
172 | #define IBSHIFT 16 /* Shift from CBAUD to CIBAUD */ | ||
173 | |||
174 | /* c_lflag bits */ | ||
175 | #define ISIG 0000001 | ||
176 | #define ICANON 0000002 | ||
177 | #define XCASE 0000004 | ||
178 | #define ECHO 0000010 | ||
179 | #define ECHOE 0000020 | ||
180 | #define ECHOK 0000040 | ||
181 | #define ECHONL 0000100 | ||
182 | #define NOFLSH 0000200 | ||
183 | #define TOSTOP 0000400 | ||
184 | #define ECHOCTL 0001000 | ||
185 | #define ECHOPRT 0002000 | ||
186 | #define ECHOKE 0004000 | ||
187 | #define FLUSHO 0010000 | ||
188 | #define PENDIN 0040000 | ||
189 | #define IEXTEN 0100000 | ||
190 | #define EXTPROC 0200000 | ||
191 | |||
192 | /* tcflow() and TCXONC use these */ | ||
193 | #define TCOOFF 0 | ||
194 | #define TCOON 1 | ||
195 | #define TCIOFF 2 | ||
196 | #define TCION 3 | ||
197 | |||
198 | /* tcflush() and TCFLSH use these */ | ||
199 | #define TCIFLUSH 0 | ||
200 | #define TCOFLUSH 1 | ||
201 | #define TCIOFLUSH 2 | ||
202 | |||
203 | /* tcsetattr uses these */ | ||
204 | #define TCSANOW 0 | ||
205 | #define TCSADRAIN 1 | ||
206 | #define TCSAFLUSH 2 | ||
207 | |||
208 | #endif /* _ASM_IA64_TERMBITS_H */ | ||
diff --git a/arch/ia64/include/asm/ucontext.h b/arch/ia64/include/asm/ucontext.h new file mode 100644 index 00000000000..bf573dc8ca6 --- /dev/null +++ b/arch/ia64/include/asm/ucontext.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _ASM_IA64_UCONTEXT_H | ||
2 | #define _ASM_IA64_UCONTEXT_H | ||
3 | |||
4 | struct ucontext { | ||
5 | struct sigcontext uc_mcontext; | ||
6 | }; | ||
7 | |||
8 | #define uc_link uc_mcontext.sc_gr[0] /* wrong type; nobody cares */ | ||
9 | #define uc_sigmask uc_mcontext.sc_sigmask | ||
10 | #define uc_stack uc_mcontext.sc_stack | ||
11 | |||
12 | #endif /* _ASM_IA64_UCONTEXT_H */ | ||
diff --git a/arch/ia64/include/asm/xen/grant_table.h b/arch/ia64/include/asm/xen/grant_table.h new file mode 100644 index 00000000000..2b1fae0e2d1 --- /dev/null +++ b/arch/ia64/include/asm/xen/grant_table.h | |||
@@ -0,0 +1,29 @@ | |||
1 | /****************************************************************************** | ||
2 | * arch/ia64/include/asm/xen/grant_table.h | ||
3 | * | ||
4 | * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> | ||
5 | * VA Linux Systems Japan K.K. | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2 of the License, or | ||
10 | * (at your option) any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef _ASM_IA64_XEN_GRANT_TABLE_H | ||
24 | #define _ASM_IA64_XEN_GRANT_TABLE_H | ||
25 | |||
26 | struct vm_struct *xen_alloc_vm_area(unsigned long size); | ||
27 | void xen_free_vm_area(struct vm_struct *area); | ||
28 | |||
29 | #endif /* _ASM_IA64_XEN_GRANT_TABLE_H */ | ||