diff options
author | David S. Miller <davem@davemloft.net> | 2010-05-19 02:01:55 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-19 02:01:55 -0400 |
commit | 2ec8c6bb5d8f3a62a79f463525054bae1e3d4487 (patch) | |
tree | fa7f8400ac685fb52e96f64997c7c682fc2aa021 /arch/mips | |
parent | 7b39f90fabcf9e2af0cd79d0a60440d821e22b56 (diff) | |
parent | 537b60d17894b7c19a6060feae40299d7109d6e7 (diff) |
Merge branch 'master' of /home/davem/src/GIT/linux-2.6/
Conflicts:
include/linux/mod_devicetable.h
scripts/mod/file2alias.c
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/atomic.h | 4 | ||||
-rw-r--r-- | arch/mips/include/asm/i8253.h | 2 | ||||
-rw-r--r-- | arch/mips/include/asm/mipsregs.h | 9 | ||||
-rw-r--r-- | arch/mips/kernel/i8253.c | 14 | ||||
-rw-r--r-- | arch/mips/kernel/scall64-n32.S | 2 | ||||
-rw-r--r-- | arch/mips/math-emu/cp1emu.c | 15 | ||||
-rw-r--r-- | arch/mips/oprofile/op_model_loongson2.c | 2 |
7 files changed, 31 insertions, 17 deletions
diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 519197ede089..59dc0c7ef733 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h | |||
@@ -29,7 +29,7 @@ | |||
29 | * | 29 | * |
30 | * Atomically reads the value of @v. | 30 | * Atomically reads the value of @v. |
31 | */ | 31 | */ |
32 | #define atomic_read(v) ((v)->counter) | 32 | #define atomic_read(v) (*(volatile int *)&(v)->counter) |
33 | 33 | ||
34 | /* | 34 | /* |
35 | * atomic_set - set atomic variable | 35 | * atomic_set - set atomic variable |
@@ -410,7 +410,7 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) | |||
410 | * @v: pointer of type atomic64_t | 410 | * @v: pointer of type atomic64_t |
411 | * | 411 | * |
412 | */ | 412 | */ |
413 | #define atomic64_read(v) ((v)->counter) | 413 | #define atomic64_read(v) (*(volatile long *)&(v)->counter) |
414 | 414 | ||
415 | /* | 415 | /* |
416 | * atomic64_set - set atomic variable | 416 | * atomic64_set - set atomic variable |
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h index 032ca73f181b..48bb82372994 100644 --- a/arch/mips/include/asm/i8253.h +++ b/arch/mips/include/asm/i8253.h | |||
@@ -12,7 +12,7 @@ | |||
12 | #define PIT_CH0 0x40 | 12 | #define PIT_CH0 0x40 |
13 | #define PIT_CH2 0x42 | 13 | #define PIT_CH2 0x42 |
14 | 14 | ||
15 | extern spinlock_t i8253_lock; | 15 | extern raw_spinlock_t i8253_lock; |
16 | 16 | ||
17 | extern void setup_pit_timer(void); | 17 | extern void setup_pit_timer(void); |
18 | 18 | ||
diff --git a/arch/mips/include/asm/mipsregs.h b/arch/mips/include/asm/mipsregs.h index 49382d5e891a..c6e3c93ce7c7 100644 --- a/arch/mips/include/asm/mipsregs.h +++ b/arch/mips/include/asm/mipsregs.h | |||
@@ -135,6 +135,12 @@ | |||
135 | #define FPU_CSR_COND7 0x80000000 /* $fcc7 */ | 135 | #define FPU_CSR_COND7 0x80000000 /* $fcc7 */ |
136 | 136 | ||
137 | /* | 137 | /* |
138 | * Bits 18 - 20 of the FPU Status Register will be read as 0, | ||
139 | * and should be written as zero. | ||
140 | */ | ||
141 | #define FPU_CSR_RSVD 0x001c0000 | ||
142 | |||
143 | /* | ||
138 | * X the exception cause indicator | 144 | * X the exception cause indicator |
139 | * E the exception enable | 145 | * E the exception enable |
140 | * S the sticky/flag bit | 146 | * S the sticky/flag bit |
@@ -161,7 +167,8 @@ | |||
161 | #define FPU_CSR_UDF_S 0x00000008 | 167 | #define FPU_CSR_UDF_S 0x00000008 |
162 | #define FPU_CSR_INE_S 0x00000004 | 168 | #define FPU_CSR_INE_S 0x00000004 |
163 | 169 | ||
164 | /* rounding mode */ | 170 | /* Bits 0 and 1 of FPU Status Register specify the rounding mode */ |
171 | #define FPU_CSR_RM 0x00000003 | ||
165 | #define FPU_CSR_RN 0x0 /* nearest */ | 172 | #define FPU_CSR_RN 0x0 /* nearest */ |
166 | #define FPU_CSR_RZ 0x1 /* towards zero */ | 173 | #define FPU_CSR_RZ 0x1 /* towards zero */ |
167 | #define FPU_CSR_RU 0x2 /* towards +Infinity */ | 174 | #define FPU_CSR_RU 0x2 /* towards +Infinity */ |
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c index ed5c441615e4..94794062a177 100644 --- a/arch/mips/kernel/i8253.c +++ b/arch/mips/kernel/i8253.c | |||
@@ -15,7 +15,7 @@ | |||
15 | #include <asm/io.h> | 15 | #include <asm/io.h> |
16 | #include <asm/time.h> | 16 | #include <asm/time.h> |
17 | 17 | ||
18 | DEFINE_SPINLOCK(i8253_lock); | 18 | DEFINE_RAW_SPINLOCK(i8253_lock); |
19 | EXPORT_SYMBOL(i8253_lock); | 19 | EXPORT_SYMBOL(i8253_lock); |
20 | 20 | ||
21 | /* | 21 | /* |
@@ -26,7 +26,7 @@ EXPORT_SYMBOL(i8253_lock); | |||
26 | static void init_pit_timer(enum clock_event_mode mode, | 26 | static void init_pit_timer(enum clock_event_mode mode, |
27 | struct clock_event_device *evt) | 27 | struct clock_event_device *evt) |
28 | { | 28 | { |
29 | spin_lock(&i8253_lock); | 29 | raw_spin_lock(&i8253_lock); |
30 | 30 | ||
31 | switch(mode) { | 31 | switch(mode) { |
32 | case CLOCK_EVT_MODE_PERIODIC: | 32 | case CLOCK_EVT_MODE_PERIODIC: |
@@ -55,7 +55,7 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
55 | /* Nothing to do here */ | 55 | /* Nothing to do here */ |
56 | break; | 56 | break; |
57 | } | 57 | } |
58 | spin_unlock(&i8253_lock); | 58 | raw_spin_unlock(&i8253_lock); |
59 | } | 59 | } |
60 | 60 | ||
61 | /* | 61 | /* |
@@ -65,10 +65,10 @@ static void init_pit_timer(enum clock_event_mode mode, | |||
65 | */ | 65 | */ |
66 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) | 66 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) |
67 | { | 67 | { |
68 | spin_lock(&i8253_lock); | 68 | raw_spin_lock(&i8253_lock); |
69 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ | 69 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ |
70 | outb(delta >> 8 , PIT_CH0); /* MSB */ | 70 | outb(delta >> 8 , PIT_CH0); /* MSB */ |
71 | spin_unlock(&i8253_lock); | 71 | raw_spin_unlock(&i8253_lock); |
72 | 72 | ||
73 | return 0; | 73 | return 0; |
74 | } | 74 | } |
@@ -137,7 +137,7 @@ static cycle_t pit_read(struct clocksource *cs) | |||
137 | static int old_count; | 137 | static int old_count; |
138 | static u32 old_jifs; | 138 | static u32 old_jifs; |
139 | 139 | ||
140 | spin_lock_irqsave(&i8253_lock, flags); | 140 | raw_spin_lock_irqsave(&i8253_lock, flags); |
141 | /* | 141 | /* |
142 | * Although our caller may have the read side of xtime_lock, | 142 | * Although our caller may have the read side of xtime_lock, |
143 | * this is now a seqlock, and we are cheating in this routine | 143 | * this is now a seqlock, and we are cheating in this routine |
@@ -183,7 +183,7 @@ static cycle_t pit_read(struct clocksource *cs) | |||
183 | old_count = count; | 183 | old_count = count; |
184 | old_jifs = jifs; | 184 | old_jifs = jifs; |
185 | 185 | ||
186 | spin_unlock_irqrestore(&i8253_lock, flags); | 186 | raw_spin_unlock_irqrestore(&i8253_lock, flags); |
187 | 187 | ||
188 | count = (LATCH - 1) - count; | 188 | count = (LATCH - 1) - count; |
189 | 189 | ||
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 44337ba03717..a5297e2a353a 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
@@ -385,7 +385,7 @@ EXPORT(sysn32_call_table) | |||
385 | PTR sys_fchmodat | 385 | PTR sys_fchmodat |
386 | PTR sys_faccessat | 386 | PTR sys_faccessat |
387 | PTR compat_sys_pselect6 | 387 | PTR compat_sys_pselect6 |
388 | PTR sys_ppoll /* 6265 */ | 388 | PTR compat_sys_ppoll /* 6265 */ |
389 | PTR sys_unshare | 389 | PTR sys_unshare |
390 | PTR sys_splice | 390 | PTR sys_splice |
391 | PTR sys_sync_file_range | 391 | PTR sys_sync_file_range |
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index 8f2f8e9d8b21..f2338d1c0b48 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
@@ -78,6 +78,9 @@ DEFINE_PER_CPU(struct mips_fpu_emulator_stats, fpuemustats); | |||
78 | #define FPCREG_RID 0 /* $0 = revision id */ | 78 | #define FPCREG_RID 0 /* $0 = revision id */ |
79 | #define FPCREG_CSR 31 /* $31 = csr */ | 79 | #define FPCREG_CSR 31 /* $31 = csr */ |
80 | 80 | ||
81 | /* Determine rounding mode from the RM bits of the FCSR */ | ||
82 | #define modeindex(v) ((v) & FPU_CSR_RM) | ||
83 | |||
81 | /* Convert Mips rounding mode (0..3) to IEEE library modes. */ | 84 | /* Convert Mips rounding mode (0..3) to IEEE library modes. */ |
82 | static const unsigned char ieee_rm[4] = { | 85 | static const unsigned char ieee_rm[4] = { |
83 | [FPU_CSR_RN] = IEEE754_RN, | 86 | [FPU_CSR_RN] = IEEE754_RN, |
@@ -384,10 +387,14 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx) | |||
384 | (void *) (xcp->cp0_epc), | 387 | (void *) (xcp->cp0_epc), |
385 | MIPSInst_RT(ir), value); | 388 | MIPSInst_RT(ir), value); |
386 | #endif | 389 | #endif |
387 | value &= (FPU_CSR_FLUSH | FPU_CSR_ALL_E | FPU_CSR_ALL_S | 0x03); | 390 | |
388 | ctx->fcr31 &= ~(FPU_CSR_FLUSH | FPU_CSR_ALL_E | FPU_CSR_ALL_S | 0x03); | 391 | /* |
389 | /* convert to ieee library modes */ | 392 | * Don't write reserved bits, |
390 | ctx->fcr31 |= (value & ~0x3) | ieee_rm[value & 0x3]; | 393 | * and convert to ieee library modes |
394 | */ | ||
395 | ctx->fcr31 = (value & | ||
396 | ~(FPU_CSR_RSVD | FPU_CSR_RM)) | | ||
397 | ieee_rm[modeindex(value)]; | ||
391 | } | 398 | } |
392 | if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) { | 399 | if ((ctx->fcr31 >> 5) & ctx->fcr31 & FPU_CSR_ALL_E) { |
393 | return SIGFPE; | 400 | return SIGFPE; |
diff --git a/arch/mips/oprofile/op_model_loongson2.c b/arch/mips/oprofile/op_model_loongson2.c index 29e2326b6257..fa3bf661ae29 100644 --- a/arch/mips/oprofile/op_model_loongson2.c +++ b/arch/mips/oprofile/op_model_loongson2.c | |||
@@ -122,7 +122,7 @@ static irqreturn_t loongson2_perfcount_handler(int irq, void *dev_id) | |||
122 | */ | 122 | */ |
123 | 123 | ||
124 | /* Check whether the irq belongs to me */ | 124 | /* Check whether the irq belongs to me */ |
125 | enabled = read_c0_perfcnt() & LOONGSON2_PERFCNT_INT_EN; | 125 | enabled = read_c0_perfctrl() & LOONGSON2_PERFCNT_INT_EN; |
126 | if (!enabled) | 126 | if (!enabled) |
127 | return IRQ_NONE; | 127 | return IRQ_NONE; |
128 | enabled = reg.cnt1_enabled | reg.cnt2_enabled; | 128 | enabled = reg.cnt1_enabled | reg.cnt2_enabled; |