diff options
Diffstat (limited to 'include/asm-ia64')
-rw-r--r-- | include/asm-ia64/atomic.h | 53 | ||||
-rw-r--r-- | include/asm-ia64/kdebug.h | 27 | ||||
-rw-r--r-- | include/asm-ia64/kexec.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/local.h | 51 | ||||
-rw-r--r-- | include/asm-ia64/pgtable.h | 4 | ||||
-rw-r--r-- | include/asm-ia64/smp.h | 6 | ||||
-rw-r--r-- | include/asm-ia64/thread_info.h | 2 |
7 files changed, 43 insertions, 102 deletions
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/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/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/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/smp.h b/include/asm-ia64/smp.h index 60fd4ae014f6..c60024989ebd 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h | |||
@@ -38,6 +38,8 @@ ia64_get_lid (void) | |||
38 | return lid.f.id << 8 | lid.f.eid; | 38 | return lid.f.id << 8 | lid.f.eid; |
39 | } | 39 | } |
40 | 40 | ||
41 | #define hard_smp_processor_id() ia64_get_lid() | ||
42 | |||
41 | #ifdef CONFIG_SMP | 43 | #ifdef CONFIG_SMP |
42 | 44 | ||
43 | #define XTP_OFFSET 0x1e0008 | 45 | #define XTP_OFFSET 0x1e0008 |
@@ -110,8 +112,6 @@ max_xtp (void) | |||
110 | writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */ | 112 | writeb(0x0f, ipi_base_addr + XTP_OFFSET); /* Set XTP to max */ |
111 | } | 113 | } |
112 | 114 | ||
113 | #define hard_smp_processor_id() ia64_get_lid() | ||
114 | |||
115 | /* Upping and downing of CPUs */ | 115 | /* Upping and downing of CPUs */ |
116 | extern int __cpu_disable (void); | 116 | extern int __cpu_disable (void); |
117 | extern void __cpu_die (unsigned int cpu); | 117 | extern void __cpu_die (unsigned int cpu); |
@@ -128,7 +128,7 @@ extern void unlock_ipi_calllock(void); | |||
128 | extern void identify_siblings (struct cpuinfo_ia64 *); | 128 | extern void identify_siblings (struct cpuinfo_ia64 *); |
129 | extern int is_multithreading_enabled(void); | 129 | extern int is_multithreading_enabled(void); |
130 | 130 | ||
131 | #else | 131 | #else /* CONFIG_SMP */ |
132 | 132 | ||
133 | #define cpu_logical_id(i) 0 | 133 | #define cpu_logical_id(i) 0 |
134 | #define cpu_physical_id(i) ia64_get_lid() | 134 | #define cpu_physical_id(i) ia64_get_lid() |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index 077d6778575a..7d0241db622b 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -112,6 +112,6 @@ struct thread_info { | |||
112 | 112 | ||
113 | #define TS_POLLING 1 /* true if in idle loop and not sleeping */ | 113 | #define TS_POLLING 1 /* true if in idle loop and not sleeping */ |
114 | 114 | ||
115 | #define tsk_is_polling(t) ((t)->thread_info->status & TS_POLLING) | 115 | #define tsk_is_polling(t) (task_thread_info(t)->status & TS_POLLING) |
116 | 116 | ||
117 | #endif /* _ASM_IA64_THREAD_INFO_H */ | 117 | #endif /* _ASM_IA64_THREAD_INFO_H */ |