diff options
Diffstat (limited to 'arch/mips')
29 files changed, 260 insertions, 200 deletions
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 653da62d0682..177cdaf83564 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -185,6 +185,7 @@ config MACH_JAZZ | |||
185 | select CSRC_R4K | 185 | select CSRC_R4K |
186 | select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN | 186 | select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN |
187 | select GENERIC_ISA_DMA | 187 | select GENERIC_ISA_DMA |
188 | select HAVE_PCSPKR_PLATFORM | ||
188 | select IRQ_CPU | 189 | select IRQ_CPU |
189 | select I8253 | 190 | select I8253 |
190 | select I8259 | 191 | select I8259 |
@@ -266,6 +267,7 @@ config MIPS_MALTA | |||
266 | select CSRC_R4K | 267 | select CSRC_R4K |
267 | select DMA_NONCOHERENT | 268 | select DMA_NONCOHERENT |
268 | select GENERIC_ISA_DMA | 269 | select GENERIC_ISA_DMA |
270 | select HAVE_PCSPKR_PLATFORM | ||
269 | select IRQ_CPU | 271 | select IRQ_CPU |
270 | select IRQ_GIC | 272 | select IRQ_GIC |
271 | select HW_HAS_PCI | 273 | select HW_HAS_PCI |
@@ -640,6 +642,7 @@ config SNI_RM | |||
640 | select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN | 642 | select DEFAULT_SGI_PARTITION if CPU_BIG_ENDIAN |
641 | select DMA_NONCOHERENT | 643 | select DMA_NONCOHERENT |
642 | select GENERIC_ISA_DMA | 644 | select GENERIC_ISA_DMA |
645 | select HAVE_PCSPKR_PLATFORM | ||
643 | select HW_HAS_EISA | 646 | select HW_HAS_EISA |
644 | select HW_HAS_PCI | 647 | select HW_HAS_PCI |
645 | select IRQ_CPU | 648 | select IRQ_CPU |
@@ -2388,6 +2391,7 @@ config MMU | |||
2388 | config I8253 | 2391 | config I8253 |
2389 | bool | 2392 | bool |
2390 | select CLKSRC_I8253 | 2393 | select CLKSRC_I8253 |
2394 | select CLKEVT_I8253 | ||
2391 | select MIPS_EXTERNAL_TIMER | 2395 | select MIPS_EXTERNAL_TIMER |
2392 | 2396 | ||
2393 | config ZONE_DMA32 | 2397 | config ZONE_DMA32 |
@@ -2489,20 +2493,4 @@ source "security/Kconfig" | |||
2489 | 2493 | ||
2490 | source "crypto/Kconfig" | 2494 | source "crypto/Kconfig" |
2491 | 2495 | ||
2492 | menuconfig VIRTUALIZATION | ||
2493 | bool "Virtualization" | ||
2494 | default n | ||
2495 | ---help--- | ||
2496 | Say Y here to get to see options for using your Linux host to run other | ||
2497 | operating systems inside virtual machines (guests). | ||
2498 | This option alone does not add any kernel code. | ||
2499 | |||
2500 | If you say N, all options in this submenu will be skipped and disabled. | ||
2501 | |||
2502 | if VIRTUALIZATION | ||
2503 | |||
2504 | source drivers/virtio/Kconfig | ||
2505 | |||
2506 | endif # VIRTUALIZATION | ||
2507 | |||
2508 | source "lib/Kconfig" | 2496 | source "lib/Kconfig" |
diff --git a/arch/mips/bcm47xx/setup.c b/arch/mips/bcm47xx/setup.c index 73b529b57433..cfae81571ded 100644 --- a/arch/mips/bcm47xx/setup.c +++ b/arch/mips/bcm47xx/setup.c | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> | 2 | * Copyright (C) 2004 Florian Schirmer <jolt@tuxbox.org> |
3 | * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> | 3 | * Copyright (C) 2006 Felix Fietkau <nbd@openwrt.org> |
4 | * Copyright (C) 2006 Michael Buesch <mb@bu3sch.de> | 4 | * Copyright (C) 2006 Michael Buesch <m@bues.ch> |
5 | * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> | 5 | * Copyright (C) 2010 Waldemar Brodkorb <wbx@openadk.org> |
6 | * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de> | 6 | * Copyright (C) 2010-2011 Hauke Mehrtens <hauke@hauke-m.de> |
7 | * | 7 | * |
diff --git a/arch/mips/cobalt/time.c b/arch/mips/cobalt/time.c index 0162f9edc693..3bff3b820baf 100644 --- a/arch/mips/cobalt/time.c +++ b/arch/mips/cobalt/time.c | |||
@@ -17,10 +17,10 @@ | |||
17 | * along with this program; if not, write to the Free Software | 17 | * along with this program; if not, write to the Free Software |
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
19 | */ | 19 | */ |
20 | #include <linux/i8253.h> | ||
20 | #include <linux/init.h> | 21 | #include <linux/init.h> |
21 | 22 | ||
22 | #include <asm/gt64120.h> | 23 | #include <asm/gt64120.h> |
23 | #include <asm/i8253.h> | ||
24 | #include <asm/time.h> | 24 | #include <asm/time.h> |
25 | 25 | ||
26 | #define GT641XX_BASE_CLOCK 50000000 /* 50MHz */ | 26 | #define GT641XX_BASE_CLOCK 50000000 /* 50MHz */ |
diff --git a/arch/mips/include/asm/floppy.h b/arch/mips/include/asm/floppy.h index c5c7c0e6064c..4456c9c47e21 100644 --- a/arch/mips/include/asm/floppy.h +++ b/arch/mips/include/asm/floppy.h | |||
@@ -29,7 +29,7 @@ static inline void fd_cacheflush(char * addr, long size) | |||
29 | #define FLOPPY0_TYPE fd_drive_type(0) | 29 | #define FLOPPY0_TYPE fd_drive_type(0) |
30 | #define FLOPPY1_TYPE fd_drive_type(1) | 30 | #define FLOPPY1_TYPE fd_drive_type(1) |
31 | 31 | ||
32 | #define FDC1 fd_getfdaddr1(); | 32 | #define FDC1 fd_getfdaddr1() |
33 | 33 | ||
34 | #define N_FDC 1 /* do you *really* want a second controller? */ | 34 | #define N_FDC 1 /* do you *really* want a second controller? */ |
35 | #define N_DRIVE 8 | 35 | #define N_DRIVE 8 |
diff --git a/arch/mips/include/asm/i8253.h b/arch/mips/include/asm/i8253.h deleted file mode 100644 index 9ad011366f73..000000000000 --- a/arch/mips/include/asm/i8253.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * Machine specific IO port address definition for generic. | ||
3 | * Written by Osamu Tomita <tomita@cinet.co.jp> | ||
4 | */ | ||
5 | #ifndef __ASM_I8253_H | ||
6 | #define __ASM_I8253_H | ||
7 | |||
8 | #include <linux/spinlock.h> | ||
9 | |||
10 | /* i8253A PIT registers */ | ||
11 | #define PIT_MODE 0x43 | ||
12 | #define PIT_CH0 0x40 | ||
13 | #define PIT_CH2 0x42 | ||
14 | |||
15 | #define PIT_LATCH LATCH | ||
16 | |||
17 | extern raw_spinlock_t i8253_lock; | ||
18 | |||
19 | extern void setup_pit_timer(void); | ||
20 | |||
21 | #define inb_pit inb_p | ||
22 | #define outb_pit outb_p | ||
23 | |||
24 | #endif /* __ASM_I8253_H */ | ||
diff --git a/arch/mips/include/asm/mach-jz4740/gpio.h b/arch/mips/include/asm/mach-jz4740/gpio.h index 7b74703745bb..1a6482ea0bb3 100644 --- a/arch/mips/include/asm/mach-jz4740/gpio.h +++ b/arch/mips/include/asm/mach-jz4740/gpio.h | |||
@@ -25,14 +25,13 @@ enum jz_gpio_function { | |||
25 | JZ_GPIO_FUNC3, | 25 | JZ_GPIO_FUNC3, |
26 | }; | 26 | }; |
27 | 27 | ||
28 | |||
29 | /* | 28 | /* |
30 | Usually a driver for a SoC component has to request several gpio pins and | 29 | Usually a driver for a SoC component has to request several gpio pins and |
31 | configure them as funcion pins. | 30 | configure them as funcion pins. |
32 | jz_gpio_bulk_request can be used to ease this process. | 31 | jz_gpio_bulk_request can be used to ease this process. |
33 | Usually one would do something like: | 32 | Usually one would do something like: |
34 | 33 | ||
35 | const static struct jz_gpio_bulk_request i2c_pins[] = { | 34 | static const struct jz_gpio_bulk_request i2c_pins[] = { |
36 | JZ_GPIO_BULK_PIN(I2C_SDA), | 35 | JZ_GPIO_BULK_PIN(I2C_SDA), |
37 | JZ_GPIO_BULK_PIN(I2C_SCK), | 36 | JZ_GPIO_BULK_PIN(I2C_SCK), |
38 | }; | 37 | }; |
@@ -47,8 +46,8 @@ enum jz_gpio_function { | |||
47 | 46 | ||
48 | jz_gpio_bulk_free(i2c_pins, ARRAY_SIZE(i2c_pins)); | 47 | jz_gpio_bulk_free(i2c_pins, ARRAY_SIZE(i2c_pins)); |
49 | 48 | ||
50 | |||
51 | */ | 49 | */ |
50 | |||
52 | struct jz_gpio_bulk_request { | 51 | struct jz_gpio_bulk_request { |
53 | int gpio; | 52 | int gpio; |
54 | const char *name; | 53 | const char *name; |
diff --git a/arch/mips/include/asm/stacktrace.h b/arch/mips/include/asm/stacktrace.h index 0bf82818aa53..780ee2c2a2ac 100644 --- a/arch/mips/include/asm/stacktrace.h +++ b/arch/mips/include/asm/stacktrace.h | |||
@@ -7,6 +7,10 @@ | |||
7 | extern int raw_show_trace; | 7 | extern int raw_show_trace; |
8 | extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | 8 | extern unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, |
9 | unsigned long pc, unsigned long *ra); | 9 | unsigned long pc, unsigned long *ra); |
10 | extern unsigned long unwind_stack_by_address(unsigned long stack_page, | ||
11 | unsigned long *sp, | ||
12 | unsigned long pc, | ||
13 | unsigned long *ra); | ||
10 | #else | 14 | #else |
11 | #define raw_show_trace 1 | 15 | #define raw_show_trace 1 |
12 | static inline unsigned long unwind_stack(struct task_struct *task, | 16 | static inline unsigned long unwind_stack(struct task_struct *task, |
diff --git a/arch/mips/jazz/irq.c b/arch/mips/jazz/irq.c index 260df4750949..ca9bd2069142 100644 --- a/arch/mips/jazz/irq.c +++ b/arch/mips/jazz/irq.c | |||
@@ -7,6 +7,7 @@ | |||
7 | * Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle | 7 | * Copyright (C) 1994 - 2001, 2003, 07 Ralf Baechle |
8 | */ | 8 | */ |
9 | #include <linux/clockchips.h> | 9 | #include <linux/clockchips.h> |
10 | #include <linux/i8253.h> | ||
10 | #include <linux/init.h> | 11 | #include <linux/init.h> |
11 | #include <linux/interrupt.h> | 12 | #include <linux/interrupt.h> |
12 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
@@ -15,7 +16,6 @@ | |||
15 | #include <linux/irq.h> | 16 | #include <linux/irq.h> |
16 | 17 | ||
17 | #include <asm/irq_cpu.h> | 18 | #include <asm/irq_cpu.h> |
18 | #include <asm/i8253.h> | ||
19 | #include <asm/i8259.h> | 19 | #include <asm/i8259.h> |
20 | #include <asm/io.h> | 20 | #include <asm/io.h> |
21 | #include <asm/jazz.h> | 21 | #include <asm/jazz.h> |
diff --git a/arch/mips/kernel/i8253.c b/arch/mips/kernel/i8253.c index 391221b6a6aa..be4ee7d63e04 100644 --- a/arch/mips/kernel/i8253.c +++ b/arch/mips/kernel/i8253.c | |||
@@ -3,96 +3,16 @@ | |||
3 | * | 3 | * |
4 | */ | 4 | */ |
5 | #include <linux/clockchips.h> | 5 | #include <linux/clockchips.h> |
6 | #include <linux/init.h> | 6 | #include <linux/i8253.h> |
7 | #include <linux/interrupt.h> | ||
8 | #include <linux/jiffies.h> | ||
9 | #include <linux/module.h> | 7 | #include <linux/module.h> |
10 | #include <linux/smp.h> | 8 | #include <linux/smp.h> |
11 | #include <linux/spinlock.h> | ||
12 | #include <linux/irq.h> | 9 | #include <linux/irq.h> |
13 | 10 | ||
14 | #include <asm/delay.h> | ||
15 | #include <asm/i8253.h> | ||
16 | #include <asm/io.h> | ||
17 | #include <asm/time.h> | 11 | #include <asm/time.h> |
18 | 12 | ||
19 | DEFINE_RAW_SPINLOCK(i8253_lock); | ||
20 | EXPORT_SYMBOL(i8253_lock); | ||
21 | |||
22 | /* | ||
23 | * Initialize the PIT timer. | ||
24 | * | ||
25 | * This is also called after resume to bring the PIT into operation again. | ||
26 | */ | ||
27 | static void init_pit_timer(enum clock_event_mode mode, | ||
28 | struct clock_event_device *evt) | ||
29 | { | ||
30 | raw_spin_lock(&i8253_lock); | ||
31 | |||
32 | switch(mode) { | ||
33 | case CLOCK_EVT_MODE_PERIODIC: | ||
34 | /* binary, mode 2, LSB/MSB, ch 0 */ | ||
35 | outb_p(0x34, PIT_MODE); | ||
36 | outb_p(LATCH & 0xff , PIT_CH0); /* LSB */ | ||
37 | outb(LATCH >> 8 , PIT_CH0); /* MSB */ | ||
38 | break; | ||
39 | |||
40 | case CLOCK_EVT_MODE_SHUTDOWN: | ||
41 | case CLOCK_EVT_MODE_UNUSED: | ||
42 | if (evt->mode == CLOCK_EVT_MODE_PERIODIC || | ||
43 | evt->mode == CLOCK_EVT_MODE_ONESHOT) { | ||
44 | outb_p(0x30, PIT_MODE); | ||
45 | outb_p(0, PIT_CH0); | ||
46 | outb_p(0, PIT_CH0); | ||
47 | } | ||
48 | break; | ||
49 | |||
50 | case CLOCK_EVT_MODE_ONESHOT: | ||
51 | /* One shot setup */ | ||
52 | outb_p(0x38, PIT_MODE); | ||
53 | break; | ||
54 | |||
55 | case CLOCK_EVT_MODE_RESUME: | ||
56 | /* Nothing to do here */ | ||
57 | break; | ||
58 | } | ||
59 | raw_spin_unlock(&i8253_lock); | ||
60 | } | ||
61 | |||
62 | /* | ||
63 | * Program the next event in oneshot mode | ||
64 | * | ||
65 | * Delta is given in PIT ticks | ||
66 | */ | ||
67 | static int pit_next_event(unsigned long delta, struct clock_event_device *evt) | ||
68 | { | ||
69 | raw_spin_lock(&i8253_lock); | ||
70 | outb_p(delta & 0xff , PIT_CH0); /* LSB */ | ||
71 | outb(delta >> 8 , PIT_CH0); /* MSB */ | ||
72 | raw_spin_unlock(&i8253_lock); | ||
73 | |||
74 | return 0; | ||
75 | } | ||
76 | |||
77 | /* | ||
78 | * On UP the PIT can serve all of the possible timer functions. On SMP systems | ||
79 | * it can be solely used for the global tick. | ||
80 | * | ||
81 | * The profiling and update capabilites are switched off once the local apic is | ||
82 | * registered. This mechanism replaces the previous #ifdef LOCAL_APIC - | ||
83 | * !using_apic_timer decisions in do_timer_interrupt_hook() | ||
84 | */ | ||
85 | static struct clock_event_device pit_clockevent = { | ||
86 | .name = "pit", | ||
87 | .features = CLOCK_EVT_FEAT_PERIODIC | CLOCK_EVT_FEAT_ONESHOT, | ||
88 | .set_mode = init_pit_timer, | ||
89 | .set_next_event = pit_next_event, | ||
90 | .irq = 0, | ||
91 | }; | ||
92 | |||
93 | static irqreturn_t timer_interrupt(int irq, void *dev_id) | 13 | static irqreturn_t timer_interrupt(int irq, void *dev_id) |
94 | { | 14 | { |
95 | pit_clockevent.event_handler(&pit_clockevent); | 15 | i8253_clockevent.event_handler(&i8253_clockevent); |
96 | 16 | ||
97 | return IRQ_HANDLED; | 17 | return IRQ_HANDLED; |
98 | } | 18 | } |
@@ -103,25 +23,9 @@ static struct irqaction irq0 = { | |||
103 | .name = "timer" | 23 | .name = "timer" |
104 | }; | 24 | }; |
105 | 25 | ||
106 | /* | ||
107 | * Initialize the conversion factor and the min/max deltas of the clock event | ||
108 | * structure and register the clock event source with the framework. | ||
109 | */ | ||
110 | void __init setup_pit_timer(void) | 26 | void __init setup_pit_timer(void) |
111 | { | 27 | { |
112 | struct clock_event_device *cd = &pit_clockevent; | 28 | clockevent_i8253_init(true); |
113 | unsigned int cpu = smp_processor_id(); | ||
114 | |||
115 | /* | ||
116 | * Start pit with the boot cpu mask and make it global after the | ||
117 | * IO_APIC has been initialized. | ||
118 | */ | ||
119 | cd->cpumask = cpumask_of(cpu); | ||
120 | clockevent_set_clock(cd, CLOCK_TICK_RATE); | ||
121 | cd->max_delta_ns = clockevent_delta2ns(0x7FFF, cd); | ||
122 | cd->min_delta_ns = clockevent_delta2ns(0xF, cd); | ||
123 | clockevents_register_device(cd); | ||
124 | |||
125 | setup_irq(0, &irq0); | 29 | setup_irq(0, &irq0); |
126 | } | 30 | } |
127 | 31 | ||
diff --git a/arch/mips/kernel/module.c b/arch/mips/kernel/module.c index dd940b701963..4b930ac4aff2 100644 --- a/arch/mips/kernel/module.c +++ b/arch/mips/kernel/module.c | |||
@@ -45,30 +45,14 @@ static struct mips_hi16 *mips_hi16_list; | |||
45 | static LIST_HEAD(dbe_list); | 45 | static LIST_HEAD(dbe_list); |
46 | static DEFINE_SPINLOCK(dbe_lock); | 46 | static DEFINE_SPINLOCK(dbe_lock); |
47 | 47 | ||
48 | #ifdef MODULE_START | ||
48 | void *module_alloc(unsigned long size) | 49 | void *module_alloc(unsigned long size) |
49 | { | 50 | { |
50 | #ifdef MODULE_START | ||
51 | return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END, | 51 | return __vmalloc_node_range(size, 1, MODULE_START, MODULE_END, |
52 | GFP_KERNEL, PAGE_KERNEL, -1, | 52 | GFP_KERNEL, PAGE_KERNEL, -1, |
53 | __builtin_return_address(0)); | 53 | __builtin_return_address(0)); |
54 | #else | ||
55 | if (size == 0) | ||
56 | return NULL; | ||
57 | return vmalloc(size); | ||
58 | #endif | ||
59 | } | ||
60 | |||
61 | /* Free memory returned from module_alloc */ | ||
62 | void module_free(struct module *mod, void *module_region) | ||
63 | { | ||
64 | vfree(module_region); | ||
65 | } | ||
66 | |||
67 | int module_frob_arch_sections(Elf_Ehdr *hdr, Elf_Shdr *sechdrs, | ||
68 | char *secstrings, struct module *mod) | ||
69 | { | ||
70 | return 0; | ||
71 | } | 54 | } |
55 | #endif | ||
72 | 56 | ||
73 | static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v) | 57 | static int apply_r_mips_none(struct module *me, u32 *location, Elf_Addr v) |
74 | { | 58 | { |
diff --git a/arch/mips/kernel/perf_event.c b/arch/mips/kernel/perf_event.c index ff1840f8e764..0aee944ac380 100644 --- a/arch/mips/kernel/perf_event.c +++ b/arch/mips/kernel/perf_event.c | |||
@@ -525,7 +525,7 @@ handle_associated_event(struct cpu_hw_events *cpuc, | |||
525 | if (!mipspmu_event_set_period(event, hwc, idx)) | 525 | if (!mipspmu_event_set_period(event, hwc, idx)) |
526 | return; | 526 | return; |
527 | 527 | ||
528 | if (perf_event_overflow(event, 0, data, regs)) | 528 | if (perf_event_overflow(event, data, regs)) |
529 | mipspmu->disable_event(idx); | 529 | mipspmu->disable_event(idx); |
530 | } | 530 | } |
531 | 531 | ||
diff --git a/arch/mips/kernel/perf_event_mipsxx.c b/arch/mips/kernel/perf_event_mipsxx.c index 75266ff4cc33..e5ad09a9baf7 100644 --- a/arch/mips/kernel/perf_event_mipsxx.c +++ b/arch/mips/kernel/perf_event_mipsxx.c | |||
@@ -377,6 +377,20 @@ static const struct mips_perf_event mipsxxcore_cache_map | |||
377 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | 377 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, |
378 | }, | 378 | }, |
379 | }, | 379 | }, |
380 | [C(NODE)] = { | ||
381 | [C(OP_READ)] = { | ||
382 | [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
383 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
384 | }, | ||
385 | [C(OP_WRITE)] = { | ||
386 | [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
387 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
388 | }, | ||
389 | [C(OP_PREFETCH)] = { | ||
390 | [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
391 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
392 | }, | ||
393 | }, | ||
380 | }; | 394 | }; |
381 | 395 | ||
382 | /* 74K core has completely different cache event map. */ | 396 | /* 74K core has completely different cache event map. */ |
@@ -480,6 +494,20 @@ static const struct mips_perf_event mipsxx74Kcore_cache_map | |||
480 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | 494 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, |
481 | }, | 495 | }, |
482 | }, | 496 | }, |
497 | [C(NODE)] = { | ||
498 | [C(OP_READ)] = { | ||
499 | [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
500 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
501 | }, | ||
502 | [C(OP_WRITE)] = { | ||
503 | [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
504 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
505 | }, | ||
506 | [C(OP_PREFETCH)] = { | ||
507 | [C(RESULT_ACCESS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
508 | [C(RESULT_MISS)] = { UNSUPPORTED_PERF_EVENT_ID }, | ||
509 | }, | ||
510 | }, | ||
483 | }; | 511 | }; |
484 | 512 | ||
485 | #ifdef CONFIG_MIPS_MT_SMP | 513 | #ifdef CONFIG_MIPS_MT_SMP |
diff --git a/arch/mips/kernel/process.c b/arch/mips/kernel/process.c index a8d53e508bb7..b30cb2573aaf 100644 --- a/arch/mips/kernel/process.c +++ b/arch/mips/kernel/process.c | |||
@@ -372,18 +372,18 @@ unsigned long thread_saved_pc(struct task_struct *tsk) | |||
372 | 372 | ||
373 | 373 | ||
374 | #ifdef CONFIG_KALLSYMS | 374 | #ifdef CONFIG_KALLSYMS |
375 | /* used by show_backtrace() */ | 375 | /* generic stack unwinding function */ |
376 | unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | 376 | unsigned long notrace unwind_stack_by_address(unsigned long stack_page, |
377 | unsigned long pc, unsigned long *ra) | 377 | unsigned long *sp, |
378 | unsigned long pc, | ||
379 | unsigned long *ra) | ||
378 | { | 380 | { |
379 | unsigned long stack_page; | ||
380 | struct mips_frame_info info; | 381 | struct mips_frame_info info; |
381 | unsigned long size, ofs; | 382 | unsigned long size, ofs; |
382 | int leaf; | 383 | int leaf; |
383 | extern void ret_from_irq(void); | 384 | extern void ret_from_irq(void); |
384 | extern void ret_from_exception(void); | 385 | extern void ret_from_exception(void); |
385 | 386 | ||
386 | stack_page = (unsigned long)task_stack_page(task); | ||
387 | if (!stack_page) | 387 | if (!stack_page) |
388 | return 0; | 388 | return 0; |
389 | 389 | ||
@@ -442,6 +442,15 @@ unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | |||
442 | *ra = 0; | 442 | *ra = 0; |
443 | return __kernel_text_address(pc) ? pc : 0; | 443 | return __kernel_text_address(pc) ? pc : 0; |
444 | } | 444 | } |
445 | EXPORT_SYMBOL(unwind_stack_by_address); | ||
446 | |||
447 | /* used by show_backtrace() */ | ||
448 | unsigned long unwind_stack(struct task_struct *task, unsigned long *sp, | ||
449 | unsigned long pc, unsigned long *ra) | ||
450 | { | ||
451 | unsigned long stack_page = (unsigned long)task_stack_page(task); | ||
452 | return unwind_stack_by_address(stack_page, sp, pc, ra); | ||
453 | } | ||
445 | #endif | 454 | #endif |
446 | 455 | ||
447 | /* | 456 | /* |
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index e9b3af27d844..b7517e3abc85 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
@@ -578,12 +578,12 @@ static int simulate_llsc(struct pt_regs *regs, unsigned int opcode) | |||
578 | { | 578 | { |
579 | if ((opcode & OPCODE) == LL) { | 579 | if ((opcode & OPCODE) == LL) { |
580 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, | 580 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, |
581 | 1, 0, regs, 0); | 581 | 1, regs, 0); |
582 | return simulate_ll(regs, opcode); | 582 | return simulate_ll(regs, opcode); |
583 | } | 583 | } |
584 | if ((opcode & OPCODE) == SC) { | 584 | if ((opcode & OPCODE) == SC) { |
585 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, | 585 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, |
586 | 1, 0, regs, 0); | 586 | 1, regs, 0); |
587 | return simulate_sc(regs, opcode); | 587 | return simulate_sc(regs, opcode); |
588 | } | 588 | } |
589 | 589 | ||
@@ -602,7 +602,7 @@ static int simulate_rdhwr(struct pt_regs *regs, unsigned int opcode) | |||
602 | int rd = (opcode & RD) >> 11; | 602 | int rd = (opcode & RD) >> 11; |
603 | int rt = (opcode & RT) >> 16; | 603 | int rt = (opcode & RT) >> 16; |
604 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, | 604 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, |
605 | 1, 0, regs, 0); | 605 | 1, regs, 0); |
606 | switch (rd) { | 606 | switch (rd) { |
607 | case 0: /* CPU number */ | 607 | case 0: /* CPU number */ |
608 | regs->regs[rt] = smp_processor_id(); | 608 | regs->regs[rt] = smp_processor_id(); |
@@ -640,7 +640,7 @@ static int simulate_sync(struct pt_regs *regs, unsigned int opcode) | |||
640 | { | 640 | { |
641 | if ((opcode & OPCODE) == SPEC0 && (opcode & FUNC) == SYNC) { | 641 | if ((opcode & OPCODE) == SPEC0 && (opcode & FUNC) == SYNC) { |
642 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, | 642 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, |
643 | 1, 0, regs, 0); | 643 | 1, regs, 0); |
644 | return 0; | 644 | return 0; |
645 | } | 645 | } |
646 | 646 | ||
diff --git a/arch/mips/kernel/unaligned.c b/arch/mips/kernel/unaligned.c index cfea1adfa153..eb319b580353 100644 --- a/arch/mips/kernel/unaligned.c +++ b/arch/mips/kernel/unaligned.c | |||
@@ -111,8 +111,7 @@ static void emulate_load_store_insn(struct pt_regs *regs, | |||
111 | unsigned long value; | 111 | unsigned long value; |
112 | unsigned int res; | 112 | unsigned int res; |
113 | 113 | ||
114 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, | 114 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, regs, 0); |
115 | 1, 0, regs, 0); | ||
116 | 115 | ||
117 | /* | 116 | /* |
118 | * This load never faults. | 117 | * This load never faults. |
@@ -517,7 +516,7 @@ asmlinkage void do_ade(struct pt_regs *regs) | |||
517 | mm_segment_t seg; | 516 | mm_segment_t seg; |
518 | 517 | ||
519 | perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, | 518 | perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, |
520 | 1, 0, regs, regs->cp0_badvaddr); | 519 | 1, regs, regs->cp0_badvaddr); |
521 | /* | 520 | /* |
522 | * Did we catch a fault trying to load an instruction? | 521 | * Did we catch a fault trying to load an instruction? |
523 | * Or are we running in MIPS16 mode? | 522 | * Or are we running in MIPS16 mode? |
diff --git a/arch/mips/lantiq/devices.c b/arch/mips/lantiq/devices.c index 7b82c34cb169..44a36771c819 100644 --- a/arch/mips/lantiq/devices.c +++ b/arch/mips/lantiq/devices.c | |||
@@ -15,11 +15,9 @@ | |||
15 | #include <linux/platform_device.h> | 15 | #include <linux/platform_device.h> |
16 | #include <linux/leds.h> | 16 | #include <linux/leds.h> |
17 | #include <linux/etherdevice.h> | 17 | #include <linux/etherdevice.h> |
18 | #include <linux/reboot.h> | ||
19 | #include <linux/time.h> | 18 | #include <linux/time.h> |
20 | #include <linux/io.h> | 19 | #include <linux/io.h> |
21 | #include <linux/gpio.h> | 20 | #include <linux/gpio.h> |
22 | #include <linux/leds.h> | ||
23 | 21 | ||
24 | #include <asm/bootinfo.h> | 22 | #include <asm/bootinfo.h> |
25 | #include <asm/irq.h> | 23 | #include <asm/irq.h> |
diff --git a/arch/mips/lantiq/xway/devices.c b/arch/mips/lantiq/xway/devices.c index e09e789dfc27..d0e32ab2ea07 100644 --- a/arch/mips/lantiq/xway/devices.c +++ b/arch/mips/lantiq/xway/devices.c | |||
@@ -16,11 +16,9 @@ | |||
16 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
17 | #include <linux/leds.h> | 17 | #include <linux/leds.h> |
18 | #include <linux/etherdevice.h> | 18 | #include <linux/etherdevice.h> |
19 | #include <linux/reboot.h> | ||
20 | #include <linux/time.h> | 19 | #include <linux/time.h> |
21 | #include <linux/io.h> | 20 | #include <linux/io.h> |
22 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
23 | #include <linux/leds.h> | ||
24 | 22 | ||
25 | #include <asm/bootinfo.h> | 23 | #include <asm/bootinfo.h> |
26 | #include <asm/irq.h> | 24 | #include <asm/irq.h> |
diff --git a/arch/mips/math-emu/cp1emu.c b/arch/mips/math-emu/cp1emu.c index d32cb0503110..dbf2f93a5091 100644 --- a/arch/mips/math-emu/cp1emu.c +++ b/arch/mips/math-emu/cp1emu.c | |||
@@ -272,8 +272,7 @@ static int cop1Emulate(struct pt_regs *xcp, struct mips_fpu_struct *ctx, | |||
272 | } | 272 | } |
273 | 273 | ||
274 | emul: | 274 | emul: |
275 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, | 275 | perf_sw_event(PERF_COUNT_SW_EMULATION_FAULTS, 1, xcp, 0); |
276 | 1, 0, xcp, 0); | ||
277 | MIPS_FPU_EMU_INC_STATS(emulated); | 276 | MIPS_FPU_EMU_INC_STATS(emulated); |
278 | switch (MIPSInst_OPCODE(ir)) { | 277 | switch (MIPSInst_OPCODE(ir)) { |
279 | case ldc1_op:{ | 278 | case ldc1_op:{ |
diff --git a/arch/mips/mm/fault.c b/arch/mips/mm/fault.c index 137ee76a0045..937cf3368164 100644 --- a/arch/mips/mm/fault.c +++ b/arch/mips/mm/fault.c | |||
@@ -145,7 +145,7 @@ good_area: | |||
145 | * the fault. | 145 | * the fault. |
146 | */ | 146 | */ |
147 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); | 147 | fault = handle_mm_fault(mm, vma, address, write ? FAULT_FLAG_WRITE : 0); |
148 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, 0, regs, address); | 148 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address); |
149 | if (unlikely(fault & VM_FAULT_ERROR)) { | 149 | if (unlikely(fault & VM_FAULT_ERROR)) { |
150 | if (fault & VM_FAULT_OOM) | 150 | if (fault & VM_FAULT_OOM) |
151 | goto out_of_memory; | 151 | goto out_of_memory; |
@@ -154,12 +154,10 @@ good_area: | |||
154 | BUG(); | 154 | BUG(); |
155 | } | 155 | } |
156 | if (fault & VM_FAULT_MAJOR) { | 156 | if (fault & VM_FAULT_MAJOR) { |
157 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, | 157 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MAJ, 1, regs, address); |
158 | 1, 0, regs, address); | ||
159 | tsk->maj_flt++; | 158 | tsk->maj_flt++; |
160 | } else { | 159 | } else { |
161 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, | 160 | perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS_MIN, 1, regs, address); |
162 | 1, 0, regs, address); | ||
163 | tsk->min_flt++; | 161 | tsk->min_flt++; |
164 | } | 162 | } |
165 | 163 | ||
diff --git a/arch/mips/mti-malta/malta-time.c b/arch/mips/mti-malta/malta-time.c index 1620b83cd13e..f8ee945ee411 100644 --- a/arch/mips/mti-malta/malta-time.c +++ b/arch/mips/mti-malta/malta-time.c | |||
@@ -19,6 +19,7 @@ | |||
19 | */ | 19 | */ |
20 | 20 | ||
21 | #include <linux/types.h> | 21 | #include <linux/types.h> |
22 | #include <linux/i8253.h> | ||
22 | #include <linux/init.h> | 23 | #include <linux/init.h> |
23 | #include <linux/kernel_stat.h> | 24 | #include <linux/kernel_stat.h> |
24 | #include <linux/sched.h> | 25 | #include <linux/sched.h> |
@@ -31,7 +32,6 @@ | |||
31 | #include <asm/mipsregs.h> | 32 | #include <asm/mipsregs.h> |
32 | #include <asm/mipsmtregs.h> | 33 | #include <asm/mipsmtregs.h> |
33 | #include <asm/hardirq.h> | 34 | #include <asm/hardirq.h> |
34 | #include <asm/i8253.h> | ||
35 | #include <asm/irq.h> | 35 | #include <asm/irq.h> |
36 | #include <asm/div64.h> | 36 | #include <asm/div64.h> |
37 | #include <asm/cpu.h> | 37 | #include <asm/cpu.h> |
diff --git a/arch/mips/oprofile/Makefile b/arch/mips/oprofile/Makefile index 4b9d7044e26c..29f2f13eb31c 100644 --- a/arch/mips/oprofile/Makefile +++ b/arch/mips/oprofile/Makefile | |||
@@ -8,7 +8,7 @@ DRIVER_OBJS = $(addprefix ../../../drivers/oprofile/, \ | |||
8 | oprofilefs.o oprofile_stats.o \ | 8 | oprofilefs.o oprofile_stats.o \ |
9 | timer_int.o ) | 9 | timer_int.o ) |
10 | 10 | ||
11 | oprofile-y := $(DRIVER_OBJS) common.o | 11 | oprofile-y := $(DRIVER_OBJS) common.o backtrace.o |
12 | 12 | ||
13 | oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o | 13 | oprofile-$(CONFIG_CPU_MIPS32) += op_model_mipsxx.o |
14 | oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o | 14 | oprofile-$(CONFIG_CPU_MIPS64) += op_model_mipsxx.o |
diff --git a/arch/mips/oprofile/backtrace.c b/arch/mips/oprofile/backtrace.c new file mode 100644 index 000000000000..6854ed5097d2 --- /dev/null +++ b/arch/mips/oprofile/backtrace.c | |||
@@ -0,0 +1,175 @@ | |||
1 | #include <linux/oprofile.h> | ||
2 | #include <linux/sched.h> | ||
3 | #include <linux/mm.h> | ||
4 | #include <linux/uaccess.h> | ||
5 | #include <asm/ptrace.h> | ||
6 | #include <asm/stacktrace.h> | ||
7 | #include <linux/stacktrace.h> | ||
8 | #include <linux/kernel.h> | ||
9 | #include <asm/sections.h> | ||
10 | #include <asm/inst.h> | ||
11 | |||
12 | struct stackframe { | ||
13 | unsigned long sp; | ||
14 | unsigned long pc; | ||
15 | unsigned long ra; | ||
16 | }; | ||
17 | |||
18 | static inline int get_mem(unsigned long addr, unsigned long *result) | ||
19 | { | ||
20 | unsigned long *address = (unsigned long *) addr; | ||
21 | if (!access_ok(VERIFY_READ, addr, sizeof(unsigned long))) | ||
22 | return -1; | ||
23 | if (__copy_from_user_inatomic(result, address, sizeof(unsigned long))) | ||
24 | return -3; | ||
25 | return 0; | ||
26 | } | ||
27 | |||
28 | /* | ||
29 | * These two instruction helpers were taken from process.c | ||
30 | */ | ||
31 | static inline int is_ra_save_ins(union mips_instruction *ip) | ||
32 | { | ||
33 | /* sw / sd $ra, offset($sp) */ | ||
34 | return (ip->i_format.opcode == sw_op || ip->i_format.opcode == sd_op) | ||
35 | && ip->i_format.rs == 29 && ip->i_format.rt == 31; | ||
36 | } | ||
37 | |||
38 | static inline int is_sp_move_ins(union mips_instruction *ip) | ||
39 | { | ||
40 | /* addiu/daddiu sp,sp,-imm */ | ||
41 | if (ip->i_format.rs != 29 || ip->i_format.rt != 29) | ||
42 | return 0; | ||
43 | if (ip->i_format.opcode == addiu_op || ip->i_format.opcode == daddiu_op) | ||
44 | return 1; | ||
45 | return 0; | ||
46 | } | ||
47 | |||
48 | /* | ||
49 | * Looks for specific instructions that mark the end of a function. | ||
50 | * This usually means we ran into the code area of the previous function. | ||
51 | */ | ||
52 | static inline int is_end_of_function_marker(union mips_instruction *ip) | ||
53 | { | ||
54 | /* jr ra */ | ||
55 | if (ip->r_format.func == jr_op && ip->r_format.rs == 31) | ||
56 | return 1; | ||
57 | /* lui gp */ | ||
58 | if (ip->i_format.opcode == lui_op && ip->i_format.rt == 28) | ||
59 | return 1; | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | /* | ||
64 | * TODO for userspace stack unwinding: | ||
65 | * - handle cases where the stack is adjusted inside a function | ||
66 | * (generally doesn't happen) | ||
67 | * - find optimal value for max_instr_check | ||
68 | * - try to find a way to handle leaf functions | ||
69 | */ | ||
70 | |||
71 | static inline int unwind_user_frame(struct stackframe *old_frame, | ||
72 | const unsigned int max_instr_check) | ||
73 | { | ||
74 | struct stackframe new_frame = *old_frame; | ||
75 | off_t ra_offset = 0; | ||
76 | size_t stack_size = 0; | ||
77 | unsigned long addr; | ||
78 | |||
79 | if (old_frame->pc == 0 || old_frame->sp == 0 || old_frame->ra == 0) | ||
80 | return -9; | ||
81 | |||
82 | for (addr = new_frame.pc; (addr + max_instr_check > new_frame.pc) | ||
83 | && (!ra_offset || !stack_size); --addr) { | ||
84 | union mips_instruction ip; | ||
85 | |||
86 | if (get_mem(addr, (unsigned long *) &ip)) | ||
87 | return -11; | ||
88 | |||
89 | if (is_sp_move_ins(&ip)) { | ||
90 | int stack_adjustment = ip.i_format.simmediate; | ||
91 | if (stack_adjustment > 0) | ||
92 | /* This marks the end of the previous function, | ||
93 | which means we overran. */ | ||
94 | break; | ||
95 | stack_size = (unsigned) stack_adjustment; | ||
96 | } else if (is_ra_save_ins(&ip)) { | ||
97 | int ra_slot = ip.i_format.simmediate; | ||
98 | if (ra_slot < 0) | ||
99 | /* This shouldn't happen. */ | ||
100 | break; | ||
101 | ra_offset = ra_slot; | ||
102 | } else if (is_end_of_function_marker(&ip)) | ||
103 | break; | ||
104 | } | ||
105 | |||
106 | if (!ra_offset || !stack_size) | ||
107 | return -1; | ||
108 | |||
109 | if (ra_offset) { | ||
110 | new_frame.ra = old_frame->sp + ra_offset; | ||
111 | if (get_mem(new_frame.ra, &(new_frame.ra))) | ||
112 | return -13; | ||
113 | } | ||
114 | |||
115 | if (stack_size) { | ||
116 | new_frame.sp = old_frame->sp + stack_size; | ||
117 | if (get_mem(new_frame.sp, &(new_frame.sp))) | ||
118 | return -14; | ||
119 | } | ||
120 | |||
121 | if (new_frame.sp > old_frame->sp) | ||
122 | return -2; | ||
123 | |||
124 | new_frame.pc = old_frame->ra; | ||
125 | *old_frame = new_frame; | ||
126 | |||
127 | return 0; | ||
128 | } | ||
129 | |||
130 | static inline void do_user_backtrace(unsigned long low_addr, | ||
131 | struct stackframe *frame, | ||
132 | unsigned int depth) | ||
133 | { | ||
134 | const unsigned int max_instr_check = 512; | ||
135 | const unsigned long high_addr = low_addr + THREAD_SIZE; | ||
136 | |||
137 | while (depth-- && !unwind_user_frame(frame, max_instr_check)) { | ||
138 | oprofile_add_trace(frame->ra); | ||
139 | if (frame->sp < low_addr || frame->sp > high_addr) | ||
140 | break; | ||
141 | } | ||
142 | } | ||
143 | |||
144 | #ifndef CONFIG_KALLSYMS | ||
145 | static inline void do_kernel_backtrace(unsigned long low_addr, | ||
146 | struct stackframe *frame, | ||
147 | unsigned int depth) { } | ||
148 | #else | ||
149 | static inline void do_kernel_backtrace(unsigned long low_addr, | ||
150 | struct stackframe *frame, | ||
151 | unsigned int depth) | ||
152 | { | ||
153 | while (depth-- && frame->pc) { | ||
154 | frame->pc = unwind_stack_by_address(low_addr, | ||
155 | &(frame->sp), | ||
156 | frame->pc, | ||
157 | &(frame->ra)); | ||
158 | oprofile_add_trace(frame->ra); | ||
159 | } | ||
160 | } | ||
161 | #endif | ||
162 | |||
163 | void notrace op_mips_backtrace(struct pt_regs *const regs, unsigned int depth) | ||
164 | { | ||
165 | struct stackframe frame = { .sp = regs->regs[29], | ||
166 | .pc = regs->cp0_epc, | ||
167 | .ra = regs->regs[31] }; | ||
168 | const int userspace = user_mode(regs); | ||
169 | const unsigned long low_addr = ALIGN(frame.sp, THREAD_SIZE); | ||
170 | |||
171 | if (userspace) | ||
172 | do_user_backtrace(low_addr, &frame, depth); | ||
173 | else | ||
174 | do_kernel_backtrace(low_addr, &frame, depth); | ||
175 | } | ||
diff --git a/arch/mips/oprofile/common.c b/arch/mips/oprofile/common.c index f9eb1aba6345..d1f2d4c52d42 100644 --- a/arch/mips/oprofile/common.c +++ b/arch/mips/oprofile/common.c | |||
@@ -115,6 +115,7 @@ int __init oprofile_arch_init(struct oprofile_operations *ops) | |||
115 | ops->start = op_mips_start; | 115 | ops->start = op_mips_start; |
116 | ops->stop = op_mips_stop; | 116 | ops->stop = op_mips_stop; |
117 | ops->cpu_type = lmodel->cpu_type; | 117 | ops->cpu_type = lmodel->cpu_type; |
118 | ops->backtrace = op_mips_backtrace; | ||
118 | 119 | ||
119 | printk(KERN_INFO "oprofile: using %s performance monitoring.\n", | 120 | printk(KERN_INFO "oprofile: using %s performance monitoring.\n", |
120 | lmodel->cpu_type); | 121 | lmodel->cpu_type); |
diff --git a/arch/mips/oprofile/op_impl.h b/arch/mips/oprofile/op_impl.h index f04b54fb37d1..7c2da27ece04 100644 --- a/arch/mips/oprofile/op_impl.h +++ b/arch/mips/oprofile/op_impl.h | |||
@@ -36,4 +36,6 @@ struct op_mips_model { | |||
36 | unsigned char num_counters; | 36 | unsigned char num_counters; |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void op_mips_backtrace(struct pt_regs * const regs, unsigned int depth); | ||
40 | |||
39 | #endif | 41 | #endif |
diff --git a/arch/mips/pci/pci-rc32434.c b/arch/mips/pci/pci-rc32434.c index f31218e17d3c..764362ce5e40 100644 --- a/arch/mips/pci/pci-rc32434.c +++ b/arch/mips/pci/pci-rc32434.c | |||
@@ -215,7 +215,7 @@ static int __init rc32434_pci_init(void) | |||
215 | rc32434_pcibridge_init(); | 215 | rc32434_pcibridge_init(); |
216 | 216 | ||
217 | io_map_base = ioremap(rc32434_res_pci_io1.start, | 217 | io_map_base = ioremap(rc32434_res_pci_io1.start, |
218 | rc32434_res_pci_io1.end - rc32434_res_pci_io1.start + 1); | 218 | resource_size(&rcrc32434_res_pci_io1)); |
219 | 219 | ||
220 | if (!io_map_base) | 220 | if (!io_map_base) |
221 | return -ENOMEM; | 221 | return -ENOMEM; |
diff --git a/arch/mips/pci/pci-vr41xx.c b/arch/mips/pci/pci-vr41xx.c index 56525711f8b7..444b8d8004ad 100644 --- a/arch/mips/pci/pci-vr41xx.c +++ b/arch/mips/pci/pci-vr41xx.c | |||
@@ -305,7 +305,7 @@ static int __init vr41xx_pciu_init(void) | |||
305 | struct resource *res = vr41xx_pci_controller.io_resource; | 305 | struct resource *res = vr41xx_pci_controller.io_resource; |
306 | master = setup->master_io; | 306 | master = setup->master_io; |
307 | io_map_base = ioremap(master->bus_base_address, | 307 | io_map_base = ioremap(master->bus_base_address, |
308 | res->end - res->start + 1); | 308 | resource_size(res)); |
309 | if (!io_map_base) | 309 | if (!io_map_base) |
310 | return -EBUSY; | 310 | return -EBUSY; |
311 | 311 | ||
diff --git a/arch/mips/powertv/asic/asic_devices.c b/arch/mips/powertv/asic/asic_devices.c index e56fa61b3991..bce1872249ba 100644 --- a/arch/mips/powertv/asic/asic_devices.c +++ b/arch/mips/powertv/asic/asic_devices.c | |||
@@ -394,23 +394,21 @@ void __init platform_alloc_bootmem(void) | |||
394 | 394 | ||
395 | /* Loop through looking for resources that want a particular address */ | 395 | /* Loop through looking for resources that want a particular address */ |
396 | for (i = 0; gp_resources[i].flags != 0; i++) { | 396 | for (i = 0; gp_resources[i].flags != 0; i++) { |
397 | int size = gp_resources[i].end - gp_resources[i].start + 1; | 397 | int size = resource_size(&gp_resources[i]); |
398 | if ((gp_resources[i].start != 0) && | 398 | if ((gp_resources[i].start != 0) && |
399 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { | 399 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { |
400 | reserve_bootmem(dma_to_phys(gp_resources[i].start), | 400 | reserve_bootmem(dma_to_phys(gp_resources[i].start), |
401 | size, 0); | 401 | size, 0); |
402 | total += gp_resources[i].end - | 402 | total += resource_size(&gp_resources[i]); |
403 | gp_resources[i].start + 1; | ||
404 | pr_info("reserve resource %s at %08x (%u bytes)\n", | 403 | pr_info("reserve resource %s at %08x (%u bytes)\n", |
405 | gp_resources[i].name, gp_resources[i].start, | 404 | gp_resources[i].name, gp_resources[i].start, |
406 | gp_resources[i].end - | 405 | resource_size(&gp_resources[i])); |
407 | gp_resources[i].start + 1); | ||
408 | } | 406 | } |
409 | } | 407 | } |
410 | 408 | ||
411 | /* Loop through assigning addresses for those that are left */ | 409 | /* Loop through assigning addresses for those that are left */ |
412 | for (i = 0; gp_resources[i].flags != 0; i++) { | 410 | for (i = 0; gp_resources[i].flags != 0; i++) { |
413 | int size = gp_resources[i].end - gp_resources[i].start + 1; | 411 | int size = resource_size(&gp_resources[i]); |
414 | if ((gp_resources[i].start == 0) && | 412 | if ((gp_resources[i].start == 0) && |
415 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { | 413 | ((gp_resources[i].flags & IORESOURCE_MEM) != 0)) { |
416 | void *mem = alloc_bootmem_pages(size); | 414 | void *mem = alloc_bootmem_pages(size); |
diff --git a/arch/mips/sgi-ip22/ip22-time.c b/arch/mips/sgi-ip22/ip22-time.c index 1a94c9894188..607192449335 100644 --- a/arch/mips/sgi-ip22/ip22-time.c +++ b/arch/mips/sgi-ip22/ip22-time.c | |||
@@ -10,6 +10,7 @@ | |||
10 | * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org) | 10 | * Copyright (C) 2003, 06 Ralf Baechle (ralf@linux-mips.org) |
11 | */ | 11 | */ |
12 | #include <linux/bcd.h> | 12 | #include <linux/bcd.h> |
13 | #include <linux/i8253.h> | ||
13 | #include <linux/init.h> | 14 | #include <linux/init.h> |
14 | #include <linux/irq.h> | 15 | #include <linux/irq.h> |
15 | #include <linux/kernel.h> | 16 | #include <linux/kernel.h> |
@@ -20,7 +21,6 @@ | |||
20 | 21 | ||
21 | #include <asm/cpu.h> | 22 | #include <asm/cpu.h> |
22 | #include <asm/mipsregs.h> | 23 | #include <asm/mipsregs.h> |
23 | #include <asm/i8253.h> | ||
24 | #include <asm/io.h> | 24 | #include <asm/io.h> |
25 | #include <asm/irq.h> | 25 | #include <asm/irq.h> |
26 | #include <asm/time.h> | 26 | #include <asm/time.h> |
diff --git a/arch/mips/sni/time.c b/arch/mips/sni/time.c index 0904d4d30cb3..ec0be14996a4 100644 --- a/arch/mips/sni/time.c +++ b/arch/mips/sni/time.c | |||
@@ -1,11 +1,11 @@ | |||
1 | #include <linux/types.h> | 1 | #include <linux/types.h> |
2 | #include <linux/i8253.h> | ||
2 | #include <linux/interrupt.h> | 3 | #include <linux/interrupt.h> |
3 | #include <linux/irq.h> | 4 | #include <linux/irq.h> |
4 | #include <linux/smp.h> | 5 | #include <linux/smp.h> |
5 | #include <linux/time.h> | 6 | #include <linux/time.h> |
6 | #include <linux/clockchips.h> | 7 | #include <linux/clockchips.h> |
7 | 8 | ||
8 | #include <asm/i8253.h> | ||
9 | #include <asm/sni.h> | 9 | #include <asm/sni.h> |
10 | #include <asm/time.h> | 10 | #include <asm/time.h> |
11 | #include <asm-generic/rtc.h> | 11 | #include <asm-generic/rtc.h> |