aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asm-ia64/hw_irq.h18
-rw-r--r--include/asm-ia64/iosapic.h6
-rw-r--r--include/asm-ia64/irq.h9
-rw-r--r--include/asm-ia64/rwsem.h4
-rw-r--r--include/asm-ia64/unistd.h2
-rw-r--r--include/asm-mips/atomic.h33
-rw-r--r--include/asm-mips/barrier.h9
-rw-r--r--include/asm-mips/bitops.h10
-rw-r--r--include/asm-mips/ds1216.h31
-rw-r--r--include/asm-mips/futex.h8
-rw-r--r--include/asm-mips/gfx.h55
-rw-r--r--include/asm-mips/mach-cobalt/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-excite/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-ip22/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip27/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-ip32/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-qemu/cpu-feature-overrides.h3
-rw-r--r--include/asm-mips/mach-rm/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-sibyte/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/mach-yosemite/cpu-feature-overrides.h4
-rw-r--r--include/asm-mips/spinlock.h18
-rw-r--r--include/asm-mips/system.h10
-rw-r--r--include/linux/clocksource.h6
-rw-r--r--include/linux/slab.h2
-rw-r--r--include/linux/timex.h60
25 files changed, 114 insertions, 201 deletions
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h
index c054d7a9aaa7..efa1b8f7251d 100644
--- a/include/asm-ia64/hw_irq.h
+++ b/include/asm-ia64/hw_irq.h
@@ -90,13 +90,27 @@ enum {
90extern __u8 isa_irq_to_vector_map[16]; 90extern __u8 isa_irq_to_vector_map[16];
91#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)] 91#define isa_irq_to_vector(x) isa_irq_to_vector_map[(x)]
92 92
93struct irq_cfg {
94 ia64_vector vector;
95 cpumask_t domain;
96};
97extern spinlock_t vector_lock;
98extern struct irq_cfg irq_cfg[NR_IRQS];
99#define irq_to_domain(x) irq_cfg[(x)].domain
100DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq);
101
93extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ 102extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */
94 103
104extern int bind_irq_vector(int irq, int vector, cpumask_t domain);
95extern int assign_irq_vector (int irq); /* allocate a free vector */ 105extern int assign_irq_vector (int irq); /* allocate a free vector */
96extern void free_irq_vector (int vector); 106extern void free_irq_vector (int vector);
97extern int reserve_irq_vector (int vector); 107extern int reserve_irq_vector (int vector);
108extern void __setup_vector_irq(int cpu);
109extern int reassign_irq_vector(int irq, int cpu);
98extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); 110extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect);
99extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); 111extern void register_percpu_irq (ia64_vector vec, struct irqaction *action);
112extern int check_irq_used (int irq);
113extern void destroy_and_reserve_irq (unsigned int irq);
100 114
101static inline void ia64_resend_irq(unsigned int vector) 115static inline void ia64_resend_irq(unsigned int vector)
102{ 116{
@@ -113,7 +127,7 @@ extern irq_desc_t irq_desc[NR_IRQS];
113static inline unsigned int 127static inline unsigned int
114__ia64_local_vector_to_irq (ia64_vector vec) 128__ia64_local_vector_to_irq (ia64_vector vec)
115{ 129{
116 return (unsigned int) vec; 130 return __get_cpu_var(vector_irq)[vec];
117} 131}
118#endif 132#endif
119 133
@@ -131,7 +145,7 @@ __ia64_local_vector_to_irq (ia64_vector vec)
131static inline ia64_vector 145static inline ia64_vector
132irq_to_vector (int irq) 146irq_to_vector (int irq)
133{ 147{
134 return (ia64_vector) irq; 148 return irq_cfg[irq].vector;
135} 149}
136 150
137/* 151/*
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h
index 421cb6b62a7c..b8f712859140 100644
--- a/include/asm-ia64/iosapic.h
+++ b/include/asm-ia64/iosapic.h
@@ -47,19 +47,21 @@
47#define IOSAPIC_MASK_SHIFT 16 47#define IOSAPIC_MASK_SHIFT 16
48#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT) 48#define IOSAPIC_MASK (1<<IOSAPIC_MASK_SHIFT)
49 49
50#define IOSAPIC_VECTOR_MASK 0xffffff00
51
50#ifndef __ASSEMBLY__ 52#ifndef __ASSEMBLY__
51 53
52#ifdef CONFIG_IOSAPIC 54#ifdef CONFIG_IOSAPIC
53 55
54#define NR_IOSAPICS 256 56#define NR_IOSAPICS 256
55 57
56static inline unsigned int iosapic_read(char __iomem *iosapic, unsigned int reg) 58static inline unsigned int __iosapic_read(char __iomem *iosapic, unsigned int reg)
57{ 59{
58 writel(reg, iosapic + IOSAPIC_REG_SELECT); 60 writel(reg, iosapic + IOSAPIC_REG_SELECT);
59 return readl(iosapic + IOSAPIC_WINDOW); 61 return readl(iosapic + IOSAPIC_WINDOW);
60} 62}
61 63
62static inline void iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) 64static inline void __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val)
63{ 65{
64 writel(reg, iosapic + IOSAPIC_REG_SELECT); 66 writel(reg, iosapic + IOSAPIC_REG_SELECT);
65 writel(val, iosapic + IOSAPIC_WINDOW); 67 writel(val, iosapic + IOSAPIC_WINDOW);
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h
index 67221615e317..35b360b82e43 100644
--- a/include/asm-ia64/irq.h
+++ b/include/asm-ia64/irq.h
@@ -14,8 +14,13 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/cpumask.h> 15#include <linux/cpumask.h>
16 16
17#define NR_IRQS 256 17#define NR_VECTORS 256
18#define NR_IRQ_VECTORS NR_IRQS 18
19#if (NR_VECTORS + 32 * NR_CPUS) < 1024
20#define NR_IRQS (NR_VECTORS + 32 * NR_CPUS)
21#else
22#define NR_IRQS 1024
23#endif
19 24
20static __inline__ int 25static __inline__ int
21irq_canonicalize (int irq) 26irq_canonicalize (int irq)
diff --git a/include/asm-ia64/rwsem.h b/include/asm-ia64/rwsem.h
index 2d1640cc240a..8aba06a7b038 100644
--- a/include/asm-ia64/rwsem.h
+++ b/include/asm-ia64/rwsem.h
@@ -21,6 +21,10 @@
21#ifndef _ASM_IA64_RWSEM_H 21#ifndef _ASM_IA64_RWSEM_H
22#define _ASM_IA64_RWSEM_H 22#define _ASM_IA64_RWSEM_H
23 23
24#ifndef _LINUX_RWSEM_H
25#error "Please don't include <asm/rwsem.h> directly, use <linux/rwsem.h> instead."
26#endif
27
24#include <linux/list.h> 28#include <linux/list.h>
25#include <linux/spinlock.h> 29#include <linux/spinlock.h>
26 30
diff --git a/include/asm-ia64/unistd.h b/include/asm-ia64/unistd.h
index 441c9e001776..315f8de950a2 100644
--- a/include/asm-ia64/unistd.h
+++ b/include/asm-ia64/unistd.h
@@ -292,7 +292,7 @@
292#define __NR_sync_file_range 1300 292#define __NR_sync_file_range 1300
293#define __NR_tee 1301 293#define __NR_tee 1301
294#define __NR_vmsplice 1302 294#define __NR_vmsplice 1302
295/* 1303 reserved for move_pages */ 295#define __NR_fallocate 1303
296#define __NR_getcpu 1304 296#define __NR_getcpu 1304
297#define __NR_epoll_pwait 1305 297#define __NR_epoll_pwait 1305
298#define __NR_utimensat 1306 298#define __NR_utimensat 1306
diff --git a/include/asm-mips/atomic.h b/include/asm-mips/atomic.h
index 1b60624dab7e..7d8003769a44 100644
--- a/include/asm-mips/atomic.h
+++ b/include/asm-mips/atomic.h
@@ -138,7 +138,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
138{ 138{
139 unsigned long result; 139 unsigned long result;
140 140
141 smp_mb(); 141 smp_llsc_mb();
142 142
143 if (cpu_has_llsc && R10000_LLSC_WAR) { 143 if (cpu_has_llsc && R10000_LLSC_WAR) {
144 unsigned long temp; 144 unsigned long temp;
@@ -181,7 +181,7 @@ static __inline__ int atomic_add_return(int i, atomic_t * v)
181 raw_local_irq_restore(flags); 181 raw_local_irq_restore(flags);
182 } 182 }
183 183
184 smp_mb(); 184 smp_llsc_mb();
185 185
186 return result; 186 return result;
187} 187}
@@ -190,7 +190,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
190{ 190{
191 unsigned long result; 191 unsigned long result;
192 192
193 smp_mb(); 193 smp_llsc_mb();
194 194
195 if (cpu_has_llsc && R10000_LLSC_WAR) { 195 if (cpu_has_llsc && R10000_LLSC_WAR) {
196 unsigned long temp; 196 unsigned long temp;
@@ -233,7 +233,7 @@ static __inline__ int atomic_sub_return(int i, atomic_t * v)
233 raw_local_irq_restore(flags); 233 raw_local_irq_restore(flags);
234 } 234 }
235 235
236 smp_mb(); 236 smp_llsc_mb();
237 237
238 return result; 238 return result;
239} 239}
@@ -250,7 +250,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
250{ 250{
251 unsigned long result; 251 unsigned long result;
252 252
253 smp_mb(); 253 smp_llsc_mb();
254 254
255 if (cpu_has_llsc && R10000_LLSC_WAR) { 255 if (cpu_has_llsc && R10000_LLSC_WAR) {
256 unsigned long temp; 256 unsigned long temp;
@@ -302,7 +302,7 @@ static __inline__ int atomic_sub_if_positive(int i, atomic_t * v)
302 raw_local_irq_restore(flags); 302 raw_local_irq_restore(flags);
303 } 303 }
304 304
305 smp_mb(); 305 smp_llsc_mb();
306 306
307 return result; 307 return result;
308} 308}
@@ -519,7 +519,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
519{ 519{
520 unsigned long result; 520 unsigned long result;
521 521
522 smp_mb(); 522 smp_llsc_mb();
523 523
524 if (cpu_has_llsc && R10000_LLSC_WAR) { 524 if (cpu_has_llsc && R10000_LLSC_WAR) {
525 unsigned long temp; 525 unsigned long temp;
@@ -562,7 +562,7 @@ static __inline__ long atomic64_add_return(long i, atomic64_t * v)
562 raw_local_irq_restore(flags); 562 raw_local_irq_restore(flags);
563 } 563 }
564 564
565 smp_mb(); 565 smp_llsc_mb();
566 566
567 return result; 567 return result;
568} 568}
@@ -571,7 +571,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
571{ 571{
572 unsigned long result; 572 unsigned long result;
573 573
574 smp_mb(); 574 smp_llsc_mb();
575 575
576 if (cpu_has_llsc && R10000_LLSC_WAR) { 576 if (cpu_has_llsc && R10000_LLSC_WAR) {
577 unsigned long temp; 577 unsigned long temp;
@@ -614,7 +614,7 @@ static __inline__ long atomic64_sub_return(long i, atomic64_t * v)
614 raw_local_irq_restore(flags); 614 raw_local_irq_restore(flags);
615 } 615 }
616 616
617 smp_mb(); 617 smp_llsc_mb();
618 618
619 return result; 619 return result;
620} 620}
@@ -631,7 +631,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
631{ 631{
632 unsigned long result; 632 unsigned long result;
633 633
634 smp_mb(); 634 smp_llsc_mb();
635 635
636 if (cpu_has_llsc && R10000_LLSC_WAR) { 636 if (cpu_has_llsc && R10000_LLSC_WAR) {
637 unsigned long temp; 637 unsigned long temp;
@@ -683,7 +683,7 @@ static __inline__ long atomic64_sub_if_positive(long i, atomic64_t * v)
683 raw_local_irq_restore(flags); 683 raw_local_irq_restore(flags);
684 } 684 }
685 685
686 smp_mb(); 686 smp_llsc_mb();
687 687
688 return result; 688 return result;
689} 689}
@@ -791,10 +791,11 @@ static __inline__ int atomic64_add_unless(atomic64_t *v, long a, long u)
791 * atomic*_return operations are serializing but not the non-*_return 791 * atomic*_return operations are serializing but not the non-*_return
792 * versions. 792 * versions.
793 */ 793 */
794#define smp_mb__before_atomic_dec() smp_mb() 794#define smp_mb__before_atomic_dec() smp_llsc_mb()
795#define smp_mb__after_atomic_dec() smp_mb() 795#define smp_mb__after_atomic_dec() smp_llsc_mb()
796#define smp_mb__before_atomic_inc() smp_mb() 796#define smp_mb__before_atomic_inc() smp_llsc_mb()
797#define smp_mb__after_atomic_inc() smp_mb() 797#define smp_mb__after_atomic_inc() smp_llsc_mb()
798 798
799#include <asm-generic/atomic.h> 799#include <asm-generic/atomic.h>
800
800#endif /* _ASM_ATOMIC_H */ 801#endif /* _ASM_ATOMIC_H */
diff --git a/include/asm-mips/barrier.h b/include/asm-mips/barrier.h
index ed82631b0017..9d8cfbb5e796 100644
--- a/include/asm-mips/barrier.h
+++ b/include/asm-mips/barrier.h
@@ -121,6 +121,11 @@
121#else 121#else
122#define __WEAK_ORDERING_MB " \n" 122#define __WEAK_ORDERING_MB " \n"
123#endif 123#endif
124#if defined(CONFIG_WEAK_REORDERING_BEYOND_LLSC) && defined(CONFIG_SMP)
125#define __WEAK_LLSC_MB " sync \n"
126#else
127#define __WEAK_LLSC_MB " \n"
128#endif
124 129
125#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") 130#define smp_mb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
126#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory") 131#define smp_rmb() __asm__ __volatile__(__WEAK_ORDERING_MB : : :"memory")
@@ -129,4 +134,8 @@
129#define set_mb(var, value) \ 134#define set_mb(var, value) \
130 do { var = value; smp_mb(); } while (0) 135 do { var = value; smp_mb(); } while (0)
131 136
137#define smp_llsc_mb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
138#define smp_llsc_rmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
139#define smp_llsc_wmb() __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory")
140
132#endif /* __ASM_BARRIER_H */ 141#endif /* __ASM_BARRIER_H */
diff --git a/include/asm-mips/bitops.h b/include/asm-mips/bitops.h
index d9e81af53f78..148bc79557f1 100644
--- a/include/asm-mips/bitops.h
+++ b/include/asm-mips/bitops.h
@@ -38,8 +38,8 @@
38/* 38/*
39 * clear_bit() doesn't provide any barrier for the compiler. 39 * clear_bit() doesn't provide any barrier for the compiler.
40 */ 40 */
41#define smp_mb__before_clear_bit() smp_mb() 41#define smp_mb__before_clear_bit() smp_llsc_mb()
42#define smp_mb__after_clear_bit() smp_mb() 42#define smp_mb__after_clear_bit() smp_llsc_mb()
43 43
44/* 44/*
45 * set_bit - Atomically set a bit in memory 45 * set_bit - Atomically set a bit in memory
@@ -289,7 +289,7 @@ static inline int test_and_set_bit(unsigned long nr,
289 raw_local_irq_restore(flags); 289 raw_local_irq_restore(flags);
290 } 290 }
291 291
292 smp_mb(); 292 smp_llsc_mb();
293 293
294 return res != 0; 294 return res != 0;
295} 295}
@@ -377,7 +377,7 @@ static inline int test_and_clear_bit(unsigned long nr,
377 raw_local_irq_restore(flags); 377 raw_local_irq_restore(flags);
378 } 378 }
379 379
380 smp_mb(); 380 smp_llsc_mb();
381 381
382 return res != 0; 382 return res != 0;
383} 383}
@@ -445,7 +445,7 @@ static inline int test_and_change_bit(unsigned long nr,
445 raw_local_irq_restore(flags); 445 raw_local_irq_restore(flags);
446 } 446 }
447 447
448 smp_mb(); 448 smp_llsc_mb();
449 449
450 return res != 0; 450 return res != 0;
451} 451}
diff --git a/include/asm-mips/ds1216.h b/include/asm-mips/ds1216.h
deleted file mode 100644
index 1ff8b73f7a6a..000000000000
--- a/include/asm-mips/ds1216.h
+++ /dev/null
@@ -1,31 +0,0 @@
1#ifndef _DS1216_H
2#define _DS1216_H
3
4extern volatile unsigned char *ds1216_base;
5unsigned long ds1216_get_cmos_time(void);
6int ds1216_set_rtc_mmss(unsigned long nowtime);
7
8#define DS1216_SEC_BYTE 1
9#define DS1216_MIN_BYTE 2
10#define DS1216_HOUR_BYTE 3
11#define DS1216_HOUR_MASK (0x1f)
12#define DS1216_AMPM_MASK (1<<5)
13#define DS1216_1224_MASK (1<<7)
14#define DS1216_DAY_BYTE 4
15#define DS1216_DAY_MASK (0x7)
16#define DS1216_DATE_BYTE 5
17#define DS1216_DATE_MASK (0x3f)
18#define DS1216_MONTH_BYTE 6
19#define DS1216_MONTH_MASK (0x1f)
20#define DS1216_YEAR_BYTE 7
21
22#define DS1216_SEC(buf) (buf[DS1216_SEC_BYTE])
23#define DS1216_MIN(buf) (buf[DS1216_MIN_BYTE])
24#define DS1216_HOUR(buf) (buf[DS1216_HOUR_BYTE] & DS1216_HOUR_MASK)
25#define DS1216_AMPM(buf) (buf[DS1216_HOUR_BYTE] & DS1216_AMPM_MASK)
26#define DS1216_1224(buf) (buf[DS1216_HOUR_BYTE] & DS1216_1224_MASK)
27#define DS1216_DATE(buf) (buf[DS1216_DATE_BYTE] & DS1216_DATE_MASK)
28#define DS1216_MONTH(buf) (buf[DS1216_MONTH_BYTE] & DS1216_MONTH_MASK)
29#define DS1216_YEAR(buf) (buf[DS1216_YEAR_BYTE])
30
31#endif
diff --git a/include/asm-mips/futex.h b/include/asm-mips/futex.h
index 47e5679c2353..b623882bce19 100644
--- a/include/asm-mips/futex.h
+++ b/include/asm-mips/futex.h
@@ -29,7 +29,7 @@
29 " .set mips3 \n" \ 29 " .set mips3 \n" \
30 "2: sc $1, %2 \n" \ 30 "2: sc $1, %2 \n" \
31 " beqzl $1, 1b \n" \ 31 " beqzl $1, 1b \n" \
32 __WEAK_ORDERING_MB \ 32 __WEAK_LLSC_MB \
33 "3: \n" \ 33 "3: \n" \
34 " .set pop \n" \ 34 " .set pop \n" \
35 " .set mips0 \n" \ 35 " .set mips0 \n" \
@@ -55,7 +55,7 @@
55 " .set mips3 \n" \ 55 " .set mips3 \n" \
56 "2: sc $1, %2 \n" \ 56 "2: sc $1, %2 \n" \
57 " beqz $1, 1b \n" \ 57 " beqz $1, 1b \n" \
58 __WEAK_ORDERING_MB \ 58 __WEAK_LLSC_MB \
59 "3: \n" \ 59 "3: \n" \
60 " .set pop \n" \ 60 " .set pop \n" \
61 " .set mips0 \n" \ 61 " .set mips0 \n" \
@@ -152,7 +152,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
152 " .set mips3 \n" 152 " .set mips3 \n"
153 "2: sc $1, %1 \n" 153 "2: sc $1, %1 \n"
154 " beqzl $1, 1b \n" 154 " beqzl $1, 1b \n"
155 __WEAK_ORDERING_MB 155 __WEAK_LLSC_MB
156 "3: \n" 156 "3: \n"
157 " .set pop \n" 157 " .set pop \n"
158 " .section .fixup,\"ax\" \n" 158 " .section .fixup,\"ax\" \n"
@@ -179,7 +179,7 @@ futex_atomic_cmpxchg_inatomic(int __user *uaddr, int oldval, int newval)
179 " .set mips3 \n" 179 " .set mips3 \n"
180 "2: sc $1, %1 \n" 180 "2: sc $1, %1 \n"
181 " beqz $1, 1b \n" 181 " beqz $1, 1b \n"
182 __WEAK_ORDERING_MB 182 __WEAK_LLSC_MB
183 "3: \n" 183 "3: \n"
184 " .set pop \n" 184 " .set pop \n"
185 " .section .fixup,\"ax\" \n" 185 " .section .fixup,\"ax\" \n"
diff --git a/include/asm-mips/gfx.h b/include/asm-mips/gfx.h
deleted file mode 100644
index 37235e41a6fd..000000000000
--- a/include/asm-mips/gfx.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * This is the user-visible SGI GFX interface.
7 *
8 * This must be used verbatim into the GNU libc. It does not include
9 * any kernel-only bits on it.
10 *
11 * miguel@nuclecu.unam.mx
12 */
13#ifndef _ASM_GFX_H
14#define _ASM_GFX_H
15
16/* The iocls, yes, they do not make sense, but such is life */
17#define GFX_BASE 100
18#define GFX_GETNUM_BOARDS (GFX_BASE + 1)
19#define GFX_GETBOARD_INFO (GFX_BASE + 2)
20#define GFX_ATTACH_BOARD (GFX_BASE + 3)
21#define GFX_DETACH_BOARD (GFX_BASE + 4)
22#define GFX_IS_MANAGED (GFX_BASE + 5)
23
24#define GFX_MAPALL (GFX_BASE + 10)
25#define GFX_LABEL (GFX_BASE + 11)
26
27#define GFX_INFO_NAME_SIZE 16
28#define GFX_INFO_LABEL_SIZE 16
29
30struct gfx_info {
31 char name [GFX_INFO_NAME_SIZE]; /* board name */
32 char label [GFX_INFO_LABEL_SIZE]; /* label name */
33 unsigned short int xpmax, ypmax; /* screen resolution */
34 unsigned int lenght; /* size of a complete gfx_info for this board */
35};
36
37struct gfx_getboardinfo_args {
38 unsigned int board; /* board number. starting from zero */
39 void *buf; /* pointer to gfx_info */
40 unsigned int len; /* buffer size of buf */
41};
42
43struct gfx_attach_board_args {
44 unsigned int board; /* board number, starting from zero */
45 void *vaddr; /* address where the board registers should be mapped */
46};
47
48#ifdef __KERNEL__
49/* umap.c */
50extern void remove_mapping (struct vm_area_struct *vma, struct task_struct *, unsigned long, unsigned long);
51extern void *vmalloc_uncached (unsigned long size);
52extern int vmap_page_range (struct vm_area_struct *vma, unsigned long from, unsigned long size, unsigned long vaddr);
53#endif
54
55#endif /* _ASM_GFX_H */
diff --git a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
index c6dfa59d1986..d38f069d9e95 100644
--- a/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-cobalt/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2006 Ralf Baechle (ralf@linux-mips.org) 6 * Copyright (C) 2006, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H 9#define __ASM_COBALT_CPU_FEATURE_OVERRIDES_H
@@ -46,6 +46,8 @@
46#define cpu_has_ic_fills_f_dc 0 46#define cpu_has_ic_fills_f_dc 0
47#define cpu_icache_snoops_remote_store 0 47#define cpu_icache_snoops_remote_store 0
48#define cpu_has_dsp 0 48#define cpu_has_dsp 0
49#define cpu_has_mipsmt 0
50#define cpu_has_userlocal 0
49 51
50#define cpu_has_mips32r1 0 52#define cpu_has_mips32r1 0
51#define cpu_has_mips32r2 0 53#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-excite/cpu-feature-overrides.h b/include/asm-mips/mach-excite/cpu-feature-overrides.h
index 0d31854222f9..07f4322c235d 100644
--- a/include/asm-mips/mach-excite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-excite/cpu-feature-overrides.h
@@ -4,6 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com> 6 * Copyright (C) 2004 Thomas Koeller <thomas.koeller@baslerweb.com>
7 * Copyright (C) 2007 Ralf Baechle (ralf@linux-mips.org)
7 */ 8 */
8#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_EXCITE_CPU_FEATURE_OVERRIDES_H
@@ -27,6 +28,8 @@
27#define cpu_has_ic_fills_f_dc 0 28#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 29#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 0 30#define cpu_icache_snoops_remote_store 0
31#define cpu_has_mipsmt 0
32#define cpu_has_userlocal 0
30 33
31#define cpu_has_nofpuex 0 34#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 35#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip22/cpu-feature-overrides.h b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
index f7c5dc8a5336..9c8735158da1 100644
--- a/include/asm-mips/mach-ip22/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip22/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_IP22_CPU_FEATURE_OVERRIDES_H
@@ -30,6 +30,8 @@
30#define cpu_has_ic_fills_f_dc 0 30#define cpu_has_ic_fills_f_dc 0
31 31
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_mipsmt 0
34#define cpu_has_userlocal 0
33 35
34#define cpu_has_nofpuex 0 36#define cpu_has_nofpuex 0
35#define cpu_has_64bits 1 37#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip27/cpu-feature-overrides.h b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
index a071974b67bb..fe076380c189 100644
--- a/include/asm-mips/mach-ip27/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip27/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_IP27_CPU_FEATURE_OVERRIDES_H
@@ -27,6 +27,8 @@
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_icache_snoops_remote_store 1 29#define cpu_icache_snoops_remote_store 1
30#define cpu_has_mipsmt 0
31#define cpu_has_userlocal 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
32#define cpu_has_64bits 1 34#define cpu_has_64bits 1
diff --git a/include/asm-mips/mach-ip32/cpu-feature-overrides.h b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
index 2a3de092bf13..6782fccebe8d 100644
--- a/include/asm-mips/mach-ip32/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-ip32/cpu-feature-overrides.h
@@ -4,7 +4,7 @@
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh 6 * Copyright (C) 2005 Ilya A. Volynets-Evenbakh
7 * Copyright (C) 2005 Ralf Baechle (ralf@linux-mips.org) 7 * Copyright (C) 2005, 07 Ralf Baechle (ralf@linux-mips.org)
8 */ 8 */
9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 9#ifndef __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H 10#define __ASM_MACH_IP32_CPU_FEATURE_OVERRIDES_H
@@ -38,6 +38,8 @@
38#define cpu_has_ic_fills_f_dc 0 38#define cpu_has_ic_fills_f_dc 0
39#define cpu_has_dsp 0 39#define cpu_has_dsp 0
40#define cpu_has_4k_cache 1 40#define cpu_has_4k_cache 1
41#define cpu_has_mipsmt 0
42#define cpu_has_userlocal 0
41 43
42 44
43#define cpu_has_mips32r1 0 45#define cpu_has_mips32r1 0
diff --git a/include/asm-mips/mach-qemu/cpu-feature-overrides.h b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
index 529445dacedb..d2daaed235d5 100644
--- a/include/asm-mips/mach-qemu/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-qemu/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003 Ralf Baechle 6 * Copyright (C) 2003, 07 Ralf Baechle
7 */ 7 */
8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_QEMU_CPU_FEATURE_OVERRIDES_H
@@ -24,6 +24,7 @@
24#define cpu_has_ic_fills_f_dc 0 24#define cpu_has_ic_fills_f_dc 0
25 25
26#define cpu_has_dsp 0 26#define cpu_has_dsp 0
27#define cpu_has_mipsmt 0
27 28
28#define cpu_has_nofpuex 0 29#define cpu_has_nofpuex 0
29#define cpu_has_64bits 0 30#define cpu_has_64bits 0
diff --git a/include/asm-mips/mach-rm/cpu-feature-overrides.h b/include/asm-mips/mach-rm/cpu-feature-overrides.h
index 7e07283140a3..ccf543363537 100644
--- a/include/asm-mips/mach-rm/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-rm/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 * 7 *
8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors. 8 * SNI RM200 C apparently was only shipped with R4600 V2.0 and R5000 processors.
9 */ 9 */
@@ -32,6 +32,8 @@
32#define cpu_has_dsp 0 32#define cpu_has_dsp 0
33#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
34#define cpu_has_64bits 1 34#define cpu_has_64bits 1
35#define cpu_has_mipsmt 0
36#define cpu_has_userlocal 0
35 37
36#define cpu_has_mips32r1 0 38#define cpu_has_mips32r1 0
37#define cpu_has_mips32r2 0 39#define cpu_has_mips32r2 0
diff --git a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
index a25968f277a2..63d5bf649af1 100644
--- a/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-sibyte/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_SIBYTE_CPU_FEATURE_OVERRIDES_H
@@ -26,6 +26,8 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
29#define cpu_icache_snoops_remote_store 0 31#define cpu_icache_snoops_remote_store 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
index 42cebb7ce7a6..470e5e9e10d6 100644
--- a/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
+++ b/include/asm-mips/mach-yosemite/cpu-feature-overrides.h
@@ -3,7 +3,7 @@
3 * License. See the file "COPYING" in the main directory of this archive 3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details. 4 * for more details.
5 * 5 *
6 * Copyright (C) 2003, 2004 Ralf Baechle 6 * Copyright (C) 2003, 04, 07 Ralf Baechle (ralf@linux-mips.org)
7 */ 7 */
8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H 8#ifndef __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H 9#define __ASM_MACH_YOSEMITE_CPU_FEATURE_OVERRIDES_H
@@ -26,6 +26,8 @@
26#define cpu_has_dc_aliases 0 26#define cpu_has_dc_aliases 0
27#define cpu_has_ic_fills_f_dc 0 27#define cpu_has_ic_fills_f_dc 0
28#define cpu_has_dsp 0 28#define cpu_has_dsp 0
29#define cpu_has_mipsmt 0
30#define cpu_has_userlocal 0
29#define cpu_icache_snoops_remote_store 0 31#define cpu_icache_snoops_remote_store 0
30 32
31#define cpu_has_nofpuex 0 33#define cpu_has_nofpuex 0
diff --git a/include/asm-mips/spinlock.h b/include/asm-mips/spinlock.h
index 35e431cd796b..bb897016c491 100644
--- a/include/asm-mips/spinlock.h
+++ b/include/asm-mips/spinlock.h
@@ -67,7 +67,7 @@ static inline void __raw_spin_lock(raw_spinlock_t *lock)
67 : "memory"); 67 : "memory");
68 } 68 }
69 69
70 smp_mb(); 70 smp_llsc_mb();
71} 71}
72 72
73static inline void __raw_spin_unlock(raw_spinlock_t *lock) 73static inline void __raw_spin_unlock(raw_spinlock_t *lock)
@@ -118,7 +118,7 @@ static inline unsigned int __raw_spin_trylock(raw_spinlock_t *lock)
118 : "memory"); 118 : "memory");
119 } 119 }
120 120
121 smp_mb(); 121 smp_llsc_mb();
122 122
123 return res == 0; 123 return res == 0;
124} 124}
@@ -183,7 +183,7 @@ static inline void __raw_read_lock(raw_rwlock_t *rw)
183 : "memory"); 183 : "memory");
184 } 184 }
185 185
186 smp_mb(); 186 smp_llsc_mb();
187} 187}
188 188
189/* Note the use of sub, not subu which will make the kernel die with an 189/* Note the use of sub, not subu which will make the kernel die with an
@@ -193,7 +193,7 @@ static inline void __raw_read_unlock(raw_rwlock_t *rw)
193{ 193{
194 unsigned int tmp; 194 unsigned int tmp;
195 195
196 smp_mb(); 196 smp_llsc_mb();
197 197
198 if (R10000_LLSC_WAR) { 198 if (R10000_LLSC_WAR) {
199 __asm__ __volatile__( 199 __asm__ __volatile__(
@@ -262,7 +262,7 @@ static inline void __raw_write_lock(raw_rwlock_t *rw)
262 : "memory"); 262 : "memory");
263 } 263 }
264 264
265 smp_mb(); 265 smp_llsc_mb();
266} 266}
267 267
268static inline void __raw_write_unlock(raw_rwlock_t *rw) 268static inline void __raw_write_unlock(raw_rwlock_t *rw)
@@ -293,7 +293,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
293 " .set reorder \n" 293 " .set reorder \n"
294 " beqzl %1, 1b \n" 294 " beqzl %1, 1b \n"
295 " nop \n" 295 " nop \n"
296 __WEAK_ORDERING_MB 296 __WEAK_LLSC_MB
297 " li %2, 1 \n" 297 " li %2, 1 \n"
298 "2: \n" 298 "2: \n"
299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) 299 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
@@ -310,7 +310,7 @@ static inline int __raw_read_trylock(raw_rwlock_t *rw)
310 " beqz %1, 1b \n" 310 " beqz %1, 1b \n"
311 " nop \n" 311 " nop \n"
312 " .set reorder \n" 312 " .set reorder \n"
313 __WEAK_ORDERING_MB 313 __WEAK_LLSC_MB
314 " li %2, 1 \n" 314 " li %2, 1 \n"
315 "2: \n" 315 "2: \n"
316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret) 316 : "=m" (rw->lock), "=&r" (tmp), "=&r" (ret)
@@ -336,7 +336,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
336 " sc %1, %0 \n" 336 " sc %1, %0 \n"
337 " beqzl %1, 1b \n" 337 " beqzl %1, 1b \n"
338 " nop \n" 338 " nop \n"
339 __WEAK_ORDERING_MB 339 __WEAK_LLSC_MB
340 " li %2, 1 \n" 340 " li %2, 1 \n"
341 " .set reorder \n" 341 " .set reorder \n"
342 "2: \n" 342 "2: \n"
@@ -354,7 +354,7 @@ static inline int __raw_write_trylock(raw_rwlock_t *rw)
354 " beqz %1, 3f \n" 354 " beqz %1, 3f \n"
355 " li %2, 1 \n" 355 " li %2, 1 \n"
356 "2: \n" 356 "2: \n"
357 __WEAK_ORDERING_MB 357 __WEAK_LLSC_MB
358 " .subsection 2 \n" 358 " .subsection 2 \n"
359 "3: b 1b \n" 359 "3: b 1b \n"
360 " li %2, 0 \n" 360 " li %2, 0 \n"
diff --git a/include/asm-mips/system.h b/include/asm-mips/system.h
index 76339165bc20..8d0b1cd4a45e 100644
--- a/include/asm-mips/system.h
+++ b/include/asm-mips/system.h
@@ -117,7 +117,7 @@ static inline unsigned long __xchg_u32(volatile int * m, unsigned int val)
117 raw_local_irq_restore(flags); /* implies memory barrier */ 117 raw_local_irq_restore(flags); /* implies memory barrier */
118 } 118 }
119 119
120 smp_mb(); 120 smp_llsc_mb();
121 121
122 return retval; 122 return retval;
123} 123}
@@ -165,7 +165,7 @@ static inline __u64 __xchg_u64(volatile __u64 * m, __u64 val)
165 raw_local_irq_restore(flags); /* implies memory barrier */ 165 raw_local_irq_restore(flags); /* implies memory barrier */
166 } 166 }
167 167
168 smp_mb(); 168 smp_llsc_mb();
169 169
170 return retval; 170 return retval;
171} 171}
@@ -246,7 +246,7 @@ static inline unsigned long __cmpxchg_u32(volatile int * m, unsigned long old,
246 raw_local_irq_restore(flags); /* implies memory barrier */ 246 raw_local_irq_restore(flags); /* implies memory barrier */
247 } 247 }
248 248
249 smp_mb(); 249 smp_llsc_mb();
250 250
251 return retval; 251 return retval;
252} 252}
@@ -352,7 +352,7 @@ static inline unsigned long __cmpxchg_u64(volatile int * m, unsigned long old,
352 raw_local_irq_restore(flags); /* implies memory barrier */ 352 raw_local_irq_restore(flags); /* implies memory barrier */
353 } 353 }
354 354
355 smp_mb(); 355 smp_llsc_mb();
356 356
357 return retval; 357 return retval;
358} 358}
@@ -470,6 +470,6 @@ extern int stop_a_enabled;
470 */ 470 */
471#define __ARCH_WANT_UNLOCKED_CTXSW 471#define __ARCH_WANT_UNLOCKED_CTXSW
472 472
473#define arch_align_stack(x) (x) 473extern unsigned long arch_align_stack(unsigned long sp);
474 474
475#endif /* _ASM_SYSTEM_H */ 475#endif /* _ASM_SYSTEM_H */
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index bf297b03a4e4..16ea3374dddf 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -67,6 +67,12 @@ struct clocksource {
67 unsigned long flags; 67 unsigned long flags;
68 cycle_t (*vread)(void); 68 cycle_t (*vread)(void);
69 void (*resume)(void); 69 void (*resume)(void);
70#ifdef CONFIG_IA64
71 void *fsys_mmio; /* used by fsyscall asm code */
72#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
73#else
74#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
75#endif
70 76
71 /* timekeeping specific data, ignore */ 77 /* timekeeping specific data, ignore */
72 cycle_t cycle_interval; 78 cycle_t cycle_interval;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index 7d0ecc1659f0..d859354b9e51 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -40,7 +40,7 @@
40 */ 40 */
41#define ZERO_SIZE_PTR ((void *)16) 41#define ZERO_SIZE_PTR ((void *)16)
42 42
43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) < \ 43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) <= \
44 (unsigned long)ZERO_SIZE_PTR) 44 (unsigned long)ZERO_SIZE_PTR)
45 45
46/* 46/*
diff --git a/include/linux/timex.h b/include/linux/timex.h
index da929dbbea2a..37ac3ff90faf 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -224,66 +224,6 @@ static inline int ntp_synced(void)
224 __x < 0 ? -(-__x >> __s) : __x >> __s; \ 224 __x < 0 ? -(-__x >> __s) : __x >> __s; \
225}) 225})
226 226
227
228#ifdef CONFIG_TIME_INTERPOLATION
229
230#define TIME_SOURCE_CPU 0
231#define TIME_SOURCE_MMIO64 1
232#define TIME_SOURCE_MMIO32 2
233#define TIME_SOURCE_FUNCTION 3
234
235/* For proper operations time_interpolator clocks must run slightly slower
236 * than the standard clock since the interpolator may only correct by having
237 * time jump forward during a tick. A slower clock is usually a side effect
238 * of the integer divide of the nanoseconds in a second by the frequency.
239 * The accuracy of the division can be increased by specifying a shift.
240 * However, this may cause the clock not to be slow enough.
241 * The interpolator will self-tune the clock by slowing down if no
242 * resets occur or speeding up if the time jumps per analysis cycle
243 * become too high.
244 *
245 * Setting jitter compensates for a fluctuating timesource by comparing
246 * to the last value read from the timesource to insure that an earlier value
247 * is not returned by a later call. The price to pay
248 * for the compensation is that the timer routines are not as scalable anymore.
249 */
250
251struct time_interpolator {
252 u16 source; /* time source flags */
253 u8 shift; /* increases accuracy of multiply by shifting. */
254 /* Note that bits may be lost if shift is set too high */
255 u8 jitter; /* if set compensate for fluctuations */
256 u32 nsec_per_cyc; /* set by register_time_interpolator() */
257 void *addr; /* address of counter or function */
258 cycles_t mask; /* mask the valid bits of the counter */
259 unsigned long offset; /* nsec offset at last update of interpolator */
260 u64 last_counter; /* counter value in units of the counter at last update */
261 cycles_t last_cycle; /* Last timer value if TIME_SOURCE_JITTER is set */
262 u64 frequency; /* frequency in counts/second */
263 long drift; /* drift in parts-per-million (or -1) */
264 unsigned long skips; /* skips forward */
265 unsigned long ns_skipped; /* nanoseconds skipped */
266 struct time_interpolator *next;
267};
268
269extern void register_time_interpolator(struct time_interpolator *);
270extern void unregister_time_interpolator(struct time_interpolator *);
271extern void time_interpolator_reset(void);
272extern unsigned long time_interpolator_get_offset(void);
273extern void time_interpolator_update(long delta_nsec);
274
275#else /* !CONFIG_TIME_INTERPOLATION */
276
277static inline void time_interpolator_reset(void)
278{
279}
280
281static inline void time_interpolator_update(long delta_nsec)
282{
283}
284
285#endif /* !CONFIG_TIME_INTERPOLATION */
286
287#define TICK_LENGTH_SHIFT 32 227#define TICK_LENGTH_SHIFT 32
288 228
289#ifdef CONFIG_NO_HZ 229#ifdef CONFIG_NO_HZ