aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-ia64
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-ia64')
-rw-r--r--include/asm-ia64/bitops.h50
-rw-r--r--include/asm-ia64/gcc_intrin.h2
-rw-r--r--include/asm-ia64/mca.h6
-rw-r--r--include/asm-ia64/mca_asm.h3
-rw-r--r--include/asm-ia64/pgalloc.h16
-rw-r--r--include/asm-ia64/processor.h5
-rw-r--r--include/asm-ia64/sal.h14
7 files changed, 49 insertions, 47 deletions
diff --git a/include/asm-ia64/bitops.h b/include/asm-ia64/bitops.h
index a1b9719f5fbb..953d3df9dd22 100644
--- a/include/asm-ia64/bitops.h
+++ b/include/asm-ia64/bitops.h
@@ -122,38 +122,40 @@ clear_bit_unlock (int nr, volatile void *addr)
122} 122}
123 123
124/** 124/**
125 * __clear_bit_unlock - Non-atomically clear a bit with release 125 * __clear_bit_unlock - Non-atomically clears a bit in memory with release
126 * @nr: Bit to clear
127 * @addr: Address to start counting from
126 * 128 *
127 * This is like clear_bit_unlock, but the implementation uses a store 129 * Similarly to clear_bit_unlock, the implementation uses a store
128 * with release semantics. See also __raw_spin_unlock(). 130 * with release semantics. See also __raw_spin_unlock().
129 */ 131 */
130static __inline__ void 132static __inline__ void
131__clear_bit_unlock(int nr, volatile void *addr) 133__clear_bit_unlock(int nr, void *addr)
132{ 134{
133 __u32 mask, new; 135 __u32 * const m = (__u32 *) addr + (nr >> 5);
134 volatile __u32 *m; 136 __u32 const new = *m & ~(1 << (nr & 31));
135 137
136 m = (volatile __u32 *)addr + (nr >> 5);
137 mask = ~(1 << (nr & 31));
138 new = *m & mask;
139 barrier();
140 ia64_st4_rel_nta(m, new); 138 ia64_st4_rel_nta(m, new);
141} 139}
142 140
143/** 141/**
144 * __clear_bit - Clears a bit in memory (non-atomic version) 142 * __clear_bit - Clears a bit in memory (non-atomic version)
143 * @nr: the bit to clear
144 * @addr: the address to start counting from
145 *
146 * Unlike clear_bit(), this function is non-atomic and may be reordered.
147 * If it's called on the same region of memory simultaneously, the effect
148 * may be that only one operation succeeds.
145 */ 149 */
146static __inline__ void 150static __inline__ void
147__clear_bit (int nr, volatile void *addr) 151__clear_bit (int nr, volatile void *addr)
148{ 152{
149 volatile __u32 *p = (__u32 *) addr + (nr >> 5); 153 *((__u32 *) addr + (nr >> 5)) &= ~(1 << (nr & 31));
150 __u32 m = 1 << (nr & 31);
151 *p &= ~m;
152} 154}
153 155
154/** 156/**
155 * change_bit - Toggle a bit in memory 157 * change_bit - Toggle a bit in memory
156 * @nr: Bit to clear 158 * @nr: Bit to toggle
157 * @addr: Address to start counting from 159 * @addr: Address to start counting from
158 * 160 *
159 * change_bit() is atomic and may not be reordered. 161 * change_bit() is atomic and may not be reordered.
@@ -178,7 +180,7 @@ change_bit (int nr, volatile void *addr)
178 180
179/** 181/**
180 * __change_bit - Toggle a bit in memory 182 * __change_bit - Toggle a bit in memory
181 * @nr: the bit to set 183 * @nr: the bit to toggle
182 * @addr: the address to start counting from 184 * @addr: the address to start counting from
183 * 185 *
184 * Unlike change_bit(), this function is non-atomic and may be reordered. 186 * Unlike change_bit(), this function is non-atomic and may be reordered.
@@ -197,7 +199,7 @@ __change_bit (int nr, volatile void *addr)
197 * @addr: Address to count from 199 * @addr: Address to count from
198 * 200 *
199 * This operation is atomic and cannot be reordered. 201 * This operation is atomic and cannot be reordered.
200 * It also implies a memory barrier. 202 * It also implies the acquisition side of the memory barrier.
201 */ 203 */
202static __inline__ int 204static __inline__ int
203test_and_set_bit (int nr, volatile void *addr) 205test_and_set_bit (int nr, volatile void *addr)
@@ -247,11 +249,11 @@ __test_and_set_bit (int nr, volatile void *addr)
247 249
248/** 250/**
249 * test_and_clear_bit - Clear a bit and return its old value 251 * test_and_clear_bit - Clear a bit and return its old value
250 * @nr: Bit to set 252 * @nr: Bit to clear
251 * @addr: Address to count from 253 * @addr: Address to count from
252 * 254 *
253 * This operation is atomic and cannot be reordered. 255 * This operation is atomic and cannot be reordered.
254 * It also implies a memory barrier. 256 * It also implies the acquisition side of the memory barrier.
255 */ 257 */
256static __inline__ int 258static __inline__ int
257test_and_clear_bit (int nr, volatile void *addr) 259test_and_clear_bit (int nr, volatile void *addr)
@@ -272,7 +274,7 @@ test_and_clear_bit (int nr, volatile void *addr)
272 274
273/** 275/**
274 * __test_and_clear_bit - Clear a bit and return its old value 276 * __test_and_clear_bit - Clear a bit and return its old value
275 * @nr: Bit to set 277 * @nr: Bit to clear
276 * @addr: Address to count from 278 * @addr: Address to count from
277 * 279 *
278 * This operation is non-atomic and can be reordered. 280 * This operation is non-atomic and can be reordered.
@@ -292,11 +294,11 @@ __test_and_clear_bit(int nr, volatile void * addr)
292 294
293/** 295/**
294 * test_and_change_bit - Change a bit and return its old value 296 * test_and_change_bit - Change a bit and return its old value
295 * @nr: Bit to set 297 * @nr: Bit to change
296 * @addr: Address to count from 298 * @addr: Address to count from
297 * 299 *
298 * This operation is atomic and cannot be reordered. 300 * This operation is atomic and cannot be reordered.
299 * It also implies a memory barrier. 301 * It also implies the acquisition side of the memory barrier.
300 */ 302 */
301static __inline__ int 303static __inline__ int
302test_and_change_bit (int nr, volatile void *addr) 304test_and_change_bit (int nr, volatile void *addr)
@@ -315,8 +317,12 @@ test_and_change_bit (int nr, volatile void *addr)
315 return (old & bit) != 0; 317 return (old & bit) != 0;
316} 318}
317 319
318/* 320/**
319 * WARNING: non atomic version. 321 * __test_and_change_bit - Change a bit and return its old value
322 * @nr: Bit to change
323 * @addr: Address to count from
324 *
325 * This operation is non-atomic and can be reordered.
320 */ 326 */
321static __inline__ int 327static __inline__ int
322__test_and_change_bit (int nr, void *addr) 328__test_and_change_bit (int nr, void *addr)
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h
index 5b6665c754c9..de2ed2cbdd84 100644
--- a/include/asm-ia64/gcc_intrin.h
+++ b/include/asm-ia64/gcc_intrin.h
@@ -24,7 +24,9 @@
24extern void ia64_bad_param_for_setreg (void); 24extern void ia64_bad_param_for_setreg (void);
25extern void ia64_bad_param_for_getreg (void); 25extern void ia64_bad_param_for_getreg (void);
26 26
27#ifdef __KERNEL__
27register unsigned long ia64_r13 asm ("r13") __used; 28register unsigned long ia64_r13 asm ("r13") __used;
29#endif
28 30
29#define ia64_setreg(regnum, val) \ 31#define ia64_setreg(regnum, val) \
30({ \ 32({ \
diff --git a/include/asm-ia64/mca.h b/include/asm-ia64/mca.h
index 823553bf12e6..f1663aa94a52 100644
--- a/include/asm-ia64/mca.h
+++ b/include/asm-ia64/mca.h
@@ -3,9 +3,9 @@
3 * Purpose: Machine check handling specific defines 3 * Purpose: Machine check handling specific defines
4 * 4 *
5 * Copyright (C) 1999, 2004 Silicon Graphics, Inc. 5 * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
6 * Copyright (C) Vijay Chander (vijay@engr.sgi.com) 6 * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
7 * Copyright (C) Srinivasa Thirumalachar (sprasad@engr.sgi.com) 7 * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
8 * Copyright (C) Russ Anderson (rja@sgi.com) 8 * Copyright (C) Russ Anderson <rja@sgi.com>
9 */ 9 */
10 10
11#ifndef _ASM_IA64_MCA_H 11#ifndef _ASM_IA64_MCA_H
diff --git a/include/asm-ia64/mca_asm.h b/include/asm-ia64/mca_asm.h
index 76203f9a8718..dd2a5b134390 100644
--- a/include/asm-ia64/mca_asm.h
+++ b/include/asm-ia64/mca_asm.h
@@ -1,8 +1,9 @@
1/* 1/*
2 * File: mca_asm.h 2 * File: mca_asm.h
3 * Purpose: Machine check handling specific defines
3 * 4 *
4 * Copyright (C) 1999 Silicon Graphics, Inc. 5 * Copyright (C) 1999 Silicon Graphics, Inc.
5 * Copyright (C) Vijay Chander (vijay@engr.sgi.com) 6 * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
6 * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com> 7 * Copyright (C) Srinivasa Thirumalachar <sprasad@engr.sgi.com>
7 * Copyright (C) 2000 Hewlett-Packard Co. 8 * Copyright (C) 2000 Hewlett-Packard Co.
8 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com> 9 * Copyright (C) 2000 David Mosberger-Tang <davidm@hpl.hp.com>
diff --git a/include/asm-ia64/pgalloc.h b/include/asm-ia64/pgalloc.h
index 67552cad5173..556d988123ac 100644
--- a/include/asm-ia64/pgalloc.h
+++ b/include/asm-ia64/pgalloc.h
@@ -27,7 +27,7 @@ static inline pgd_t *pgd_alloc(struct mm_struct *mm)
27 return quicklist_alloc(0, GFP_KERNEL, NULL); 27 return quicklist_alloc(0, GFP_KERNEL, NULL);
28} 28}
29 29
30static inline void pgd_free(pgd_t * pgd) 30static inline void pgd_free(struct mm_struct *mm, pgd_t *pgd)
31{ 31{
32 quicklist_free(0, NULL, pgd); 32 quicklist_free(0, NULL, pgd);
33} 33}
@@ -44,11 +44,11 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long addr)
44 return quicklist_alloc(0, GFP_KERNEL, NULL); 44 return quicklist_alloc(0, GFP_KERNEL, NULL);
45} 45}
46 46
47static inline void pud_free(pud_t * pud) 47static inline void pud_free(struct mm_struct *mm, pud_t *pud)
48{ 48{
49 quicklist_free(0, NULL, pud); 49 quicklist_free(0, NULL, pud);
50} 50}
51#define __pud_free_tlb(tlb, pud) pud_free(pud) 51#define __pud_free_tlb(tlb, pud) pud_free((tlb)->mm, pud)
52#endif /* CONFIG_PGTABLE_4 */ 52#endif /* CONFIG_PGTABLE_4 */
53 53
54static inline void 54static inline void
@@ -62,12 +62,12 @@ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long addr)
62 return quicklist_alloc(0, GFP_KERNEL, NULL); 62 return quicklist_alloc(0, GFP_KERNEL, NULL);
63} 63}
64 64
65static inline void pmd_free(pmd_t * pmd) 65static inline void pmd_free(struct mm_struct *mm, pmd_t *pmd)
66{ 66{
67 quicklist_free(0, NULL, pmd); 67 quicklist_free(0, NULL, pmd);
68} 68}
69 69
70#define __pmd_free_tlb(tlb, pmd) pmd_free(pmd) 70#define __pmd_free_tlb(tlb, pmd) pmd_free((tlb)->mm, pmd)
71 71
72static inline void 72static inline void
73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte) 73pmd_populate(struct mm_struct *mm, pmd_t * pmd_entry, struct page *pte)
@@ -94,12 +94,12 @@ static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm,
94 return quicklist_alloc(0, GFP_KERNEL, NULL); 94 return quicklist_alloc(0, GFP_KERNEL, NULL);
95} 95}
96 96
97static inline void pte_free(struct page *pte) 97static inline void pte_free(struct mm_struct *mm, struct page *pte)
98{ 98{
99 quicklist_free_page(0, NULL, pte); 99 quicklist_free_page(0, NULL, pte);
100} 100}
101 101
102static inline void pte_free_kernel(pte_t * pte) 102static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
103{ 103{
104 quicklist_free(0, NULL, pte); 104 quicklist_free(0, NULL, pte);
105} 105}
@@ -109,6 +109,6 @@ static inline void check_pgt_cache(void)
109 quicklist_trim(0, NULL, 25, 16); 109 quicklist_trim(0, NULL, 25, 16);
110} 110}
111 111
112#define __pte_free_tlb(tlb, pte) pte_free(pte) 112#define __pte_free_tlb(tlb, pte) pte_free((tlb)->mm, pte)
113 113
114#endif /* _ASM_IA64_PGALLOC_H */ 114#endif /* _ASM_IA64_PGALLOC_H */
diff --git a/include/asm-ia64/processor.h b/include/asm-ia64/processor.h
index be3b0ae43270..741f7ecb986a 100644
--- a/include/asm-ia64/processor.h
+++ b/include/asm-ia64/processor.h
@@ -31,7 +31,8 @@
31 * each (assuming 8KB page size), for a total of 8TB of user virtual 31 * each (assuming 8KB page size), for a total of 8TB of user virtual
32 * address space. 32 * address space.
33 */ 33 */
34#define TASK_SIZE (current->thread.task_size) 34#define TASK_SIZE_OF(tsk) ((tsk)->thread.task_size)
35#define TASK_SIZE TASK_SIZE_OF(current)
35 36
36/* 37/*
37 * This decides where the kernel will search for a free chunk of vm 38 * This decides where the kernel will search for a free chunk of vm
@@ -472,7 +473,7 @@ ia64_set_psr (__u64 psr)
472{ 473{
473 ia64_stop(); 474 ia64_stop();
474 ia64_setreg(_IA64_REG_PSR_L, psr); 475 ia64_setreg(_IA64_REG_PSR_L, psr);
475 ia64_srlz_d(); 476 ia64_srlz_i();
476} 477}
477 478
478/* 479/*
diff --git a/include/asm-ia64/sal.h b/include/asm-ia64/sal.h
index 1f5412d6f9bb..2251118894ae 100644
--- a/include/asm-ia64/sal.h
+++ b/include/asm-ia64/sal.h
@@ -649,17 +649,6 @@ typedef struct err_rec {
649 * Now define a couple of inline functions for improved type checking 649 * Now define a couple of inline functions for improved type checking
650 * and convenience. 650 * and convenience.
651 */ 651 */
652static inline long
653ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
654 unsigned long *drift_info)
655{
656 struct ia64_sal_retval isrv;
657
658 SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0);
659 *ticks_per_second = isrv.v0;
660 *drift_info = isrv.v1;
661 return isrv.status;
662}
663 652
664extern s64 ia64_sal_cache_flush (u64 cache_type); 653extern s64 ia64_sal_cache_flush (u64 cache_type);
665extern void __init check_sal_cache_flush (void); 654extern void __init check_sal_cache_flush (void);
@@ -841,6 +830,9 @@ extern int ia64_sal_oemcall_nolock(struct ia64_sal_retval *, u64, u64, u64,
841 u64, u64, u64, u64, u64); 830 u64, u64, u64, u64, u64);
842extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64, 831extern int ia64_sal_oemcall_reentrant(struct ia64_sal_retval *, u64, u64, u64,
843 u64, u64, u64, u64, u64); 832 u64, u64, u64, u64, u64);
833extern long
834ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
835 unsigned long *drift_info);
844#ifdef CONFIG_HOTPLUG_CPU 836#ifdef CONFIG_HOTPLUG_CPU
845/* 837/*
846 * System Abstraction Layer Specification 838 * System Abstraction Layer Specification