diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-01-10 23:56:42 +0100 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-01-10 23:56:42 +0100 |
commit | 1de8cd3cb9f61e854e743c7210df43db517d4832 (patch) | |
tree | 2b69c5ba5e4094037fa04d0fcb6c4537c222cde8 /arch/mips | |
parent | 1eb1b3b65dc3e3ffcc6a60e115c085c0c11c1077 (diff) | |
parent | 3d14bdad40315b54470cb7812293d14c8af2bf7d (diff) |
Merge branch 'linus' into x86/cleanups
Diffstat (limited to 'arch/mips')
-rw-r--r-- | arch/mips/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/mips/include/asm/atomic.h | 5 | ||||
-rw-r--r-- | arch/mips/include/asm/byteorder.h | 52 | ||||
-rw-r--r-- | arch/mips/include/asm/swab.h | 55 | ||||
-rw-r--r-- | arch/mips/kernel/stacktrace.c | 24 | ||||
-rw-r--r-- | arch/mips/kernel/vpe.c | 2 | ||||
-rw-r--r-- | arch/mips/pci/pci-ip27.c | 6 | ||||
-rw-r--r-- | arch/mips/pci/pci.c | 24 | ||||
-rw-r--r-- | arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c | 2 |
9 files changed, 81 insertions, 90 deletions
diff --git a/arch/mips/include/asm/Kbuild b/arch/mips/include/asm/Kbuild index 7897f05e316..023866c0c10 100644 --- a/arch/mips/include/asm/Kbuild +++ b/arch/mips/include/asm/Kbuild @@ -1,3 +1,4 @@ include include/asm-generic/Kbuild.asm header-y += cachectl.h sgidefs.h sysmips.h +header-y += swab.h diff --git a/arch/mips/include/asm/atomic.h b/arch/mips/include/asm/atomic.h index 1232be3885b..c996c3b4d07 100644 --- a/arch/mips/include/asm/atomic.h +++ b/arch/mips/include/asm/atomic.h @@ -15,13 +15,12 @@ #define _ASM_ATOMIC_H #include <linux/irqflags.h> +#include <linux/types.h> #include <asm/barrier.h> #include <asm/cpu-features.h> #include <asm/war.h> #include <asm/system.h> -typedef struct { volatile int counter; } atomic_t; - #define ATOMIC_INIT(i) { (i) } /* @@ -404,8 +403,6 @@ static __inline__ int atomic_add_unless(atomic_t *v, int a, int u) #ifdef CONFIG_64BIT -typedef struct { volatile long counter; } atomic64_t; - #define ATOMIC64_INIT(i) { (i) } /* diff --git a/arch/mips/include/asm/byteorder.h b/arch/mips/include/asm/byteorder.h index 33790b9e0cc..607b7183070 100644 --- a/arch/mips/include/asm/byteorder.h +++ b/arch/mips/include/asm/byteorder.h @@ -8,60 +8,14 @@ #ifndef _ASM_BYTEORDER_H #define _ASM_BYTEORDER_H -#include <linux/compiler.h> -#include <asm/types.h> +#include <asm/swab.h> #if defined(__MIPSEB__) -# define __BIG_ENDIAN +#include <linux/byteorder/big_endian.h> #elif defined(__MIPSEL__) -# define __LITTLE_ENDIAN +#include <linux/byteorder/little_endian.h> #else # error "MIPS, but neither __MIPSEB__, nor __MIPSEL__???" #endif -#define __SWAB_64_THRU_32__ - -#ifdef CONFIG_CPU_MIPSR2 - -static inline __attribute_const__ __u16 __arch_swab16(__u16 x) -{ - __asm__( - " wsbh %0, %1 \n" - : "=r" (x) - : "r" (x)); - - return x; -} -#define __arch_swab16 __arch_swab16 - -static inline __attribute_const__ __u32 __arch_swab32(__u32 x) -{ - __asm__( - " wsbh %0, %1 \n" - " rotr %0, %0, 16 \n" - : "=r" (x) - : "r" (x)); - - return x; -} -#define __arch_swab32 __arch_swab32 - -#ifdef CONFIG_CPU_MIPS64_R2 -static inline __attribute_const__ __u64 __arch_swab64(__u64 x) -{ - __asm__( - " dsbh %0, %1\n" - " dshd %0, %0" - : "=r" (x) - : "r" (x)); - - return x; -} -#define __arch_swab64 __arch_swab64 -#endif /* CONFIG_CPU_MIPS64_R2 */ - -#endif /* CONFIG_CPU_MIPSR2 */ - -#include <linux/byteorder.h> - #endif /* _ASM_BYTEORDER_H */ diff --git a/arch/mips/include/asm/swab.h b/arch/mips/include/asm/swab.h new file mode 100644 index 00000000000..88f1f7d555c --- /dev/null +++ b/arch/mips/include/asm/swab.h @@ -0,0 +1,55 @@ +/* + * This file is subject to the terms and conditions of the GNU General Public + * License. See the file "COPYING" in the main directory of this archive + * for more details. + * + * Copyright (C) 1996, 99, 2003 by Ralf Baechle + */ +#ifndef _ASM_SWAB_H +#define _ASM_SWAB_H + +#include <linux/compiler.h> +#include <asm/types.h> + +#define __SWAB_64_THRU_32__ + +#ifdef CONFIG_CPU_MIPSR2 + +static inline __attribute_const__ __u16 __arch_swab16(__u16 x) +{ + __asm__( + " wsbh %0, %1 \n" + : "=r" (x) + : "r" (x)); + + return x; +} +#define __arch_swab16 __arch_swab16 + +static inline __attribute_const__ __u32 __arch_swab32(__u32 x) +{ + __asm__( + " wsbh %0, %1 \n" + " rotr %0, %0, 16 \n" + : "=r" (x) + : "r" (x)); + + return x; +} +#define __arch_swab32 __arch_swab32 + +#ifdef CONFIG_CPU_MIPS64_R2 +static inline __attribute_const__ __u64 __arch_swab64(__u64 x) +{ + __asm__( + " dsbh %0, %1\n" + " dshd %0, %0" + : "=r" (x) + : "r" (x)); + + return x; +} +#define __arch_swab64 __arch_swab64 +#endif /* CONFIG_CPU_MIPS64_R2 */ +#endif /* CONFIG_CPU_MIPSR2 */ +#endif /* _ASM_SWAB_H */ diff --git a/arch/mips/kernel/stacktrace.c b/arch/mips/kernel/stacktrace.c index 0632e2a849c..58f5cd76c8c 100644 --- a/arch/mips/kernel/stacktrace.c +++ b/arch/mips/kernel/stacktrace.c @@ -32,7 +32,8 @@ static void save_raw_context_stack(struct stack_trace *trace, } } -static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs) +static void save_context_stack(struct stack_trace *trace, + struct task_struct *tsk, struct pt_regs *regs) { unsigned long sp = regs->regs[29]; #ifdef CONFIG_KALLSYMS @@ -41,7 +42,7 @@ static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs) if (raw_show_trace || !__kernel_text_address(pc)) { unsigned long stack_page = - (unsigned long)task_stack_page(current); + (unsigned long)task_stack_page(tsk); if (stack_page && sp >= stack_page && sp <= stack_page + THREAD_SIZE - 32) save_raw_context_stack(trace, sp); @@ -54,7 +55,7 @@ static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs) trace->entries[trace->nr_entries++] = pc; if (trace->nr_entries >= trace->max_entries) break; - pc = unwind_stack(current, &sp, pc, &ra); + pc = unwind_stack(tsk, &sp, pc, &ra); } while (pc); #else save_raw_context_stack(trace, sp); @@ -66,12 +67,23 @@ static void save_context_stack(struct stack_trace *trace, struct pt_regs *regs) */ void save_stack_trace(struct stack_trace *trace) { + save_stack_trace_tsk(current, trace); +} +EXPORT_SYMBOL_GPL(save_stack_trace); + +void save_stack_trace_tsk(struct task_struct *tsk, struct stack_trace *trace) +{ struct pt_regs dummyregs; struct pt_regs *regs = &dummyregs; WARN_ON(trace->nr_entries || !trace->max_entries); - prepare_frametrace(regs); - save_context_stack(trace, regs); + if (tsk != current) { + regs->regs[29] = tsk->thread.reg29; + regs->regs[31] = 0; + regs->cp0_epc = tsk->thread.reg31; + } else + prepare_frametrace(regs); + save_context_stack(trace, tsk, regs); } -EXPORT_SYMBOL_GPL(save_stack_trace); +EXPORT_SYMBOL_GPL(save_stack_trace_tsk); diff --git a/arch/mips/kernel/vpe.c b/arch/mips/kernel/vpe.c index 010b27e01f7..3ca5f42e819 100644 --- a/arch/mips/kernel/vpe.c +++ b/arch/mips/kernel/vpe.c @@ -1454,7 +1454,7 @@ static int __init vpe_module_init(void) device_initialize(&vpe_device); vpe_device.class = &vpe_class, vpe_device.parent = NULL, - strlcpy(vpe_device.bus_id, "vpe1", BUS_ID_SIZE); + dev_set_name(&vpe_device, "vpe1"); vpe_device.devt = MKDEV(major, minor); err = device_add(&vpe_device); if (err) { diff --git a/arch/mips/pci/pci-ip27.c b/arch/mips/pci/pci-ip27.c index f97ab146101..dda6f205866 100644 --- a/arch/mips/pci/pci-ip27.c +++ b/arch/mips/pci/pci-ip27.c @@ -146,12 +146,6 @@ int __devinit pcibios_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) return 0; } -/* Most MIPS systems have straight-forward swizzling needs. */ -static inline u8 bridge_swizzle(u8 pin, u8 slot) -{ - return (((pin - 1) + slot) % 4) + 1; -} - static inline struct pci_dev *bridge_root_dev(struct pci_dev *dev) { while (dev->bus->parent) { diff --git a/arch/mips/pci/pci.c b/arch/mips/pci/pci.c index 62cae740e25..b0eb9e75c68 100644 --- a/arch/mips/pci/pci.c +++ b/arch/mips/pci/pci.c @@ -149,28 +149,6 @@ out: "Skipping PCI bus scan due to resource conflict\n"); } -/* Most MIPS systems have straight-forward swizzling needs. */ - -static inline u8 bridge_swizzle(u8 pin, u8 slot) -{ - return (((pin - 1) + slot) % 4) + 1; -} - -static u8 __init common_swizzle(struct pci_dev *dev, u8 *pinp) -{ - u8 pin = *pinp; - - while (dev->bus->parent) { - pin = bridge_swizzle(pin, PCI_SLOT(dev->devfn)); - /* Move up the chain of bridges. */ - dev = dev->bus->self; - } - *pinp = pin; - - /* The slot is the slot of the last bridge. */ - return PCI_SLOT(dev->devfn); -} - static int __init pcibios_init(void) { struct pci_controller *hose; @@ -179,7 +157,7 @@ static int __init pcibios_init(void) for (hose = hose_head; hose; hose = hose->next) pcibios_scanbus(hose); - pci_fixup_irqs(common_swizzle, pcibios_map_irq); + pci_fixup_irqs(pci_common_swizzle, pcibios_map_irq); pci_initialized = 1; diff --git a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c index 97862f45496..caf5e9a0acc 100644 --- a/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c +++ b/arch/mips/pmc-sierra/yosemite/atmel_read_eeprom.c @@ -148,7 +148,7 @@ int read_eeprom(char *buffer, int eeprom_size, int size) send_byte(W_HEADER); recv_ack(); - /* EEPROM with size of more then 2K need two byte addressing */ + /* EEPROM with size of more than 2K need two byte addressing */ if (eeprom_size > 2048) { send_byte(0x00); recv_ack(); |