diff options
Diffstat (limited to 'include/asm-frv')
-rw-r--r-- | include/asm-frv/atomic.h | 6 | ||||
-rw-r--r-- | include/asm-frv/bitops.h | 2 | ||||
-rw-r--r-- | include/asm-frv/cacheflush.h | 12 | ||||
-rw-r--r-- | include/asm-frv/io.h | 1 | ||||
-rw-r--r-- | include/asm-frv/mman.h | 29 | ||||
-rw-r--r-- | include/asm-frv/spr-regs.h | 1 | ||||
-rw-r--r-- | include/asm-frv/system.h | 88 | ||||
-rw-r--r-- | include/asm-frv/uaccess.h | 3 | ||||
-rw-r--r-- | include/asm-frv/unistd.h | 28 |
9 files changed, 122 insertions, 48 deletions
diff --git a/include/asm-frv/atomic.h b/include/asm-frv/atomic.h index a59f684b4f33..5d9f84bfdcad 100644 --- a/include/asm-frv/atomic.h +++ b/include/asm-frv/atomic.h | |||
@@ -220,9 +220,9 @@ extern unsigned long atomic_test_and_XOR_mask(unsigned long mask, volatile unsig | |||
220 | switch (sizeof(__xg_orig)) { \ | 220 | switch (sizeof(__xg_orig)) { \ |
221 | case 4: \ | 221 | case 4: \ |
222 | asm volatile( \ | 222 | asm volatile( \ |
223 | "swap%I0 %2,%M0" \ | 223 | "swap%I0 %M0,%1" \ |
224 | : "+m"(*__xg_ptr), "=&r"(__xg_orig) \ | 224 | : "+m"(*__xg_ptr), "=r"(__xg_orig) \ |
225 | : "r"(x) \ | 225 | : "1"(x) \ |
226 | : "memory" \ | 226 | : "memory" \ |
227 | ); \ | 227 | ); \ |
228 | break; \ | 228 | break; \ |
diff --git a/include/asm-frv/bitops.h b/include/asm-frv/bitops.h index 02be7b3a8a83..f686b519878e 100644 --- a/include/asm-frv/bitops.h +++ b/include/asm-frv/bitops.h | |||
@@ -209,7 +209,7 @@ static inline int find_next_zero_bit(const void *addr, int size, int offset) | |||
209 | tmp = *p; | 209 | tmp = *p; |
210 | 210 | ||
211 | found_first: | 211 | found_first: |
212 | tmp |= ~0UL >> size; | 212 | tmp |= ~0UL << size; |
213 | found_middle: | 213 | found_middle: |
214 | return result + ffz(tmp); | 214 | return result + ffz(tmp); |
215 | } | 215 | } |
diff --git a/include/asm-frv/cacheflush.h b/include/asm-frv/cacheflush.h index 3007deccb490..eaa5826bc1c8 100644 --- a/include/asm-frv/cacheflush.h +++ b/include/asm-frv/cacheflush.h | |||
@@ -87,5 +87,17 @@ static inline void flush_icache_page(struct vm_area_struct *vma, struct page *pa | |||
87 | flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE); | 87 | flush_icache_user_range(vma, page, page_to_phys(page), PAGE_SIZE); |
88 | } | 88 | } |
89 | 89 | ||
90 | /* | ||
91 | * permit ptrace to access another process's address space through the icache | ||
92 | * and the dcache | ||
93 | */ | ||
94 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) \ | ||
95 | do { \ | ||
96 | memcpy((dst), (src), (len)); \ | ||
97 | flush_icache_user_range((vma), (page), (vaddr), (len)); \ | ||
98 | } while(0) | ||
99 | |||
100 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) \ | ||
101 | memcpy((dst), (src), (len)) | ||
90 | 102 | ||
91 | #endif /* _ASM_CACHEFLUSH_H */ | 103 | #endif /* _ASM_CACHEFLUSH_H */ |
diff --git a/include/asm-frv/io.h b/include/asm-frv/io.h index 075369b1a34b..01247cb2bc39 100644 --- a/include/asm-frv/io.h +++ b/include/asm-frv/io.h | |||
@@ -251,7 +251,6 @@ static inline void writel(uint32_t datum, volatile void __iomem *addr) | |||
251 | #define IOMAP_WRITETHROUGH 3 | 251 | #define IOMAP_WRITETHROUGH 3 |
252 | 252 | ||
253 | extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); | 253 | extern void __iomem *__ioremap(unsigned long physaddr, unsigned long size, int cacheflag); |
254 | extern void __iounmap(void __iomem *addr, unsigned long size); | ||
255 | 254 | ||
256 | static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) | 255 | static inline void __iomem *ioremap(unsigned long physaddr, unsigned long size) |
257 | { | 256 | { |
diff --git a/include/asm-frv/mman.h b/include/asm-frv/mman.h index 8af4a41c255e..b4371e928683 100644 --- a/include/asm-frv/mman.h +++ b/include/asm-frv/mman.h | |||
@@ -1,19 +1,7 @@ | |||
1 | #ifndef __ASM_MMAN_H__ | 1 | #ifndef __ASM_MMAN_H__ |
2 | #define __ASM_MMAN_H__ | 2 | #define __ASM_MMAN_H__ |
3 | 3 | ||
4 | #define PROT_READ 0x1 /* page can be read */ | 4 | #include <asm-generic/mman.h> |
5 | #define PROT_WRITE 0x2 /* page can be written */ | ||
6 | #define PROT_EXEC 0x4 /* page can be executed */ | ||
7 | #define PROT_SEM 0x8 /* page may be used for atomic ops */ | ||
8 | #define PROT_NONE 0x0 /* page can not be accessed */ | ||
9 | #define PROT_GROWSDOWN 0x01000000 /* mprotect flag: extend change to start of growsdown vma */ | ||
10 | #define PROT_GROWSUP 0x02000000 /* mprotect flag: extend change to end of growsup vma */ | ||
11 | |||
12 | #define MAP_SHARED 0x01 /* Share changes */ | ||
13 | #define MAP_PRIVATE 0x02 /* Changes are private */ | ||
14 | #define MAP_TYPE 0x0f /* Mask for type of mapping */ | ||
15 | #define MAP_FIXED 0x10 /* Interpret addr exactly */ | ||
16 | #define MAP_ANONYMOUS 0x20 /* don't use a file */ | ||
17 | 5 | ||
18 | #define MAP_GROWSDOWN 0x0100 /* stack-like segment */ | 6 | #define MAP_GROWSDOWN 0x0100 /* stack-like segment */ |
19 | #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ | 7 | #define MAP_DENYWRITE 0x0800 /* ETXTBSY */ |
@@ -23,23 +11,8 @@ | |||
23 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ | 11 | #define MAP_POPULATE 0x8000 /* populate (prefault) pagetables */ |
24 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ | 12 | #define MAP_NONBLOCK 0x10000 /* do not block on IO */ |
25 | 13 | ||
26 | #define MS_ASYNC 1 /* sync memory asynchronously */ | ||
27 | #define MS_INVALIDATE 2 /* invalidate the caches */ | ||
28 | #define MS_SYNC 4 /* synchronous memory sync */ | ||
29 | |||
30 | #define MCL_CURRENT 1 /* lock all current mappings */ | 14 | #define MCL_CURRENT 1 /* lock all current mappings */ |
31 | #define MCL_FUTURE 2 /* lock all future mappings */ | 15 | #define MCL_FUTURE 2 /* lock all future mappings */ |
32 | 16 | ||
33 | #define MADV_NORMAL 0x0 /* default page-in behavior */ | ||
34 | #define MADV_RANDOM 0x1 /* page-in minimum required */ | ||
35 | #define MADV_SEQUENTIAL 0x2 /* read-ahead aggressively */ | ||
36 | #define MADV_WILLNEED 0x3 /* pre-fault pages */ | ||
37 | #define MADV_DONTNEED 0x4 /* discard these pages */ | ||
38 | #define MADV_REMOVE 0x5 /* remove these pages & resources */ | ||
39 | |||
40 | /* compatibility flags */ | ||
41 | #define MAP_ANON MAP_ANONYMOUS | ||
42 | #define MAP_FILE 0 | ||
43 | |||
44 | #endif /* __ASM_MMAN_H__ */ | 17 | #endif /* __ASM_MMAN_H__ */ |
45 | 18 | ||
diff --git a/include/asm-frv/spr-regs.h b/include/asm-frv/spr-regs.h index ef472f058d9c..c2a541ef828d 100644 --- a/include/asm-frv/spr-regs.h +++ b/include/asm-frv/spr-regs.h | |||
@@ -98,6 +98,7 @@ | |||
98 | #define TBR_TT_TRAP0 (0x80 << 4) | 98 | #define TBR_TT_TRAP0 (0x80 << 4) |
99 | #define TBR_TT_TRAP1 (0x81 << 4) | 99 | #define TBR_TT_TRAP1 (0x81 << 4) |
100 | #define TBR_TT_TRAP2 (0x82 << 4) | 100 | #define TBR_TT_TRAP2 (0x82 << 4) |
101 | #define TBR_TT_TRAP3 (0x83 << 4) | ||
101 | #define TBR_TT_TRAP126 (0xfe << 4) | 102 | #define TBR_TT_TRAP126 (0xfe << 4) |
102 | #define TBR_TT_BREAK (0xff << 4) | 103 | #define TBR_TT_BREAK (0xff << 4) |
103 | 104 | ||
diff --git a/include/asm-frv/system.h b/include/asm-frv/system.h index d2aea70a5f64..f72ff0c4dc0b 100644 --- a/include/asm-frv/system.h +++ b/include/asm-frv/system.h | |||
@@ -40,8 +40,84 @@ do { \ | |||
40 | 40 | ||
41 | /* | 41 | /* |
42 | * interrupt flag manipulation | 42 | * interrupt flag manipulation |
43 | * - use virtual interrupt management since touching the PSR is slow | ||
44 | * - ICC2.Z: T if interrupts virtually disabled | ||
45 | * - ICC2.C: F if interrupts really disabled | ||
46 | * - if Z==1 upon interrupt: | ||
47 | * - C is set to 0 | ||
48 | * - interrupts are really disabled | ||
49 | * - entry.S returns immediately | ||
50 | * - uses TIHI (TRAP if Z==0 && C==0) #2 to really reenable interrupts | ||
51 | * - if taken, the trap: | ||
52 | * - sets ICC2.C | ||
53 | * - enables interrupts | ||
43 | */ | 54 | */ |
44 | #define local_irq_disable() \ | 55 | #define local_irq_disable() \ |
56 | do { \ | ||
57 | /* set Z flag, but don't change the C flag */ \ | ||
58 | asm volatile(" andcc gr0,gr0,gr0,icc2 \n" \ | ||
59 | : \ | ||
60 | : \ | ||
61 | : "memory", "icc2" \ | ||
62 | ); \ | ||
63 | } while(0) | ||
64 | |||
65 | #define local_irq_enable() \ | ||
66 | do { \ | ||
67 | /* clear Z flag and then test the C flag */ \ | ||
68 | asm volatile(" oricc gr0,#1,gr0,icc2 \n" \ | ||
69 | " tihi icc2,gr0,#2 \n" \ | ||
70 | : \ | ||
71 | : \ | ||
72 | : "memory", "icc2" \ | ||
73 | ); \ | ||
74 | } while(0) | ||
75 | |||
76 | #define local_save_flags(flags) \ | ||
77 | do { \ | ||
78 | typecheck(unsigned long, flags); \ | ||
79 | asm volatile("movsg ccr,%0" \ | ||
80 | : "=r"(flags) \ | ||
81 | : \ | ||
82 | : "memory"); \ | ||
83 | \ | ||
84 | /* shift ICC2.Z to bit 0 */ \ | ||
85 | flags >>= 26; \ | ||
86 | \ | ||
87 | /* make flags 1 if interrupts disabled, 0 otherwise */ \ | ||
88 | flags &= 1UL; \ | ||
89 | } while(0) | ||
90 | |||
91 | #define irqs_disabled() \ | ||
92 | ({unsigned long flags; local_save_flags(flags); flags; }) | ||
93 | |||
94 | #define local_irq_save(flags) \ | ||
95 | do { \ | ||
96 | typecheck(unsigned long, flags); \ | ||
97 | local_save_flags(flags); \ | ||
98 | local_irq_disable(); \ | ||
99 | } while(0) | ||
100 | |||
101 | #define local_irq_restore(flags) \ | ||
102 | do { \ | ||
103 | typecheck(unsigned long, flags); \ | ||
104 | \ | ||
105 | /* load the Z flag by turning 1 if disabled into 0 if disabled \ | ||
106 | * and thus setting the Z flag but not the C flag */ \ | ||
107 | asm volatile(" xoricc %0,#1,gr0,icc2 \n" \ | ||
108 | /* then test Z=0 and C=0 */ \ | ||
109 | " tihi icc2,gr0,#2 \n" \ | ||
110 | : \ | ||
111 | : "r"(flags) \ | ||
112 | : "memory", "icc2" \ | ||
113 | ); \ | ||
114 | \ | ||
115 | } while(0) | ||
116 | |||
117 | /* | ||
118 | * real interrupt flag manipulation | ||
119 | */ | ||
120 | #define __local_irq_disable() \ | ||
45 | do { \ | 121 | do { \ |
46 | unsigned long psr; \ | 122 | unsigned long psr; \ |
47 | asm volatile(" movsg psr,%0 \n" \ | 123 | asm volatile(" movsg psr,%0 \n" \ |
@@ -53,7 +129,7 @@ do { \ | |||
53 | : "memory"); \ | 129 | : "memory"); \ |
54 | } while(0) | 130 | } while(0) |
55 | 131 | ||
56 | #define local_irq_enable() \ | 132 | #define __local_irq_enable() \ |
57 | do { \ | 133 | do { \ |
58 | unsigned long psr; \ | 134 | unsigned long psr; \ |
59 | asm volatile(" movsg psr,%0 \n" \ | 135 | asm volatile(" movsg psr,%0 \n" \ |
@@ -64,7 +140,7 @@ do { \ | |||
64 | : "memory"); \ | 140 | : "memory"); \ |
65 | } while(0) | 141 | } while(0) |
66 | 142 | ||
67 | #define local_save_flags(flags) \ | 143 | #define __local_save_flags(flags) \ |
68 | do { \ | 144 | do { \ |
69 | typecheck(unsigned long, flags); \ | 145 | typecheck(unsigned long, flags); \ |
70 | asm("movsg psr,%0" \ | 146 | asm("movsg psr,%0" \ |
@@ -73,7 +149,7 @@ do { \ | |||
73 | : "memory"); \ | 149 | : "memory"); \ |
74 | } while(0) | 150 | } while(0) |
75 | 151 | ||
76 | #define local_irq_save(flags) \ | 152 | #define __local_irq_save(flags) \ |
77 | do { \ | 153 | do { \ |
78 | unsigned long npsr; \ | 154 | unsigned long npsr; \ |
79 | typecheck(unsigned long, flags); \ | 155 | typecheck(unsigned long, flags); \ |
@@ -86,7 +162,7 @@ do { \ | |||
86 | : "memory"); \ | 162 | : "memory"); \ |
87 | } while(0) | 163 | } while(0) |
88 | 164 | ||
89 | #define local_irq_restore(flags) \ | 165 | #define __local_irq_restore(flags) \ |
90 | do { \ | 166 | do { \ |
91 | typecheck(unsigned long, flags); \ | 167 | typecheck(unsigned long, flags); \ |
92 | asm volatile(" movgs %0,psr \n" \ | 168 | asm volatile(" movgs %0,psr \n" \ |
@@ -95,7 +171,7 @@ do { \ | |||
95 | : "memory"); \ | 171 | : "memory"); \ |
96 | } while(0) | 172 | } while(0) |
97 | 173 | ||
98 | #define irqs_disabled() \ | 174 | #define __irqs_disabled() \ |
99 | ((__get_PSR() & PSR_PIL) >= PSR_PIL_14) | 175 | ((__get_PSR() & PSR_PIL) >= PSR_PIL_14) |
100 | 176 | ||
101 | /* | 177 | /* |
diff --git a/include/asm-frv/uaccess.h b/include/asm-frv/uaccess.h index b6bcbe01f6ee..a1d140438863 100644 --- a/include/asm-frv/uaccess.h +++ b/include/asm-frv/uaccess.h | |||
@@ -306,7 +306,4 @@ extern long strnlen_user(const char *src, long count); | |||
306 | 306 | ||
307 | extern unsigned long search_exception_table(unsigned long addr); | 307 | extern unsigned long search_exception_table(unsigned long addr); |
308 | 308 | ||
309 | #define copy_to_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len) | ||
310 | #define copy_from_user_page(vma, page, vaddr, dst, src, len) memcpy(dst, src, len) | ||
311 | |||
312 | #endif /* _ASM_UACCESS_H */ | 309 | #endif /* _ASM_UACCESS_H */ |
diff --git a/include/asm-frv/unistd.h b/include/asm-frv/unistd.h index 4d994d2e99e3..322531caa484 100644 --- a/include/asm-frv/unistd.h +++ b/include/asm-frv/unistd.h | |||
@@ -295,13 +295,29 @@ | |||
295 | #define __NR_add_key 286 | 295 | #define __NR_add_key 286 |
296 | #define __NR_request_key 287 | 296 | #define __NR_request_key 287 |
297 | #define __NR_keyctl 288 | 297 | #define __NR_keyctl 288 |
298 | #define __NR_vperfctr_open 289 | 298 | #define __NR_ioprio_set 289 |
299 | #define __NR_vperfctr_control (__NR_perfctr_info+1) | 299 | #define __NR_ioprio_get 290 |
300 | #define __NR_vperfctr_unlink (__NR_perfctr_info+2) | 300 | #define __NR_inotify_init 291 |
301 | #define __NR_vperfctr_iresume (__NR_perfctr_info+3) | 301 | #define __NR_inotify_add_watch 292 |
302 | #define __NR_vperfctr_read (__NR_perfctr_info+4) | 302 | #define __NR_inotify_rm_watch 293 |
303 | #define __NR_migrate_pages 294 | ||
304 | #define __NR_openat 295 | ||
305 | #define __NR_mkdirat 296 | ||
306 | #define __NR_mknodat 297 | ||
307 | #define __NR_fchownat 298 | ||
308 | #define __NR_futimesat 299 | ||
309 | #define __NR_newfstatat 300 | ||
310 | #define __NR_unlinkat 301 | ||
311 | #define __NR_renameat 302 | ||
312 | #define __NR_linkat 303 | ||
313 | #define __NR_symlinkat 304 | ||
314 | #define __NR_readlinkat 305 | ||
315 | #define __NR_fchmodat 306 | ||
316 | #define __NR_faccessat 307 | ||
317 | #define __NR_pselect6 308 | ||
318 | #define __NR_ppoll 309 | ||
303 | 319 | ||
304 | #define NR_syscalls 294 | 320 | #define NR_syscalls 310 |
305 | 321 | ||
306 | /* | 322 | /* |
307 | * process the return value of a syscall, consigning it to one of two possible fates | 323 | * process the return value of a syscall, consigning it to one of two possible fates |