diff options
Diffstat (limited to 'arch/mips/kernel')
| -rw-r--r-- | arch/mips/kernel/.gitignore | 1 | ||||
| -rw-r--r-- | arch/mips/kernel/kgdb.c | 7 | ||||
| -rw-r--r-- | arch/mips/kernel/scall32-o32.S | 6 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-64.S | 6 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-n32.S | 6 | ||||
| -rw-r--r-- | arch/mips/kernel/scall64-o32.S | 6 | ||||
| -rw-r--r-- | arch/mips/kernel/setup.c | 75 | ||||
| -rw-r--r-- | arch/mips/kernel/traps.c | 18 |
8 files changed, 76 insertions, 49 deletions
diff --git a/arch/mips/kernel/.gitignore b/arch/mips/kernel/.gitignore new file mode 100644 index 000000000000..c5f676c3c224 --- /dev/null +++ b/arch/mips/kernel/.gitignore | |||
| @@ -0,0 +1 @@ | |||
| vmlinux.lds | |||
diff --git a/arch/mips/kernel/kgdb.c b/arch/mips/kernel/kgdb.c index c5a8b2d21ca4..8f6d58ede33c 100644 --- a/arch/mips/kernel/kgdb.c +++ b/arch/mips/kernel/kgdb.c | |||
| @@ -62,13 +62,13 @@ void arch_kgdb_breakpoint(void) | |||
| 62 | 62 | ||
| 63 | static void kgdb_call_nmi_hook(void *ignored) | 63 | static void kgdb_call_nmi_hook(void *ignored) |
| 64 | { | 64 | { |
| 65 | kgdb_nmicallback(raw_smp_processor_id(), (void *)0); | 65 | kgdb_nmicallback(raw_smp_processor_id(), NULL); |
| 66 | } | 66 | } |
| 67 | 67 | ||
| 68 | void kgdb_roundup_cpus(unsigned long flags) | 68 | void kgdb_roundup_cpus(unsigned long flags) |
| 69 | { | 69 | { |
| 70 | local_irq_enable(); | 70 | local_irq_enable(); |
| 71 | smp_call_function(kgdb_call_nmi_hook, NULL, NULL); | 71 | smp_call_function(kgdb_call_nmi_hook, NULL, 0); |
| 72 | local_irq_disable(); | 72 | local_irq_disable(); |
| 73 | } | 73 | } |
| 74 | 74 | ||
| @@ -190,9 +190,6 @@ static int kgdb_mips_notify(struct notifier_block *self, unsigned long cmd, | |||
| 190 | struct pt_regs *regs = args->regs; | 190 | struct pt_regs *regs = args->regs; |
| 191 | int trap = (regs->cp0_cause & 0x7c) >> 2; | 191 | int trap = (regs->cp0_cause & 0x7c) >> 2; |
| 192 | 192 | ||
| 193 | if (fixup_exception(regs)) | ||
| 194 | return NOTIFY_DONE; | ||
| 195 | |||
| 196 | /* Userpace events, ignore. */ | 193 | /* Userpace events, ignore. */ |
| 197 | if (user_mode(regs)) | 194 | if (user_mode(regs)) |
| 198 | return NOTIFY_DONE; | 195 | return NOTIFY_DONE; |
diff --git a/arch/mips/kernel/scall32-o32.S b/arch/mips/kernel/scall32-o32.S index fc4fd4d705e2..5e75a316f6b1 100644 --- a/arch/mips/kernel/scall32-o32.S +++ b/arch/mips/kernel/scall32-o32.S | |||
| @@ -647,6 +647,12 @@ einval: li v0, -EINVAL | |||
| 647 | sys sys_timerfd_create 2 | 647 | sys sys_timerfd_create 2 |
| 648 | sys sys_timerfd_gettime 2 | 648 | sys sys_timerfd_gettime 2 |
| 649 | sys sys_timerfd_settime 4 | 649 | sys sys_timerfd_settime 4 |
| 650 | sys sys_signalfd4 4 | ||
| 651 | sys sys_eventfd2 2 /* 4325 */ | ||
| 652 | sys sys_epoll_create1 1 | ||
| 653 | sys sys_dup3 3 | ||
| 654 | sys sys_pipe2 2 | ||
| 655 | sys sys_inotify_init1 1 | ||
| 650 | .endm | 656 | .endm |
| 651 | 657 | ||
| 652 | /* We pre-compute the number of _instruction_ bytes needed to | 658 | /* We pre-compute the number of _instruction_ bytes needed to |
diff --git a/arch/mips/kernel/scall64-64.S b/arch/mips/kernel/scall64-64.S index 2b73fd1e4528..3d58204c9d44 100644 --- a/arch/mips/kernel/scall64-64.S +++ b/arch/mips/kernel/scall64-64.S | |||
| @@ -481,4 +481,10 @@ sys_call_table: | |||
| 481 | PTR sys_timerfd_create /* 5280 */ | 481 | PTR sys_timerfd_create /* 5280 */ |
| 482 | PTR sys_timerfd_gettime | 482 | PTR sys_timerfd_gettime |
| 483 | PTR sys_timerfd_settime | 483 | PTR sys_timerfd_settime |
| 484 | PTR sys_signalfd4 | ||
| 485 | PTR sys_eventfd2 | ||
| 486 | PTR sys_epoll_create1 /* 5285 */ | ||
| 487 | PTR sys_dup3 | ||
| 488 | PTR sys_pipe2 | ||
| 489 | PTR sys_inotify_init1 | ||
| 484 | .size sys_call_table,.-sys_call_table | 490 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/scall64-n32.S b/arch/mips/kernel/scall64-n32.S index 2654e75d2fef..da7f1b6ea0fb 100644 --- a/arch/mips/kernel/scall64-n32.S +++ b/arch/mips/kernel/scall64-n32.S | |||
| @@ -407,4 +407,10 @@ EXPORT(sysn32_call_table) | |||
| 407 | PTR sys_timerfd_create | 407 | PTR sys_timerfd_create |
| 408 | PTR sys_timerfd_gettime /* 5285 */ | 408 | PTR sys_timerfd_gettime /* 5285 */ |
| 409 | PTR sys_timerfd_settime | 409 | PTR sys_timerfd_settime |
| 410 | PTR sys_signalfd4 | ||
| 411 | PTR sys_eventfd2 | ||
| 412 | PTR sys_epoll_create1 | ||
| 413 | PTR sys_dup3 /* 5290 */ | ||
| 414 | PTR sys_pipe2 | ||
| 415 | PTR sys_inotify_init1 | ||
| 410 | .size sysn32_call_table,.-sysn32_call_table | 416 | .size sysn32_call_table,.-sysn32_call_table |
diff --git a/arch/mips/kernel/scall64-o32.S b/arch/mips/kernel/scall64-o32.S index 76167bea5a70..d7cd1aac9ada 100644 --- a/arch/mips/kernel/scall64-o32.S +++ b/arch/mips/kernel/scall64-o32.S | |||
| @@ -529,4 +529,10 @@ sys_call_table: | |||
| 529 | PTR sys_timerfd_create | 529 | PTR sys_timerfd_create |
| 530 | PTR sys_timerfd_gettime | 530 | PTR sys_timerfd_gettime |
| 531 | PTR sys_timerfd_settime | 531 | PTR sys_timerfd_settime |
| 532 | PTR compat_sys_signalfd4 | ||
| 533 | PTR sys_eventfd2 /* 4325 */ | ||
| 534 | PTR sys_epoll_create1 | ||
| 535 | PTR sys_dup3 | ||
| 536 | PTR sys_pipe2 | ||
| 537 | PTR sys_inotify_init1 | ||
| 532 | .size sys_call_table,.-sys_call_table | 538 | .size sys_call_table,.-sys_call_table |
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c index 8af84867e74d..16f8edfe5cdc 100644 --- a/arch/mips/kernel/setup.c +++ b/arch/mips/kernel/setup.c | |||
| @@ -78,7 +78,7 @@ void __init add_memory_region(phys_t start, phys_t size, long type) | |||
| 78 | 78 | ||
| 79 | /* Sanity check */ | 79 | /* Sanity check */ |
| 80 | if (start + size < start) { | 80 | if (start + size < start) { |
| 81 | printk("Trying to add an invalid memory region, skipped\n"); | 81 | pr_warning("Trying to add an invalid memory region, skipped\n"); |
| 82 | return; | 82 | return; |
| 83 | } | 83 | } |
| 84 | 84 | ||
| @@ -92,7 +92,7 @@ void __init add_memory_region(phys_t start, phys_t size, long type) | |||
| 92 | } | 92 | } |
| 93 | 93 | ||
| 94 | if (x == BOOT_MEM_MAP_MAX) { | 94 | if (x == BOOT_MEM_MAP_MAX) { |
| 95 | printk("Ooops! Too many entries in the memory map!\n"); | 95 | pr_err("Ooops! Too many entries in the memory map!\n"); |
| 96 | return; | 96 | return; |
| 97 | } | 97 | } |
| 98 | 98 | ||
| @@ -108,22 +108,22 @@ static void __init print_memory_map(void) | |||
| 108 | const int field = 2 * sizeof(unsigned long); | 108 | const int field = 2 * sizeof(unsigned long); |
| 109 | 109 | ||
| 110 | for (i = 0; i < boot_mem_map.nr_map; i++) { | 110 | for (i = 0; i < boot_mem_map.nr_map; i++) { |
| 111 | printk(" memory: %0*Lx @ %0*Lx ", | 111 | printk(KERN_INFO " memory: %0*Lx @ %0*Lx ", |
| 112 | field, (unsigned long long) boot_mem_map.map[i].size, | 112 | field, (unsigned long long) boot_mem_map.map[i].size, |
| 113 | field, (unsigned long long) boot_mem_map.map[i].addr); | 113 | field, (unsigned long long) boot_mem_map.map[i].addr); |
| 114 | 114 | ||
| 115 | switch (boot_mem_map.map[i].type) { | 115 | switch (boot_mem_map.map[i].type) { |
| 116 | case BOOT_MEM_RAM: | 116 | case BOOT_MEM_RAM: |
| 117 | printk("(usable)\n"); | 117 | printk(KERN_CONT "(usable)\n"); |
| 118 | break; | 118 | break; |
| 119 | case BOOT_MEM_ROM_DATA: | 119 | case BOOT_MEM_ROM_DATA: |
| 120 | printk("(ROM data)\n"); | 120 | printk(KERN_CONT "(ROM data)\n"); |
| 121 | break; | 121 | break; |
| 122 | case BOOT_MEM_RESERVED: | 122 | case BOOT_MEM_RESERVED: |
| 123 | printk("(reserved)\n"); | 123 | printk(KERN_CONT "(reserved)\n"); |
| 124 | break; | 124 | break; |
| 125 | default: | 125 | default: |
| 126 | printk("type %lu\n", boot_mem_map.map[i].type); | 126 | printk(KERN_CONT "type %lu\n", boot_mem_map.map[i].type); |
| 127 | break; | 127 | break; |
| 128 | } | 128 | } |
| 129 | } | 129 | } |
| @@ -160,36 +160,39 @@ early_param("rd_size", rd_size_early); | |||
| 160 | static unsigned long __init init_initrd(void) | 160 | static unsigned long __init init_initrd(void) |
| 161 | { | 161 | { |
| 162 | unsigned long end; | 162 | unsigned long end; |
| 163 | u32 *initrd_header; | ||
| 164 | 163 | ||
| 165 | /* | 164 | /* |
| 166 | * Board specific code or command line parser should have | 165 | * Board specific code or command line parser should have |
| 167 | * already set up initrd_start and initrd_end. In these cases | 166 | * already set up initrd_start and initrd_end. In these cases |
| 168 | * perfom sanity checks and use them if all looks good. | 167 | * perfom sanity checks and use them if all looks good. |
| 169 | */ | 168 | */ |
| 170 | if (initrd_start && initrd_end > initrd_start) | 169 | if (!initrd_start || initrd_end <= initrd_start) { |
| 171 | goto sanitize; | 170 | #ifdef CONFIG_PROBE_INITRD_HEADER |
| 171 | u32 *initrd_header; | ||
| 172 | 172 | ||
| 173 | /* | 173 | /* |
| 174 | * See if initrd has been added to the kernel image by | 174 | * See if initrd has been added to the kernel image by |
| 175 | * arch/mips/boot/addinitrd.c. In that case a header is | 175 | * arch/mips/boot/addinitrd.c. In that case a header is |
| 176 | * prepended to initrd and is made up by 8 bytes. The fisrt | 176 | * prepended to initrd and is made up by 8 bytes. The first |
| 177 | * word is a magic number and the second one is the size of | 177 | * word is a magic number and the second one is the size of |
| 178 | * initrd. Initrd start must be page aligned in any cases. | 178 | * initrd. Initrd start must be page aligned in any cases. |
| 179 | */ | 179 | */ |
| 180 | initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; | 180 | initrd_header = __va(PAGE_ALIGN(__pa_symbol(&_end) + 8)) - 8; |
| 181 | if (initrd_header[0] != 0x494E5244) | 181 | if (initrd_header[0] != 0x494E5244) |
| 182 | goto disable; | ||
| 183 | initrd_start = (unsigned long)(initrd_header + 2); | ||
| 184 | initrd_end = initrd_start + initrd_header[1]; | ||
| 185 | #else | ||
| 182 | goto disable; | 186 | goto disable; |
| 183 | initrd_start = (unsigned long)(initrd_header + 2); | 187 | #endif |
| 184 | initrd_end = initrd_start + initrd_header[1]; | 188 | } |
| 185 | 189 | ||
| 186 | sanitize: | ||
| 187 | if (initrd_start & ~PAGE_MASK) { | 190 | if (initrd_start & ~PAGE_MASK) { |
| 188 | printk(KERN_ERR "initrd start must be page aligned\n"); | 191 | pr_err("initrd start must be page aligned\n"); |
| 189 | goto disable; | 192 | goto disable; |
| 190 | } | 193 | } |
| 191 | if (initrd_start < PAGE_OFFSET) { | 194 | if (initrd_start < PAGE_OFFSET) { |
| 192 | printk(KERN_ERR "initrd start < PAGE_OFFSET\n"); | 195 | pr_err("initrd start < PAGE_OFFSET\n"); |
| 193 | goto disable; | 196 | goto disable; |
| 194 | } | 197 | } |
| 195 | 198 | ||
| @@ -221,18 +224,18 @@ static void __init finalize_initrd(void) | |||
| 221 | goto disable; | 224 | goto disable; |
| 222 | } | 225 | } |
| 223 | if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) { | 226 | if (__pa(initrd_end) > PFN_PHYS(max_low_pfn)) { |
| 224 | printk("Initrd extends beyond end of memory"); | 227 | printk(KERN_ERR "Initrd extends beyond end of memory"); |
| 225 | goto disable; | 228 | goto disable; |
| 226 | } | 229 | } |
| 227 | 230 | ||
| 228 | reserve_bootmem(__pa(initrd_start), size, BOOTMEM_DEFAULT); | 231 | reserve_bootmem(__pa(initrd_start), size, BOOTMEM_DEFAULT); |
| 229 | initrd_below_start_ok = 1; | 232 | initrd_below_start_ok = 1; |
| 230 | 233 | ||
| 231 | printk(KERN_INFO "Initial ramdisk at: 0x%lx (%lu bytes)\n", | 234 | pr_info("Initial ramdisk at: 0x%lx (%lu bytes)\n", |
| 232 | initrd_start, size); | 235 | initrd_start, size); |
| 233 | return; | 236 | return; |
| 234 | disable: | 237 | disable: |
| 235 | printk(" - disabling initrd\n"); | 238 | printk(KERN_CONT " - disabling initrd\n"); |
| 236 | initrd_start = 0; | 239 | initrd_start = 0; |
| 237 | initrd_end = 0; | 240 | initrd_end = 0; |
| 238 | } | 241 | } |
| @@ -310,14 +313,12 @@ static void __init bootmem_init(void) | |||
| 310 | if (min_low_pfn >= max_low_pfn) | 313 | if (min_low_pfn >= max_low_pfn) |
| 311 | panic("Incorrect memory mapping !!!"); | 314 | panic("Incorrect memory mapping !!!"); |
| 312 | if (min_low_pfn > ARCH_PFN_OFFSET) { | 315 | if (min_low_pfn > ARCH_PFN_OFFSET) { |
| 313 | printk(KERN_INFO | 316 | pr_info("Wasting %lu bytes for tracking %lu unused pages\n", |
| 314 | "Wasting %lu bytes for tracking %lu unused pages\n", | 317 | (min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page), |
| 315 | (min_low_pfn - ARCH_PFN_OFFSET) * sizeof(struct page), | 318 | min_low_pfn - ARCH_PFN_OFFSET); |
| 316 | min_low_pfn - ARCH_PFN_OFFSET); | ||
| 317 | } else if (min_low_pfn < ARCH_PFN_OFFSET) { | 319 | } else if (min_low_pfn < ARCH_PFN_OFFSET) { |
| 318 | printk(KERN_INFO | 320 | pr_info("%lu free pages won't be used\n", |
| 319 | "%lu free pages won't be used\n", | 321 | ARCH_PFN_OFFSET - min_low_pfn); |
| 320 | ARCH_PFN_OFFSET - min_low_pfn); | ||
| 321 | } | 322 | } |
| 322 | min_low_pfn = ARCH_PFN_OFFSET; | 323 | min_low_pfn = ARCH_PFN_OFFSET; |
| 323 | 324 | ||
| @@ -471,7 +472,7 @@ static void __init arch_mem_init(char **cmdline_p) | |||
| 471 | /* call board setup routine */ | 472 | /* call board setup routine */ |
| 472 | plat_mem_setup(); | 473 | plat_mem_setup(); |
| 473 | 474 | ||
| 474 | printk("Determined physical RAM map:\n"); | 475 | pr_info("Determined physical RAM map:\n"); |
| 475 | print_memory_map(); | 476 | print_memory_map(); |
| 476 | 477 | ||
| 477 | strlcpy(command_line, arcs_cmdline, sizeof(command_line)); | 478 | strlcpy(command_line, arcs_cmdline, sizeof(command_line)); |
| @@ -482,7 +483,7 @@ static void __init arch_mem_init(char **cmdline_p) | |||
| 482 | parse_early_param(); | 483 | parse_early_param(); |
| 483 | 484 | ||
| 484 | if (usermem) { | 485 | if (usermem) { |
| 485 | printk("User-defined physical RAM map:\n"); | 486 | pr_info("User-defined physical RAM map:\n"); |
| 486 | print_memory_map(); | 487 | print_memory_map(); |
| 487 | } | 488 | } |
| 488 | 489 | ||
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c index 426cced1e9dc..6bee29097a56 100644 --- a/arch/mips/kernel/traps.c +++ b/arch/mips/kernel/traps.c | |||
| @@ -373,8 +373,8 @@ void __noreturn die(const char * str, const struct pt_regs * regs) | |||
| 373 | do_exit(SIGSEGV); | 373 | do_exit(SIGSEGV); |
| 374 | } | 374 | } |
| 375 | 375 | ||
| 376 | extern const struct exception_table_entry __start___dbe_table[]; | 376 | extern struct exception_table_entry __start___dbe_table[]; |
| 377 | extern const struct exception_table_entry __stop___dbe_table[]; | 377 | extern struct exception_table_entry __stop___dbe_table[]; |
| 378 | 378 | ||
| 379 | __asm__( | 379 | __asm__( |
| 380 | " .section __dbe_table, \"a\"\n" | 380 | " .section __dbe_table, \"a\"\n" |
| @@ -1200,7 +1200,7 @@ void *set_except_vector(int n, void *addr) | |||
| 1200 | if (n == 0 && cpu_has_divec) { | 1200 | if (n == 0 && cpu_has_divec) { |
| 1201 | *(u32 *)(ebase + 0x200) = 0x08000000 | | 1201 | *(u32 *)(ebase + 0x200) = 0x08000000 | |
| 1202 | (0x03ffffff & (handler >> 2)); | 1202 | (0x03ffffff & (handler >> 2)); |
| 1203 | flush_icache_range(ebase + 0x200, ebase + 0x204); | 1203 | local_flush_icache_range(ebase + 0x200, ebase + 0x204); |
| 1204 | } | 1204 | } |
| 1205 | return (void *)old_handler; | 1205 | return (void *)old_handler; |
| 1206 | } | 1206 | } |
| @@ -1283,7 +1283,8 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
| 1283 | *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff); | 1283 | *w = (*w & 0xffff0000) | (((u32)handler >> 16) & 0xffff); |
| 1284 | w = (u32 *)(b + ori_offset); | 1284 | w = (u32 *)(b + ori_offset); |
| 1285 | *w = (*w & 0xffff0000) | ((u32)handler & 0xffff); | 1285 | *w = (*w & 0xffff0000) | ((u32)handler & 0xffff); |
| 1286 | flush_icache_range((unsigned long)b, (unsigned long)(b+handler_len)); | 1286 | local_flush_icache_range((unsigned long)b, |
| 1287 | (unsigned long)(b+handler_len)); | ||
| 1287 | } | 1288 | } |
| 1288 | else { | 1289 | else { |
| 1289 | /* | 1290 | /* |
| @@ -1295,7 +1296,8 @@ static void *set_vi_srs_handler(int n, vi_handler_t addr, int srs) | |||
| 1295 | w = (u32 *)b; | 1296 | w = (u32 *)b; |
| 1296 | *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */ | 1297 | *w++ = 0x08000000 | (((u32)handler >> 2) & 0x03fffff); /* j handler */ |
| 1297 | *w = 0; | 1298 | *w = 0; |
| 1298 | flush_icache_range((unsigned long)b, (unsigned long)(b+8)); | 1299 | local_flush_icache_range((unsigned long)b, |
| 1300 | (unsigned long)(b+8)); | ||
| 1299 | } | 1301 | } |
| 1300 | 1302 | ||
| 1301 | return (void *)old_handler; | 1303 | return (void *)old_handler; |
| @@ -1515,7 +1517,7 @@ void __cpuinit per_cpu_trap_init(void) | |||
| 1515 | void __init set_handler(unsigned long offset, void *addr, unsigned long size) | 1517 | void __init set_handler(unsigned long offset, void *addr, unsigned long size) |
| 1516 | { | 1518 | { |
| 1517 | memcpy((void *)(ebase + offset), addr, size); | 1519 | memcpy((void *)(ebase + offset), addr, size); |
| 1518 | flush_icache_range(ebase + offset, ebase + offset + size); | 1520 | local_flush_icache_range(ebase + offset, ebase + offset + size); |
| 1519 | } | 1521 | } |
| 1520 | 1522 | ||
| 1521 | static char panic_null_cerr[] __cpuinitdata = | 1523 | static char panic_null_cerr[] __cpuinitdata = |
| @@ -1680,6 +1682,8 @@ void __init trap_init(void) | |||
| 1680 | signal32_init(); | 1682 | signal32_init(); |
| 1681 | #endif | 1683 | #endif |
| 1682 | 1684 | ||
| 1683 | flush_icache_range(ebase, ebase + 0x400); | 1685 | local_flush_icache_range(ebase, ebase + 0x400); |
| 1684 | flush_tlb_handlers(); | 1686 | flush_tlb_handlers(); |
| 1687 | |||
| 1688 | sort_extable(__start___dbe_table, __stop___dbe_table); | ||
| 1685 | } | 1689 | } |
