diff options
Diffstat (limited to 'arch/m32r/kernel')
| -rw-r--r-- | arch/m32r/kernel/entry.S | 7 | ||||
| -rw-r--r-- | arch/m32r/kernel/head.S | 4 | ||||
| -rw-r--r-- | arch/m32r/kernel/m32r_ksyms.c | 6 | ||||
| -rw-r--r-- | arch/m32r/kernel/smp.c | 3 | ||||
| -rw-r--r-- | arch/m32r/kernel/time.c | 15 | ||||
| -rw-r--r-- | arch/m32r/kernel/traps.c | 4 | ||||
| -rw-r--r-- | arch/m32r/kernel/vmlinux.lds.S | 78 |
7 files changed, 35 insertions, 82 deletions
diff --git a/arch/m32r/kernel/entry.S b/arch/m32r/kernel/entry.S index 612d35b082a6..403869833b98 100644 --- a/arch/m32r/kernel/entry.S +++ b/arch/m32r/kernel/entry.S | |||
| @@ -118,6 +118,13 @@ | |||
| 118 | #define resume_kernel restore_all | 118 | #define resume_kernel restore_all |
| 119 | #endif | 119 | #endif |
| 120 | 120 | ||
| 121 | /* how to get the thread information struct from ASM */ | ||
| 122 | #define GET_THREAD_INFO(reg) GET_THREAD_INFO reg | ||
| 123 | .macro GET_THREAD_INFO reg | ||
| 124 | ldi \reg, #-THREAD_SIZE | ||
| 125 | and \reg, sp | ||
| 126 | .endm | ||
| 127 | |||
| 121 | ENTRY(ret_from_fork) | 128 | ENTRY(ret_from_fork) |
| 122 | pop r0 | 129 | pop r0 |
| 123 | bl schedule_tail | 130 | bl schedule_tail |
diff --git a/arch/m32r/kernel/head.S b/arch/m32r/kernel/head.S index 0a7194439eb1..a46652dd83e6 100644 --- a/arch/m32r/kernel/head.S +++ b/arch/m32r/kernel/head.S | |||
| @@ -268,13 +268,13 @@ ENTRY(empty_zero_page) | |||
| 268 | /*------------------------------------------------------------------------ | 268 | /*------------------------------------------------------------------------ |
| 269 | * Stack area | 269 | * Stack area |
| 270 | */ | 270 | */ |
| 271 | .section .spi | 271 | .section .init.data, "aw" |
| 272 | ALIGN | 272 | ALIGN |
| 273 | .global spi_stack_top | 273 | .global spi_stack_top |
| 274 | .zero 1024 | 274 | .zero 1024 |
| 275 | spi_stack_top: | 275 | spi_stack_top: |
| 276 | 276 | ||
| 277 | .section .spu | 277 | .section .init.data, "aw" |
| 278 | ALIGN | 278 | ALIGN |
| 279 | .global spu_stack_top | 279 | .global spu_stack_top |
| 280 | .zero 1024 | 280 | .zero 1024 |
diff --git a/arch/m32r/kernel/m32r_ksyms.c b/arch/m32r/kernel/m32r_ksyms.c index 22624b51d4d3..700570747a90 100644 --- a/arch/m32r/kernel/m32r_ksyms.c +++ b/arch/m32r/kernel/m32r_ksyms.c | |||
| @@ -23,12 +23,6 @@ EXPORT_SYMBOL(__ioremap); | |||
| 23 | EXPORT_SYMBOL(iounmap); | 23 | EXPORT_SYMBOL(iounmap); |
| 24 | EXPORT_SYMBOL(kernel_thread); | 24 | EXPORT_SYMBOL(kernel_thread); |
| 25 | 25 | ||
| 26 | /* Networking helper routines. */ | ||
| 27 | /* Delay loops */ | ||
| 28 | EXPORT_SYMBOL(__udelay); | ||
| 29 | EXPORT_SYMBOL(__delay); | ||
| 30 | EXPORT_SYMBOL(__const_udelay); | ||
| 31 | |||
| 32 | EXPORT_SYMBOL(strncpy_from_user); | 26 | EXPORT_SYMBOL(strncpy_from_user); |
| 33 | EXPORT_SYMBOL(__strncpy_from_user); | 27 | EXPORT_SYMBOL(__strncpy_from_user); |
| 34 | EXPORT_SYMBOL(clear_user); | 28 | EXPORT_SYMBOL(clear_user); |
diff --git a/arch/m32r/kernel/smp.c b/arch/m32r/kernel/smp.c index 1b7598e6f6e8..31cef20b2996 100644 --- a/arch/m32r/kernel/smp.c +++ b/arch/m32r/kernel/smp.c | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | 17 | ||
| 18 | #include <linux/irq.h> | 18 | #include <linux/irq.h> |
| 19 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
| 20 | #include <linux/sched.h> | ||
| 20 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
| 21 | #include <linux/mm.h> | 22 | #include <linux/mm.h> |
| 22 | #include <linux/smp.h> | 23 | #include <linux/smp.h> |
| @@ -805,7 +806,7 @@ unsigned long send_IPI_mask_phys(cpumask_t physid_mask, int ipi_num, | |||
| 805 | 806 | ||
| 806 | if (mask & ~physids_coerce(phys_cpu_present_map)) | 807 | if (mask & ~physids_coerce(phys_cpu_present_map)) |
| 807 | BUG(); | 808 | BUG(); |
| 808 | if (ipi_num >= NR_IPIS) | 809 | if (ipi_num >= NR_IPIS || ipi_num < 0) |
| 809 | BUG(); | 810 | BUG(); |
| 810 | 811 | ||
| 811 | mask <<= IPI_SHIFT; | 812 | mask <<= IPI_SHIFT; |
diff --git a/arch/m32r/kernel/time.c b/arch/m32r/kernel/time.c index ba61c4c73202..9cedcef11575 100644 --- a/arch/m32r/kernel/time.c +++ b/arch/m32r/kernel/time.c | |||
| @@ -33,6 +33,15 @@ | |||
| 33 | 33 | ||
| 34 | #include <asm/hw_irq.h> | 34 | #include <asm/hw_irq.h> |
| 35 | 35 | ||
| 36 | #if defined(CONFIG_RTC_DRV_CMOS) || defined(CONFIG_RTC_DRV_CMOS_MODULE) | ||
| 37 | /* this needs a better home */ | ||
| 38 | DEFINE_SPINLOCK(rtc_lock); | ||
| 39 | |||
| 40 | #ifdef CONFIG_RTC_DRV_CMOS_MODULE | ||
| 41 | EXPORT_SYMBOL(rtc_lock); | ||
| 42 | #endif | ||
| 43 | #endif /* pc-style 'CMOS' RTC support */ | ||
| 44 | |||
| 36 | #ifdef CONFIG_SMP | 45 | #ifdef CONFIG_SMP |
| 37 | extern void smp_local_timer_interrupt(void); | 46 | extern void smp_local_timer_interrupt(void); |
| 38 | #endif | 47 | #endif |
| @@ -66,7 +75,7 @@ u32 arch_gettimeoffset(void) | |||
| 66 | count = 0; | 75 | count = 0; |
| 67 | 76 | ||
| 68 | count = (latch - count) * TICK_SIZE; | 77 | count = (latch - count) * TICK_SIZE; |
| 69 | elapsed_time = (count + latch / 2) / latch; | 78 | elapsed_time = DIV_ROUND_CLOSEST(count, latch); |
| 70 | /* NOTE: LATCH is equal to the "interval" value (= reload count). */ | 79 | /* NOTE: LATCH is equal to the "interval" value (= reload count). */ |
| 71 | 80 | ||
| 72 | #else /* CONFIG_SMP */ | 81 | #else /* CONFIG_SMP */ |
| @@ -84,7 +93,7 @@ u32 arch_gettimeoffset(void) | |||
| 84 | p_count = count; | 93 | p_count = count; |
| 85 | 94 | ||
| 86 | count = (latch - count) * TICK_SIZE; | 95 | count = (latch - count) * TICK_SIZE; |
| 87 | elapsed_time = (count + latch / 2) / latch; | 96 | elapsed_time = DIV_ROUND_CLOSEST(count, latch); |
| 88 | /* NOTE: LATCH is equal to the "interval" value (= reload count). */ | 97 | /* NOTE: LATCH is equal to the "interval" value (= reload count). */ |
| 89 | #endif /* CONFIG_SMP */ | 98 | #endif /* CONFIG_SMP */ |
| 90 | #elif defined(CONFIG_CHIP_M32310) | 99 | #elif defined(CONFIG_CHIP_M32310) |
| @@ -202,7 +211,7 @@ void __init time_init(void) | |||
| 202 | 211 | ||
| 203 | bus_clock = boot_cpu_data.bus_clock; | 212 | bus_clock = boot_cpu_data.bus_clock; |
| 204 | divide = boot_cpu_data.timer_divide; | 213 | divide = boot_cpu_data.timer_divide; |
| 205 | latch = (bus_clock/divide + HZ / 2) / HZ; | 214 | latch = DIV_ROUND_CLOSEST(bus_clock/divide, HZ); |
| 206 | 215 | ||
| 207 | printk("Timer start : latch = %ld\n", latch); | 216 | printk("Timer start : latch = %ld\n", latch); |
| 208 | 217 | ||
diff --git a/arch/m32r/kernel/traps.c b/arch/m32r/kernel/traps.c index 03b14e55cd89..fbd109031df3 100644 --- a/arch/m32r/kernel/traps.c +++ b/arch/m32r/kernel/traps.c | |||
| @@ -104,8 +104,8 @@ static void set_eit_vector_entries(void) | |||
| 104 | eit_vector[186] = (unsigned long)smp_call_function_interrupt; | 104 | eit_vector[186] = (unsigned long)smp_call_function_interrupt; |
| 105 | eit_vector[187] = (unsigned long)smp_ipi_timer_interrupt; | 105 | eit_vector[187] = (unsigned long)smp_ipi_timer_interrupt; |
| 106 | eit_vector[188] = (unsigned long)smp_flush_cache_all_interrupt; | 106 | eit_vector[188] = (unsigned long)smp_flush_cache_all_interrupt; |
| 107 | eit_vector[189] = (unsigned long)smp_call_function_single_interrupt; | 107 | eit_vector[189] = 0; /* CPU_BOOT_IPI */ |
| 108 | eit_vector[190] = 0; | 108 | eit_vector[190] = (unsigned long)smp_call_function_single_interrupt; |
| 109 | eit_vector[191] = 0; | 109 | eit_vector[191] = 0; |
| 110 | #endif | 110 | #endif |
| 111 | _flush_cache_copyback_all(); | 111 | _flush_cache_copyback_all(); |
diff --git a/arch/m32r/kernel/vmlinux.lds.S b/arch/m32r/kernel/vmlinux.lds.S index de5e21cca6a5..7da94eaa082b 100644 --- a/arch/m32r/kernel/vmlinux.lds.S +++ b/arch/m32r/kernel/vmlinux.lds.S | |||
| @@ -4,6 +4,7 @@ | |||
| 4 | #include <asm-generic/vmlinux.lds.h> | 4 | #include <asm-generic/vmlinux.lds.h> |
| 5 | #include <asm/addrspace.h> | 5 | #include <asm/addrspace.h> |
| 6 | #include <asm/page.h> | 6 | #include <asm/page.h> |
| 7 | #include <asm/thread_info.h> | ||
| 7 | 8 | ||
| 8 | OUTPUT_ARCH(m32r) | 9 | OUTPUT_ARCH(m32r) |
| 9 | #if defined(__LITTLE_ENDIAN__) | 10 | #if defined(__LITTLE_ENDIAN__) |
| @@ -40,83 +41,24 @@ SECTIONS | |||
| 40 | #endif | 41 | #endif |
| 41 | _etext = .; /* End of text section */ | 42 | _etext = .; /* End of text section */ |
| 42 | 43 | ||
| 43 | . = ALIGN(16); /* Exception table */ | 44 | EXCEPTION_TABLE(16) |
| 44 | __start___ex_table = .; | 45 | NOTES |
| 45 | __ex_table : { *(__ex_table) } | ||
| 46 | __stop___ex_table = .; | ||
| 47 | 46 | ||
| 48 | RODATA | 47 | RODATA |
| 49 | 48 | RW_DATA_SECTION(32, PAGE_SIZE, THREAD_SIZE) | |
| 50 | /* writeable */ | ||
| 51 | .data : { /* Data */ | ||
| 52 | *(.spu) | ||
| 53 | *(.spi) | ||
| 54 | DATA_DATA | ||
| 55 | CONSTRUCTORS | ||
| 56 | } | ||
| 57 | |||
| 58 | . = ALIGN(4096); | ||
| 59 | __nosave_begin = .; | ||
| 60 | .data_nosave : { *(.data.nosave) } | ||
| 61 | . = ALIGN(4096); | ||
| 62 | __nosave_end = .; | ||
| 63 | |||
| 64 | . = ALIGN(32); | ||
| 65 | .data.cacheline_aligned : { *(.data.cacheline_aligned) } | ||
| 66 | |||
| 67 | _edata = .; /* End of data section */ | 49 | _edata = .; /* End of data section */ |
| 68 | 50 | ||
| 69 | . = ALIGN(8192); /* init_task */ | ||
| 70 | .data.init_task : { *(.data.init_task) } | ||
| 71 | |||
| 72 | /* will be freed after init */ | 51 | /* will be freed after init */ |
| 73 | . = ALIGN(4096); /* Init code and data */ | 52 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
| 74 | __init_begin = .; | 53 | __init_begin = .; |
| 75 | .init.text : { | 54 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 76 | _sinittext = .; | 55 | INIT_DATA_SECTION(16) |
| 77 | INIT_TEXT | 56 | PERCPU(PAGE_SIZE) |
| 78 | _einittext = .; | 57 | . = ALIGN(PAGE_SIZE); |
| 79 | } | ||
| 80 | .init.data : { INIT_DATA } | ||
| 81 | . = ALIGN(16); | ||
| 82 | __setup_start = .; | ||
| 83 | .init.setup : { *(.init.setup) } | ||
| 84 | __setup_end = .; | ||
| 85 | __initcall_start = .; | ||
| 86 | .initcall.init : { | ||
| 87 | INITCALLS | ||
| 88 | } | ||
| 89 | __initcall_end = .; | ||
| 90 | __con_initcall_start = .; | ||
| 91 | .con_initcall.init : { *(.con_initcall.init) } | ||
| 92 | __con_initcall_end = .; | ||
| 93 | SECURITY_INIT | ||
| 94 | . = ALIGN(4); | ||
| 95 | __alt_instructions = .; | ||
| 96 | .altinstructions : { *(.altinstructions) } | ||
| 97 | __alt_instructions_end = .; | ||
| 98 | .altinstr_replacement : { *(.altinstr_replacement) } | ||
| 99 | /* .exit.text is discard at runtime, not link time, to deal with references | ||
| 100 | from .altinstructions and .eh_frame */ | ||
| 101 | .exit.text : { EXIT_TEXT } | ||
| 102 | .exit.data : { EXIT_DATA } | ||
| 103 | |||
| 104 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 105 | . = ALIGN(4096); | ||
| 106 | __initramfs_start = .; | ||
| 107 | .init.ramfs : { *(.init.ramfs) } | ||
| 108 | __initramfs_end = .; | ||
| 109 | #endif | ||
| 110 | |||
| 111 | PERCPU(4096) | ||
| 112 | . = ALIGN(4096); | ||
| 113 | __init_end = .; | 58 | __init_end = .; |
| 114 | /* freed after init ends here */ | 59 | /* freed after init ends here */ |
| 115 | 60 | ||
| 116 | __bss_start = .; /* BSS */ | 61 | BSS_SECTION(0, 0, 4) |
| 117 | .bss : { *(.bss) } | ||
| 118 | . = ALIGN(4); | ||
| 119 | __bss_stop = .; | ||
| 120 | 62 | ||
| 121 | _end = . ; | 63 | _end = . ; |
| 122 | 64 | ||
