aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sh/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sh/kernel')
-rw-r--r--arch/sh/kernel/cpu/sh4a/clock-sh7785.c2
-rw-r--r--arch/sh/kernel/entry-common.S12
-rw-r--r--arch/sh/kernel/head_32.S4
-rw-r--r--arch/sh/kernel/kgdb_stub.c11
-rw-r--r--arch/sh/kernel/setup.c11
-rw-r--r--arch/sh/kernel/traps.c10
6 files changed, 34 insertions, 16 deletions
diff --git a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
index 805535aa505e..27fa81bef6a0 100644
--- a/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
+++ b/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
@@ -26,7 +26,7 @@ static int pfc_divisors[] = { 1, 1, 1, 1, 1, 1, 1, 18,
26 26
27static void master_clk_init(struct clk *clk) 27static void master_clk_init(struct clk *clk)
28{ 28{
29 clk->rate *= 36; 29 clk->rate *= pfc_divisors[ctrl_inl(FRQMR1) & 0x000f];
30} 30}
31 31
32static struct clk_ops sh7785_master_clk_ops = { 32static struct clk_ops sh7785_master_clk_ops = {
diff --git a/arch/sh/kernel/entry-common.S b/arch/sh/kernel/entry-common.S
index 926b2e7b11c1..718bd2356b34 100644
--- a/arch/sh/kernel/entry-common.S
+++ b/arch/sh/kernel/entry-common.S
@@ -1,9 +1,6 @@
1/* $Id: entry.S,v 1.37 2004/06/11 13:02:46 doyu Exp $ 1/*
2 *
3 * linux/arch/sh/entry.S
4 *
5 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka 2 * Copyright (C) 1999, 2000, 2002 Niibe Yutaka
6 * Copyright (C) 2003 Paul Mundt 3 * Copyright (C) 2003 - 2008 Paul Mundt
7 * 4 *
8 * This file is subject to the terms and conditions of the GNU General Public 5 * This file is subject to the terms and conditions of the GNU General Public
9 * License. See the file "COPYING" in the main directory of this archive 6 * License. See the file "COPYING" in the main directory of this archive
@@ -262,6 +259,7 @@ __restore_all:
262 259
263 .align 2 260 .align 2
264syscall_badsys: ! Bad syscall number 261syscall_badsys: ! Bad syscall number
262 get_current_thread_info r8, r0
265 mov #-ENOSYS, r0 263 mov #-ENOSYS, r0
266 bra resume_userspace 264 bra resume_userspace
267 mov.l r0, @(OFF_R0,r15) ! Return value 265 mov.l r0, @(OFF_R0,r15) ! Return value
@@ -281,7 +279,9 @@ debug_trap:
281 mov.l 1f, r8 279 mov.l 1f, r8
282 add r0, r8 280 add r0, r8
283 mov.l @r8, r8 281 mov.l @r8, r8
284 jmp @r8 282 jsr @r8
283 nop
284 bra __restore_all
285 nop 285 nop
286 286
287 .align 2 287 .align 2
diff --git a/arch/sh/kernel/head_32.S b/arch/sh/kernel/head_32.S
index d67d7ed09f22..ae0a382a82eb 100644
--- a/arch/sh/kernel/head_32.S
+++ b/arch/sh/kernel/head_32.S
@@ -30,8 +30,8 @@ ENTRY(empty_zero_page)
30 .long 0 /* RAMDISK_FLAGS */ 30 .long 0 /* RAMDISK_FLAGS */
31 .long 0x0200 /* ORIG_ROOT_DEV */ 31 .long 0x0200 /* ORIG_ROOT_DEV */
32 .long 1 /* LOADER_TYPE */ 32 .long 1 /* LOADER_TYPE */
33 .long 0x00360000 /* INITRD_START */ 33 .long 0x00000000 /* INITRD_START */
34 .long 0x000a0000 /* INITRD_SIZE */ 34 .long 0x00000000 /* INITRD_SIZE */
35#ifdef CONFIG_32BIT 35#ifdef CONFIG_32BIT
36 .long 0x53453f00 + 32 /* "SE?" = 32 bit */ 36 .long 0x53453f00 + 32 /* "SE?" = 32 bit */
37#else 37#else
diff --git a/arch/sh/kernel/kgdb_stub.c b/arch/sh/kernel/kgdb_stub.c
index 832641bbd47d..bf8ac4c71640 100644
--- a/arch/sh/kernel/kgdb_stub.c
+++ b/arch/sh/kernel/kgdb_stub.c
@@ -274,8 +274,7 @@ static char *mem_to_hex(const char *mem, char *buf, const int count)
274 } 274 }
275 for (i = 0; i < count; i++) { 275 for (i = 0; i < count; i++) {
276 ch = *mem++; 276 ch = *mem++;
277 *buf++ = highhex(ch); 277 buf = pack_hex_byte(buf, ch);
278 *buf++ = lowhex(ch);
279 } 278 }
280 *buf = 0; 279 *buf = 0;
281 return (buf); 280 return (buf);
@@ -427,8 +426,8 @@ static void put_packet(char *buffer)
427 426
428 /* '#' Separator, put high and low components of checksum */ 427 /* '#' Separator, put high and low components of checksum */
429 put_debug_char('#'); 428 put_debug_char('#');
430 put_debug_char(highhex(checksum)); 429 put_debug_char(hex_asc_hi(checksum));
431 put_debug_char(lowhex(checksum)); 430 put_debug_char(hex_asc_lo(checksum));
432 } 431 }
433 while ((get_debug_char()) != '+'); /* While no ack */ 432 while ((get_debug_char()) != '+'); /* While no ack */
434} 433}
@@ -650,8 +649,8 @@ static void undo_single_step(void)
650static void send_signal_msg(const int signum) 649static void send_signal_msg(const int signum)
651{ 650{
652 out_buffer[0] = 'S'; 651 out_buffer[0] = 'S';
653 out_buffer[1] = highhex(signum); 652 out_buffer[1] = hex_asc_hi(signum);
654 out_buffer[2] = lowhex(signum); 653 out_buffer[2] = hex_asc_lo(signum);
655 out_buffer[3] = 0; 654 out_buffer[3] = 0;
656 put_packet(out_buffer); 655 put_packet(out_buffer);
657} 656}
diff --git a/arch/sh/kernel/setup.c b/arch/sh/kernel/setup.c
index 516bde9c50fa..bca2bbc575db 100644
--- a/arch/sh/kernel/setup.c
+++ b/arch/sh/kernel/setup.c
@@ -292,6 +292,17 @@ void __init setup_arch(char **cmdline_p)
292 292
293 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV); 293 ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
294 294
295 printk(KERN_NOTICE "Boot params:\n"
296 "... MOUNT_ROOT_RDONLY - %08lx\n"
297 "... RAMDISK_FLAGS - %08lx\n"
298 "... ORIG_ROOT_DEV - %08lx\n"
299 "... LOADER_TYPE - %08lx\n"
300 "... INITRD_START - %08lx\n"
301 "... INITRD_SIZE - %08lx\n",
302 MOUNT_ROOT_RDONLY, RAMDISK_FLAGS,
303 ORIG_ROOT_DEV, LOADER_TYPE,
304 INITRD_START, INITRD_SIZE);
305
295#ifdef CONFIG_BLK_DEV_RAM 306#ifdef CONFIG_BLK_DEV_RAM
296 rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK; 307 rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
297 rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0); 308 rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
diff --git a/arch/sh/kernel/traps.c b/arch/sh/kernel/traps.c
index a3bdc68ef02c..438f1ebcc453 100644
--- a/arch/sh/kernel/traps.c
+++ b/arch/sh/kernel/traps.c
@@ -4,6 +4,7 @@
4#include <linux/kdebug.h> 4#include <linux/kdebug.h>
5#include <linux/signal.h> 5#include <linux/signal.h>
6#include <linux/sched.h> 6#include <linux/sched.h>
7#include <linux/uaccess.h>
7#include <asm/system.h> 8#include <asm/system.h>
8 9
9#ifdef CONFIG_BUG 10#ifdef CONFIG_BUG
@@ -21,7 +22,14 @@ static void handle_BUG(struct pt_regs *regs)
21 22
22int is_valid_bugaddr(unsigned long addr) 23int is_valid_bugaddr(unsigned long addr)
23{ 24{
24 return addr >= PAGE_OFFSET; 25 unsigned short opcode;
26
27 if (addr < PAGE_OFFSET)
28 return 0;
29 if (probe_kernel_address((u16 *)addr, opcode))
30 return 0;
31
32 return opcode == TRAPA_BUG_OPCODE;
25} 33}
26#endif 34#endif
27 35