diff options
Diffstat (limited to 'include/asm-ia64')
-rw-r--r-- | include/asm-ia64/asmmacro.h | 10 | ||||
-rw-r--r-- | include/asm-ia64/atomic.h | 53 | ||||
-rw-r--r-- | include/asm-ia64/io.h | 6 | ||||
-rw-r--r-- | include/asm-ia64/kdebug.h | 27 | ||||
-rw-r--r-- | include/asm-ia64/kexec.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/kregs.h | 3 | ||||
-rw-r--r-- | include/asm-ia64/local.h | 51 | ||||
-rw-r--r-- | include/asm-ia64/mmu_context.h | 1 | ||||
-rw-r--r-- | include/asm-ia64/pal.h | 33 | ||||
-rw-r--r-- | include/asm-ia64/patch.h | 1 | ||||
-rw-r--r-- | include/asm-ia64/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-ia64/processor.h | 1 | ||||
-rw-r--r-- | include/asm-ia64/scatterlist.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/sections.h | 1 |
14 files changed, 90 insertions, 105 deletions
diff --git a/include/asm-ia64/asmmacro.h b/include/asm-ia64/asmmacro.h index c22b4658fc61..c1642fd64029 100644 --- a/include/asm-ia64/asmmacro.h +++ b/include/asm-ia64/asmmacro.h | |||
@@ -104,6 +104,16 @@ name: | |||
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * If physical stack register size is different from DEF_NUM_STACK_REG, | ||
108 | * dynamically patch the kernel for correct size. | ||
109 | */ | ||
110 | .section ".data.patch.phys_stack_reg", "a" | ||
111 | .previous | ||
112 | #define LOAD_PHYS_STACK_REG_SIZE(reg) \ | ||
113 | [1:] adds reg=IA64_NUM_PHYS_STACK_REG*8+8,r0; \ | ||
114 | .xdata4 ".data.patch.phys_stack_reg", 1b-. | ||
115 | |||
116 | /* | ||
107 | * Up until early 2004, use of .align within a function caused bad unwind info. | 117 | * Up until early 2004, use of .align within a function caused bad unwind info. |
108 | * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing | 118 | * TEXT_ALIGN(n) expands into ".align n" if a fixed GAS is available or into nothing |
109 | * otherwise. | 119 | * otherwise. |
diff --git a/include/asm-ia64/atomic.h b/include/asm-ia64/atomic.h index 569ec7574baf..1fc3b83325da 100644 --- a/include/asm-ia64/atomic.h +++ b/include/asm-ia64/atomic.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/types.h> | 15 | #include <linux/types.h> |
16 | 16 | ||
17 | #include <asm/intrinsics.h> | 17 | #include <asm/intrinsics.h> |
18 | #include <asm/system.h> | ||
18 | 19 | ||
19 | /* | 20 | /* |
20 | * On IA-64, counter must always be volatile to ensure that that the | 21 | * On IA-64, counter must always be volatile to ensure that that the |
@@ -88,25 +89,47 @@ ia64_atomic64_sub (__s64 i, atomic64_t *v) | |||
88 | return new; | 89 | return new; |
89 | } | 90 | } |
90 | 91 | ||
91 | #define atomic_cmpxchg(v, old, new) ((int)cmpxchg(&((v)->counter), old, new)) | 92 | #define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), old, new)) |
92 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) | 93 | #define atomic_xchg(v, new) (xchg(&((v)->counter), new)) |
93 | 94 | ||
94 | #define atomic_add_unless(v, a, u) \ | 95 | #define atomic64_cmpxchg(v, old, new) \ |
95 | ({ \ | 96 | (cmpxchg(&((v)->counter), old, new)) |
96 | int c, old; \ | 97 | #define atomic64_xchg(v, new) (xchg(&((v)->counter), new)) |
97 | c = atomic_read(v); \ | 98 | |
98 | for (;;) { \ | 99 | static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) |
99 | if (unlikely(c == (u))) \ | 100 | { |
100 | break; \ | 101 | int c, old; |
101 | old = atomic_cmpxchg((v), c, c + (a)); \ | 102 | c = atomic_read(v); |
102 | if (likely(old == c)) \ | 103 | for (;;) { |
103 | break; \ | 104 | if (unlikely(c == (u))) |
104 | c = old; \ | 105 | break; |
105 | } \ | 106 | old = atomic_cmpxchg((v), c, c + (a)); |
106 | c != (u); \ | 107 | if (likely(old == c)) |
107 | }) | 108 | break; |
109 | c = old; | ||
110 | } | ||
111 | return c != (u); | ||
112 | } | ||
113 | |||
108 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) | 114 | #define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) |
109 | 115 | ||
116 | static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u) | ||
117 | { | ||
118 | long c, old; | ||
119 | c = atomic64_read(v); | ||
120 | for (;;) { | ||
121 | if (unlikely(c == (u))) | ||
122 | break; | ||
123 | old = atomic64_cmpxchg((v), c, c + (a)); | ||
124 | if (likely(old == c)) | ||
125 | break; | ||
126 | c = old; | ||
127 | } | ||
128 | return c != (u); | ||
129 | } | ||
130 | |||
131 | #define atomic64_inc_not_zero(v) atomic64_add_unless((v), 1, 0) | ||
132 | |||
110 | #define atomic_add_return(i,v) \ | 133 | #define atomic_add_return(i,v) \ |
111 | ({ \ | 134 | ({ \ |
112 | int __ia64_aar_i = (i); \ | 135 | int __ia64_aar_i = (i); \ |
diff --git a/include/asm-ia64/io.h b/include/asm-ia64/io.h index 6311e168cd34..eb17a8692967 100644 --- a/include/asm-ia64/io.h +++ b/include/asm-ia64/io.h | |||
@@ -421,11 +421,7 @@ __writeq (unsigned long val, volatile void __iomem *addr) | |||
421 | 421 | ||
422 | extern void __iomem * ioremap(unsigned long offset, unsigned long size); | 422 | extern void __iomem * ioremap(unsigned long offset, unsigned long size); |
423 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); | 423 | extern void __iomem * ioremap_nocache (unsigned long offset, unsigned long size); |
424 | 424 | extern void iounmap (volatile void __iomem *addr); | |
425 | static inline void | ||
426 | iounmap (volatile void __iomem *addr) | ||
427 | { | ||
428 | } | ||
429 | 425 | ||
430 | /* Use normal IO mappings for DMI */ | 426 | /* Use normal IO mappings for DMI */ |
431 | #define dmi_ioremap ioremap | 427 | #define dmi_ioremap ioremap |
diff --git a/include/asm-ia64/kdebug.h b/include/asm-ia64/kdebug.h index aed7142f9e4a..ba211e011a1d 100644 --- a/include/asm-ia64/kdebug.h +++ b/include/asm-ia64/kdebug.h | |||
@@ -28,21 +28,8 @@ | |||
28 | */ | 28 | */ |
29 | #include <linux/notifier.h> | 29 | #include <linux/notifier.h> |
30 | 30 | ||
31 | struct pt_regs; | ||
32 | |||
33 | struct die_args { | ||
34 | struct pt_regs *regs; | ||
35 | const char *str; | ||
36 | long err; | ||
37 | int trapnr; | ||
38 | int signr; | ||
39 | }; | ||
40 | |||
41 | extern int register_die_notifier(struct notifier_block *); | ||
42 | extern int unregister_die_notifier(struct notifier_block *); | ||
43 | extern int register_page_fault_notifier(struct notifier_block *); | 31 | extern int register_page_fault_notifier(struct notifier_block *); |
44 | extern int unregister_page_fault_notifier(struct notifier_block *); | 32 | extern int unregister_page_fault_notifier(struct notifier_block *); |
45 | extern struct atomic_notifier_head ia64die_chain; | ||
46 | 33 | ||
47 | enum die_val { | 34 | enum die_val { |
48 | DIE_BREAK = 1, | 35 | DIE_BREAK = 1, |
@@ -74,18 +61,4 @@ enum die_val { | |||
74 | DIE_KDUMP_LEAVE, | 61 | DIE_KDUMP_LEAVE, |
75 | }; | 62 | }; |
76 | 63 | ||
77 | static inline int notify_die(enum die_val val, char *str, struct pt_regs *regs, | ||
78 | long err, int trap, int sig) | ||
79 | { | ||
80 | struct die_args args = { | ||
81 | .regs = regs, | ||
82 | .str = str, | ||
83 | .err = err, | ||
84 | .trapnr = trap, | ||
85 | .signr = sig | ||
86 | }; | ||
87 | |||
88 | return atomic_notifier_call_chain(&ia64die_chain, val, &args); | ||
89 | } | ||
90 | |||
91 | #endif | 64 | #endif |
diff --git a/include/asm-ia64/kexec.h b/include/asm-ia64/kexec.h index 41299ddfee30..541be835fc5a 100644 --- a/include/asm-ia64/kexec.h +++ b/include/asm-ia64/kexec.h | |||
@@ -14,8 +14,6 @@ | |||
14 | /* The native architecture */ | 14 | /* The native architecture */ |
15 | #define KEXEC_ARCH KEXEC_ARCH_IA_64 | 15 | #define KEXEC_ARCH KEXEC_ARCH_IA_64 |
16 | 16 | ||
17 | #define MAX_NOTE_BYTES 1024 | ||
18 | |||
19 | #define kexec_flush_icache_page(page) do { \ | 17 | #define kexec_flush_icache_page(page) do { \ |
20 | unsigned long page_addr = (unsigned long)page_address(page); \ | 18 | unsigned long page_addr = (unsigned long)page_address(page); \ |
21 | flush_icache_range(page_addr, page_addr + PAGE_SIZE); \ | 19 | flush_icache_range(page_addr, page_addr + PAGE_SIZE); \ |
diff --git a/include/asm-ia64/kregs.h b/include/asm-ia64/kregs.h index 221b5cb564b2..7e55a584975c 100644 --- a/include/asm-ia64/kregs.h +++ b/include/asm-ia64/kregs.h | |||
@@ -29,8 +29,7 @@ | |||
29 | */ | 29 | */ |
30 | #define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code & data) */ | 30 | #define IA64_TR_KERNEL 0 /* itr0, dtr0: maps kernel image (code & data) */ |
31 | #define IA64_TR_PALCODE 1 /* itr1: maps PALcode as required by EFI */ | 31 | #define IA64_TR_PALCODE 1 /* itr1: maps PALcode as required by EFI */ |
32 | #define IA64_TR_PERCPU_DATA 1 /* dtr1: percpu data */ | 32 | #define IA64_TR_CURRENT_STACK 1 /* dtr1: maps kernel's memory- & register-stacks */ |
33 | #define IA64_TR_CURRENT_STACK 2 /* dtr2: maps kernel's memory- & register-stacks */ | ||
34 | 33 | ||
35 | /* Processor status register bits: */ | 34 | /* Processor status register bits: */ |
36 | #define IA64_PSR_BE_BIT 1 | 35 | #define IA64_PSR_BE_BIT 1 |
diff --git a/include/asm-ia64/local.h b/include/asm-ia64/local.h index dc519092ef4d..c11c530f74d0 100644 --- a/include/asm-ia64/local.h +++ b/include/asm-ia64/local.h | |||
@@ -1,50 +1 @@ | |||
1 | #ifndef _ASM_IA64_LOCAL_H | #include <asm-generic/local.h> | |
2 | #define _ASM_IA64_LOCAL_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (C) 2003 Hewlett-Packard Co | ||
6 | * David Mosberger-Tang <davidm@hpl.hp.com> | ||
7 | */ | ||
8 | |||
9 | #include <linux/percpu.h> | ||
10 | |||
11 | typedef struct { | ||
12 | atomic64_t val; | ||
13 | } local_t; | ||
14 | |||
15 | #define LOCAL_INIT(i) ((local_t) { { (i) } }) | ||
16 | #define local_read(l) atomic64_read(&(l)->val) | ||
17 | #define local_set(l, i) atomic64_set(&(l)->val, i) | ||
18 | #define local_inc(l) atomic64_inc(&(l)->val) | ||
19 | #define local_dec(l) atomic64_dec(&(l)->val) | ||
20 | #define local_add(i, l) atomic64_add((i), &(l)->val) | ||
21 | #define local_sub(i, l) atomic64_sub((i), &(l)->val) | ||
22 | |||
23 | /* Non-atomic variants, i.e., preemption disabled and won't be touched in interrupt, etc. */ | ||
24 | |||
25 | #define __local_inc(l) (++(l)->val.counter) | ||
26 | #define __local_dec(l) (--(l)->val.counter) | ||
27 | #define __local_add(i,l) ((l)->val.counter += (i)) | ||
28 | #define __local_sub(i,l) ((l)->val.counter -= (i)) | ||
29 | |||
30 | /* | ||
31 | * Use these for per-cpu local_t variables. Note they take a variable (eg. mystruct.foo), | ||
32 | * not an address. | ||
33 | */ | ||
34 | #define cpu_local_read(v) local_read(&__ia64_per_cpu_var(v)) | ||
35 | #define cpu_local_set(v, i) local_set(&__ia64_per_cpu_var(v), (i)) | ||
36 | #define cpu_local_inc(v) local_inc(&__ia64_per_cpu_var(v)) | ||
37 | #define cpu_local_dec(v) local_dec(&__ia64_per_cpu_var(v)) | ||
38 | #define cpu_local_add(i, v) local_add((i), &__ia64_per_cpu_var(v)) | ||
39 | #define cpu_local_sub(i, v) local_sub((i), &__ia64_per_cpu_var(v)) | ||
40 | |||
41 | /* | ||
42 | * Non-atomic increments, i.e., preemption disabled and won't be touched in interrupt, | ||
43 | * etc. | ||
44 | */ | ||
45 | #define __cpu_local_inc(v) __local_inc(&__ia64_per_cpu_var(v)) | ||
46 | #define __cpu_local_dec(v) __local_dec(&__ia64_per_cpu_var(v)) | ||
47 | #define __cpu_local_add(i, v) __local_add((i), &__ia64_per_cpu_var(v)) | ||
48 | #define __cpu_local_sub(i, v) __local_sub((i), &__ia64_per_cpu_var(v)) | ||
49 | |||
50 | #endif /* _ASM_IA64_LOCAL_H */ | ||
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h index b5c65081a3aa..cef2400983fa 100644 --- a/include/asm-ia64/mmu_context.h +++ b/include/asm-ia64/mmu_context.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <linux/spinlock.h> | 29 | #include <linux/spinlock.h> |
30 | 30 | ||
31 | #include <asm/processor.h> | 31 | #include <asm/processor.h> |
32 | #include <asm-generic/mm_hooks.h> | ||
32 | 33 | ||
33 | struct ia64_ctx { | 34 | struct ia64_ctx { |
34 | spinlock_t lock; | 35 | spinlock_t lock; |
diff --git a/include/asm-ia64/pal.h b/include/asm-ia64/pal.h index 67656ce767c2..abfcb3a2588f 100644 --- a/include/asm-ia64/pal.h +++ b/include/asm-ia64/pal.h | |||
@@ -89,6 +89,8 @@ | |||
89 | #define PAL_GET_PSTATE_TYPE_AVGNORESET 2 | 89 | #define PAL_GET_PSTATE_TYPE_AVGNORESET 2 |
90 | #define PAL_GET_PSTATE_TYPE_INSTANT 3 | 90 | #define PAL_GET_PSTATE_TYPE_INSTANT 3 |
91 | 91 | ||
92 | #define PAL_MC_ERROR_INJECT 276 /* Injects processor error or returns injection capabilities */ | ||
93 | |||
92 | #ifndef __ASSEMBLY__ | 94 | #ifndef __ASSEMBLY__ |
93 | 95 | ||
94 | #include <linux/types.h> | 96 | #include <linux/types.h> |
@@ -1235,6 +1237,37 @@ ia64_pal_mc_error_info (u64 info_index, u64 type_index, u64 *size, u64 *error_in | |||
1235 | return iprv.status; | 1237 | return iprv.status; |
1236 | } | 1238 | } |
1237 | 1239 | ||
1240 | /* Injects the requested processor error or returns info on | ||
1241 | * supported injection capabilities for current processor implementation | ||
1242 | */ | ||
1243 | static inline s64 | ||
1244 | ia64_pal_mc_error_inject_phys (u64 err_type_info, u64 err_struct_info, | ||
1245 | u64 err_data_buffer, u64 *capabilities, u64 *resources) | ||
1246 | { | ||
1247 | struct ia64_pal_retval iprv; | ||
1248 | PAL_CALL_PHYS_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info, | ||
1249 | err_struct_info, err_data_buffer); | ||
1250 | if (capabilities) | ||
1251 | *capabilities= iprv.v0; | ||
1252 | if (resources) | ||
1253 | *resources= iprv.v1; | ||
1254 | return iprv.status; | ||
1255 | } | ||
1256 | |||
1257 | static inline s64 | ||
1258 | ia64_pal_mc_error_inject_virt (u64 err_type_info, u64 err_struct_info, | ||
1259 | u64 err_data_buffer, u64 *capabilities, u64 *resources) | ||
1260 | { | ||
1261 | struct ia64_pal_retval iprv; | ||
1262 | PAL_CALL_STK(iprv, PAL_MC_ERROR_INJECT, err_type_info, | ||
1263 | err_struct_info, err_data_buffer); | ||
1264 | if (capabilities) | ||
1265 | *capabilities= iprv.v0; | ||
1266 | if (resources) | ||
1267 | *resources= iprv.v1; | ||
1268 | return iprv.status; | ||
1269 | } | ||
1270 | |||
1238 | /* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot | 1271 | /* Inform PALE_CHECK whether a machine check is expected so that PALE_CHECK willnot |
1239 | * attempt to correct any expected machine checks. | 1272 | * attempt to correct any expected machine checks. |
1240 | */ | 1273 | */ |
diff --git a/include/asm-ia64/patch.h b/include/asm-ia64/patch.h index 4797f3535e6d..a71543084fb4 100644 --- a/include/asm-ia64/patch.h +++ b/include/asm-ia64/patch.h | |||
@@ -20,6 +20,7 @@ extern void ia64_patch_imm60 (u64 insn_addr, u64 val); /* patch "brl" w/ip-rel | |||
20 | 20 | ||
21 | extern void ia64_patch_mckinley_e9 (unsigned long start, unsigned long end); | 21 | extern void ia64_patch_mckinley_e9 (unsigned long start, unsigned long end); |
22 | extern void ia64_patch_vtop (unsigned long start, unsigned long end); | 22 | extern void ia64_patch_vtop (unsigned long start, unsigned long end); |
23 | extern void ia64_patch_phys_stack_reg(unsigned long val); | ||
23 | extern void ia64_patch_gate (void); | 24 | extern void ia64_patch_gate (void); |
24 | 25 | ||
25 | #endif /* _ASM_IA64_PATCH_H */ | 26 | #endif /* _ASM_IA64_PATCH_H */ |
diff --git a/include/asm-ia64/pgtable.h b/include/asm-ia64/pgtable.h index 553182747722..670b706411b8 100644 --- a/include/asm-ia64/pgtable.h +++ b/include/asm-ia64/pgtable.h | |||
@@ -485,10 +485,6 @@ extern void paging_init (void); | |||
485 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ | 485 | #define io_remap_pfn_range(vma, vaddr, pfn, size, prot) \ |
486 | remap_pfn_range(vma, vaddr, pfn, size, prot) | 486 | remap_pfn_range(vma, vaddr, pfn, size, prot) |
487 | 487 | ||
488 | #define MK_IOSPACE_PFN(space, pfn) (pfn) | ||
489 | #define GET_IOSPACE(pfn) 0 | ||
490 | #define GET_PFN(pfn) (pfn) | ||
491 | |||
492 | /* | 488 | /* |
493 | * ZERO_PAGE is a global shared page that is always zero: used | 489 | * ZERO_PAGE is a global shared page that is always zero: used |
494 | * for zero-mapped memory areas etc.. | 490 | * for zero-mapped memory areas etc.. |
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h index 4f4ee1c2db2f..db81ba406cef 100644 --- a/include/asm-ia64/processor.h +++ b/include/asm-ia64/processor.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <asm/ptrace.h> | 19 | #include <asm/ptrace.h> |
20 | #include <asm/ustack.h> | 20 | #include <asm/ustack.h> |
21 | 21 | ||
22 | #define IA64_NUM_PHYS_STACK_REG 96 | ||
22 | #define IA64_NUM_DBG_REGS 8 | 23 | #define IA64_NUM_DBG_REGS 8 |
23 | 24 | ||
24 | #define DEFAULT_MAP_BASE __IA64_UL_CONST(0x2000000000000000) | 25 | #define DEFAULT_MAP_BASE __IA64_UL_CONST(0x2000000000000000) |
diff --git a/include/asm-ia64/scatterlist.h b/include/asm-ia64/scatterlist.h index 9dbea8844d5e..a452ea24205a 100644 --- a/include/asm-ia64/scatterlist.h +++ b/include/asm-ia64/scatterlist.h | |||
@@ -6,6 +6,8 @@ | |||
6 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co | 6 | * David Mosberger-Tang <davidm@hpl.hp.com>, Hewlett-Packard Co |
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include <asm/types.h> | ||
10 | |||
9 | struct scatterlist { | 11 | struct scatterlist { |
10 | struct page *page; | 12 | struct page *page; |
11 | unsigned int offset; | 13 | unsigned int offset; |
diff --git a/include/asm-ia64/sections.h b/include/asm-ia64/sections.h index e9eb7f62d32b..dc42a359894f 100644 --- a/include/asm-ia64/sections.h +++ b/include/asm-ia64/sections.h | |||
@@ -11,6 +11,7 @@ | |||
11 | extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; | 11 | extern char __per_cpu_start[], __per_cpu_end[], __phys_per_cpu_start[]; |
12 | extern char __start___vtop_patchlist[], __end___vtop_patchlist[]; | 12 | extern char __start___vtop_patchlist[], __end___vtop_patchlist[]; |
13 | extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[]; | 13 | extern char __start___mckinley_e9_bundles[], __end___mckinley_e9_bundles[]; |
14 | extern char __start___phys_stack_reg_patchlist[], __end___phys_stack_reg_patchlist[]; | ||
14 | extern char __start_gate_section[]; | 15 | extern char __start_gate_section[]; |
15 | extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[]; | 16 | extern char __start_gate_mckinley_e9_patchlist[], __end_gate_mckinley_e9_patchlist[]; |
16 | extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; | 17 | extern char __start_gate_vtop_patchlist[], __end_gate_vtop_patchlist[]; |