aboutsummaryrefslogtreecommitdiffstats
path: root/include/asm-parisc
diff options
context:
space:
mode:
Diffstat (limited to 'include/asm-parisc')
-rw-r--r--include/asm-parisc/atomic.h84
-rw-r--r--include/asm-parisc/cacheflush.h6
-rw-r--r--include/asm-parisc/compat_ucontext.h3
-rw-r--r--include/asm-parisc/grfioctl.h2
-rw-r--r--include/asm-parisc/pci.h17
-rw-r--r--include/asm-parisc/pgalloc.h1
-rw-r--r--include/asm-parisc/pgtable.h2
-rw-r--r--include/asm-parisc/rt_sigframe.h4
-rw-r--r--include/asm-parisc/unistd.h21
9 files changed, 111 insertions, 29 deletions
diff --git a/include/asm-parisc/atomic.h b/include/asm-parisc/atomic.h
index 2ca56d34aaad..4dc7253ff5d0 100644
--- a/include/asm-parisc/atomic.h
+++ b/include/asm-parisc/atomic.h
@@ -1,9 +1,13 @@
1/* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>
2 * Copyright (C) 2006 Kyle McMartin <kyle@parisc-linux.org>
3 */
4
1#ifndef _ASM_PARISC_ATOMIC_H_ 5#ifndef _ASM_PARISC_ATOMIC_H_
2#define _ASM_PARISC_ATOMIC_H_ 6#define _ASM_PARISC_ATOMIC_H_
3 7
4#include <linux/config.h> 8#include <linux/config.h>
9#include <linux/types.h>
5#include <asm/system.h> 10#include <asm/system.h>
6/* Copyright (C) 2000 Philipp Rumpf <prumpf@tux.org>. */
7 11
8/* 12/*
9 * Atomic operations that C can't guarantee us. Useful for 13 * Atomic operations that C can't guarantee us. Useful for
@@ -46,15 +50,6 @@ extern raw_spinlock_t __atomic_hash[ATOMIC_HASH_SIZE] __lock_aligned;
46# define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0) 50# define _atomic_spin_unlock_irqrestore(l,f) do { local_irq_restore(f); } while (0)
47#endif 51#endif
48 52
49/* Note that we need not lock read accesses - aligned word writes/reads
50 * are atomic, so a reader never sees unconsistent values.
51 *
52 * Cache-line alignment would conflict with, for example, linux/module.h
53 */
54
55typedef struct { volatile int counter; } atomic_t;
56
57
58/* This should get optimized out since it's never called. 53/* This should get optimized out since it's never called.
59** Or get a link error if xchg is used "wrong". 54** Or get a link error if xchg is used "wrong".
60*/ 55*/
@@ -69,10 +64,9 @@ extern unsigned long __xchg64(unsigned long, unsigned long *);
69#endif 64#endif
70 65
71/* optimizer better get rid of switch since size is a constant */ 66/* optimizer better get rid of switch since size is a constant */
72static __inline__ unsigned long __xchg(unsigned long x, __volatile__ void * ptr, 67static __inline__ unsigned long
73 int size) 68__xchg(unsigned long x, __volatile__ void * ptr, int size)
74{ 69{
75
76 switch(size) { 70 switch(size) {
77#ifdef __LP64__ 71#ifdef __LP64__
78 case 8: return __xchg64(x,(unsigned long *) ptr); 72 case 8: return __xchg64(x,(unsigned long *) ptr);
@@ -129,7 +123,13 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size)
129 (unsigned long)_n_, sizeof(*(ptr))); \ 123 (unsigned long)_n_, sizeof(*(ptr))); \
130 }) 124 })
131 125
126/* Note that we need not lock read accesses - aligned word writes/reads
127 * are atomic, so a reader never sees unconsistent values.
128 *
129 * Cache-line alignment would conflict with, for example, linux/module.h
130 */
132 131
132typedef struct { volatile int counter; } atomic_t;
133 133
134/* It's possible to reduce all atomic operations to either 134/* It's possible to reduce all atomic operations to either
135 * __atomic_add_return, atomic_set and atomic_read (the latter 135 * __atomic_add_return, atomic_set and atomic_read (the latter
@@ -210,12 +210,66 @@ static __inline__ int atomic_read(const atomic_t *v)
210 210
211#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0) 211#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
212 212
213#define ATOMIC_INIT(i) { (i) } 213#define ATOMIC_INIT(i) ((atomic_t) { (i) })
214 214
215#define smp_mb__before_atomic_dec() smp_mb() 215#define smp_mb__before_atomic_dec() smp_mb()
216#define smp_mb__after_atomic_dec() smp_mb() 216#define smp_mb__after_atomic_dec() smp_mb()
217#define smp_mb__before_atomic_inc() smp_mb() 217#define smp_mb__before_atomic_inc() smp_mb()
218#define smp_mb__after_atomic_inc() smp_mb() 218#define smp_mb__after_atomic_inc() smp_mb()
219 219
220#ifdef __LP64__
221
222typedef struct { volatile s64 counter; } atomic64_t;
223
224#define ATOMIC64_INIT(i) ((atomic64_t) { (i) })
225
226static __inline__ int
227__atomic64_add_return(s64 i, atomic64_t *v)
228{
229 int ret;
230 unsigned long flags;
231 _atomic_spin_lock_irqsave(v, flags);
232
233 ret = (v->counter += i);
234
235 _atomic_spin_unlock_irqrestore(v, flags);
236 return ret;
237}
238
239static __inline__ void
240atomic64_set(atomic64_t *v, s64 i)
241{
242 unsigned long flags;
243 _atomic_spin_lock_irqsave(v, flags);
244
245 v->counter = i;
246
247 _atomic_spin_unlock_irqrestore(v, flags);
248}
249
250static __inline__ s64
251atomic64_read(const atomic64_t *v)
252{
253 return v->counter;
254}
255
256#define atomic64_add(i,v) ((void)(__atomic64_add_return( ((s64)i),(v))))
257#define atomic64_sub(i,v) ((void)(__atomic64_add_return(-((s64)i),(v))))
258#define atomic64_inc(v) ((void)(__atomic64_add_return( 1,(v))))
259#define atomic64_dec(v) ((void)(__atomic64_add_return( -1,(v))))
260
261#define atomic64_add_return(i,v) (__atomic64_add_return( ((s64)i),(v)))
262#define atomic64_sub_return(i,v) (__atomic64_add_return(-((s64)i),(v)))
263#define atomic64_inc_return(v) (__atomic64_add_return( 1,(v)))
264#define atomic64_dec_return(v) (__atomic64_add_return( -1,(v)))
265
266#define atomic64_add_negative(a, v) (atomic64_add_return((a), (v)) < 0)
267
268#define atomic64_inc_and_test(v) (atomic64_inc_return(v) == 0)
269#define atomic64_dec_and_test(v) (atomic64_dec_return(v) == 0)
270
271#endif /* __LP64__ */
272
220#include <asm-generic/atomic.h> 273#include <asm-generic/atomic.h>
221#endif 274
275#endif /* _ASM_PARISC_ATOMIC_H_ */
diff --git a/include/asm-parisc/cacheflush.h b/include/asm-parisc/cacheflush.h
index 1bc3c83ee74b..c53af9ff41b5 100644
--- a/include/asm-parisc/cacheflush.h
+++ b/include/asm-parisc/cacheflush.h
@@ -183,4 +183,10 @@ flush_cache_page(struct vm_area_struct *vma, unsigned long vmaddr, unsigned long
183 __flush_cache_page(vma, vmaddr); 183 __flush_cache_page(vma, vmaddr);
184 184
185} 185}
186
187#ifdef CONFIG_DEBUG_RODATA
188void mark_rodata_ro(void);
186#endif 189#endif
190
191#endif /* _PARISC_CACHEFLUSH_H */
192
diff --git a/include/asm-parisc/compat_ucontext.h b/include/asm-parisc/compat_ucontext.h
index a1228a3d2071..2f7292afde3c 100644
--- a/include/asm-parisc/compat_ucontext.h
+++ b/include/asm-parisc/compat_ucontext.h
@@ -1,8 +1,7 @@
1#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H 1#ifndef _ASM_PARISC_COMPAT_UCONTEXT_H
2#define _ASM_PARISC_COMPAT_UCONTEXT_H 2#define _ASM_PARISC_COMPAT_UCONTEXT_H
3 3
4#include<linux/compat.h> 4#include <linux/compat.h>
5#include<asm/compat_signal.h>
6 5
7/* 32-bit ucontext as seen from an 64-bit kernel */ 6/* 32-bit ucontext as seen from an 64-bit kernel */
8struct compat_ucontext { 7struct compat_ucontext {
diff --git a/include/asm-parisc/grfioctl.h b/include/asm-parisc/grfioctl.h
index 6a910311b56b..671e06042b40 100644
--- a/include/asm-parisc/grfioctl.h
+++ b/include/asm-parisc/grfioctl.h
@@ -58,7 +58,7 @@
58#define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */ 58#define CRT_ID_ELK_1024DB 0x27849CA5 /* Elk 1024x768 double buffer */
59#define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */ 59#define CRT_ID_ELK_GS S9000_ID_A1924A /* Elk 1280x1024 GreyScale */
60#define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */ 60#define CRT_ID_CRX24 S9000_ID_A1439A /* Piranha */
61#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti (built-in B132+/B160L) */ 61#define CRT_ID_VISUALIZE_EG 0x2D08C0A7 /* Graffiti, A4450A (built-in B132+/B160L) */
62#define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/ 62#define CRT_ID_THUNDER 0x2F23E5FC /* Thunder 1 VISUALIZE 48*/
63#define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/ 63#define CRT_ID_THUNDER2 0x2F8D570E /* Thunder 2 VISUALIZE 48 XP*/
64#define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */ 64#define CRT_ID_HCRX S9000_ID_HCRX /* Hyperdrive HCRX */
diff --git a/include/asm-parisc/pci.h b/include/asm-parisc/pci.h
index f277254159b7..fe7f6a2f5aa7 100644
--- a/include/asm-parisc/pci.h
+++ b/include/asm-parisc/pci.h
@@ -18,6 +18,18 @@
18*/ 18*/
19#define PCI_MAX_BUSSES 256 19#define PCI_MAX_BUSSES 256
20 20
21
22/* To be used as: mdelay(pci_post_reset_delay);
23 *
24 * post_reset is the time the kernel should stall to prevent anyone from
25 * accessing the PCI bus once #RESET is de-asserted.
26 * PCI spec somewhere says 1 second but with multi-PCI bus systems,
27 * this makes the boot time much longer than necessary.
28 * 20ms seems to work for all the HP PCI implementations to date.
29 */
30#define pci_post_reset_delay 50
31
32
21/* 33/*
22** pci_hba_data (aka H2P_OBJECT in HP/UX) 34** pci_hba_data (aka H2P_OBJECT in HP/UX)
23** 35**
@@ -83,7 +95,7 @@ static __inline__ int pci_is_lmmio(struct pci_hba_data *hba, unsigned long a)
83 95
84/* 96/*
85** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses. 97** Convert between PCI (IO_VIEW) addresses and processor (PA_VIEW) addresses.
86** See pcibios.c for more conversions used by Generic PCI code. 98** See pci.c for more conversions used by Generic PCI code.
87** 99**
88** Platform characteristics/firmware guarantee that 100** Platform characteristics/firmware guarantee that
89** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO 101** (1) PA_VIEW - IO_VIEW = lmmio_offset for both LMMIO and ELMMIO
@@ -191,9 +203,6 @@ struct pci_bios_ops {
191*/ 203*/
192extern struct pci_port_ops *pci_port; 204extern struct pci_port_ops *pci_port;
193extern struct pci_bios_ops *pci_bios; 205extern struct pci_bios_ops *pci_bios;
194extern int pci_post_reset_delay; /* delay after de-asserting #RESET */
195extern int pci_hba_count;
196extern struct pci_hba_data *parisc_pci_hba[];
197 206
198#ifdef CONFIG_PCI 207#ifdef CONFIG_PCI
199extern void pcibios_register_hba(struct pci_hba_data *); 208extern void pcibios_register_hba(struct pci_hba_data *);
diff --git a/include/asm-parisc/pgalloc.h b/include/asm-parisc/pgalloc.h
index 6291d6692e5d..3122fad38a1b 100644
--- a/include/asm-parisc/pgalloc.h
+++ b/include/asm-parisc/pgalloc.h
@@ -137,7 +137,6 @@ static inline void pte_free_kernel(pte_t *pte)
137 137
138#define pte_free(page) pte_free_kernel(page_address(page)) 138#define pte_free(page) pte_free_kernel(page_address(page))
139 139
140extern int do_check_pgt_cache(int, int);
141#define check_pgt_cache() do { } while (0) 140#define check_pgt_cache() do { } while (0)
142 141
143#endif 142#endif
diff --git a/include/asm-parisc/pgtable.h b/include/asm-parisc/pgtable.h
index b4554711c3e7..4e34c6b44059 100644
--- a/include/asm-parisc/pgtable.h
+++ b/include/asm-parisc/pgtable.h
@@ -213,7 +213,7 @@ extern void *vmalloc_start;
213#define PAGE_COPY PAGE_EXECREAD 213#define PAGE_COPY PAGE_EXECREAD
214#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED) 214#define PAGE_RWX __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_READ | _PAGE_WRITE | _PAGE_EXEC |_PAGE_ACCESSED)
215#define PAGE_KERNEL __pgprot(_PAGE_KERNEL) 215#define PAGE_KERNEL __pgprot(_PAGE_KERNEL)
216#define PAGE_KERNEL_RO __pgprot(_PAGE_PRESENT | _PAGE_EXEC | _PAGE_READ | _PAGE_DIRTY | _PAGE_ACCESSED) 216#define PAGE_KERNEL_RO __pgprot(_PAGE_KERNEL & ~_PAGE_WRITE)
217#define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE) 217#define PAGE_KERNEL_UNC __pgprot(_PAGE_KERNEL | _PAGE_NO_CACHE)
218#define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ) 218#define PAGE_GATEWAY __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_GATEWAY| _PAGE_READ)
219#define PAGE_FLUSH __pgprot(_PAGE_FLUSH) 219#define PAGE_FLUSH __pgprot(_PAGE_FLUSH)
diff --git a/include/asm-parisc/rt_sigframe.h b/include/asm-parisc/rt_sigframe.h
index 5623c032b64c..f0dd3b30f6c4 100644
--- a/include/asm-parisc/rt_sigframe.h
+++ b/include/asm-parisc/rt_sigframe.h
@@ -1,10 +1,6 @@
1#ifndef _ASM_PARISC_RT_SIGFRAME_H 1#ifndef _ASM_PARISC_RT_SIGFRAME_H
2#define _ASM_PARISC_RT_SIGFRAME_H 2#define _ASM_PARISC_RT_SIGFRAME_H
3 3
4#ifdef CONFIG_COMPAT
5#include <asm/compat_rt_sigframe.h>
6#endif
7
8#define SIGRETURN_TRAMP 4 4#define SIGRETURN_TRAMP 4
9#define SIGRESTARTBLOCK_TRAMP 5 5#define SIGRESTARTBLOCK_TRAMP 5
10#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP) 6#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
diff --git a/include/asm-parisc/unistd.h b/include/asm-parisc/unistd.h
index 80b7b98c70a1..c56fccbf34ad 100644
--- a/include/asm-parisc/unistd.h
+++ b/include/asm-parisc/unistd.h
@@ -761,8 +761,27 @@
761#define __NR_keyctl (__NR_Linux + 266) 761#define __NR_keyctl (__NR_Linux + 266)
762#define __NR_ioprio_set (__NR_Linux + 267) 762#define __NR_ioprio_set (__NR_Linux + 267)
763#define __NR_ioprio_get (__NR_Linux + 268) 763#define __NR_ioprio_get (__NR_Linux + 268)
764#define __NR_inotify_init (__NR_Linux + 269)
765#define __NR_inotify_add_watch (__NR_Linux + 270)
766#define __NR_inotify_rm_watch (__NR_Linux + 271)
767#define __NR_migrate_pages (__NR_Linux + 272)
768#define __NR_pselect6 (__NR_Linux + 273)
769#define __NR_ppoll (__NR_Linux + 274)
770#define __NR_openat (__NR_Linux + 275)
771#define __NR_mkdirat (__NR_Linux + 276)
772#define __NR_mknodat (__NR_Linux + 277)
773#define __NR_fchownat (__NR_Linux + 278)
774#define __NR_futimesat (__NR_Linux + 279)
775#define __NR_newfstatat (__NR_Linux + 280)
776#define __NR_unlinkat (__NR_Linux + 281)
777#define __NR_renameat (__NR_Linux + 282)
778#define __NR_linkat (__NR_Linux + 283)
779#define __NR_symlinkat (__NR_Linux + 284)
780#define __NR_readlinkat (__NR_Linux + 285)
781#define __NR_fchmodat (__NR_Linux + 286)
782#define __NR_faccessat (__NR_Linux + 287)
764 783
765#define __NR_Linux_syscalls 269 784#define __NR_Linux_syscalls 288
766 785
767#define HPUX_GATEWAY_ADDR 0xC0000004 786#define HPUX_GATEWAY_ADDR 0xC0000004
768#define LINUX_GATEWAY_ADDR 0x100 787#define LINUX_GATEWAY_ADDR 0x100