提交 db07b023 编写于 作者: L Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
  sh: Fix up restorer in debug_trap exception return path.
  sh: Make is_valid_bugaddr() more intelligent on nommu.
  sh: use the common ascii hex helpers
  sh: fix sh7785 master clock value
  sh: Fix up thread info pointer in syscall_badsys resume path.
  sh: Fix up optimized SH-4 memcpy on big endian.
  sh: disable initrd defaults in .empty_zero_page.
  sh: display boot params by default on entry.
......@@ -26,7 +26,7 @@ static int pfc_divisors[] = { 1, 1, 1, 1, 1, 1, 1, 18,
static void master_clk_init(struct clk *clk)
{
clk->rate *= 36;
clk->rate *= pfc_divisors[ctrl_inl(FRQMR1) & 0x000f];
}
static struct clk_ops sh7785_master_clk_ops = {
......
/* $Id: entry.S,v 1.37 2004/06/11 13:02:46 doyu Exp $
*
* linux/arch/sh/entry.S
*
/*
* Copyright (C) 1999, 2000, 2002 Niibe Yutaka
* Copyright (C) 2003 Paul Mundt
* Copyright (C) 2003 - 2008 Paul Mundt
*
* 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
......@@ -262,6 +259,7 @@ __restore_all:
.align 2
syscall_badsys: ! Bad syscall number
get_current_thread_info r8, r0
mov #-ENOSYS, r0
bra resume_userspace
mov.l r0, @(OFF_R0,r15) ! Return value
......@@ -281,7 +279,9 @@ debug_trap:
mov.l 1f, r8
add r0, r8
mov.l @r8, r8
jmp @r8
jsr @r8
nop
bra __restore_all
nop
.align 2
......
......@@ -30,8 +30,8 @@ ENTRY(empty_zero_page)
.long 0 /* RAMDISK_FLAGS */
.long 0x0200 /* ORIG_ROOT_DEV */
.long 1 /* LOADER_TYPE */
.long 0x00360000 /* INITRD_START */
.long 0x000a0000 /* INITRD_SIZE */
.long 0x00000000 /* INITRD_START */
.long 0x00000000 /* INITRD_SIZE */
#ifdef CONFIG_32BIT
.long 0x53453f00 + 32 /* "SE?" = 32 bit */
#else
......
......@@ -274,8 +274,7 @@ static char *mem_to_hex(const char *mem, char *buf, const int count)
}
for (i = 0; i < count; i++) {
ch = *mem++;
*buf++ = highhex(ch);
*buf++ = lowhex(ch);
buf = pack_hex_byte(buf, ch);
}
*buf = 0;
return (buf);
......@@ -427,8 +426,8 @@ static void put_packet(char *buffer)
/* '#' Separator, put high and low components of checksum */
put_debug_char('#');
put_debug_char(highhex(checksum));
put_debug_char(lowhex(checksum));
put_debug_char(hex_asc_hi(checksum));
put_debug_char(hex_asc_lo(checksum));
}
while ((get_debug_char()) != '+'); /* While no ack */
}
......@@ -650,8 +649,8 @@ static void undo_single_step(void)
static void send_signal_msg(const int signum)
{
out_buffer[0] = 'S';
out_buffer[1] = highhex(signum);
out_buffer[2] = lowhex(signum);
out_buffer[1] = hex_asc_hi(signum);
out_buffer[2] = hex_asc_lo(signum);
out_buffer[3] = 0;
put_packet(out_buffer);
}
......
......@@ -292,6 +292,17 @@ void __init setup_arch(char **cmdline_p)
ROOT_DEV = old_decode_dev(ORIG_ROOT_DEV);
printk(KERN_NOTICE "Boot params:\n"
"... MOUNT_ROOT_RDONLY - %08lx\n"
"... RAMDISK_FLAGS - %08lx\n"
"... ORIG_ROOT_DEV - %08lx\n"
"... LOADER_TYPE - %08lx\n"
"... INITRD_START - %08lx\n"
"... INITRD_SIZE - %08lx\n",
MOUNT_ROOT_RDONLY, RAMDISK_FLAGS,
ORIG_ROOT_DEV, LOADER_TYPE,
INITRD_START, INITRD_SIZE);
#ifdef CONFIG_BLK_DEV_RAM
rd_image_start = RAMDISK_FLAGS & RAMDISK_IMAGE_START_MASK;
rd_prompt = ((RAMDISK_FLAGS & RAMDISK_PROMPT_FLAG) != 0);
......
......@@ -4,6 +4,7 @@
#include <linux/kdebug.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/uaccess.h>
#include <asm/system.h>
#ifdef CONFIG_BUG
......@@ -21,7 +22,14 @@ static void handle_BUG(struct pt_regs *regs)
int is_valid_bugaddr(unsigned long addr)
{
return addr >= PAGE_OFFSET;
unsigned short opcode;
if (addr < PAGE_OFFSET)
return 0;
if (probe_kernel_address((u16 *)addr, opcode))
return 0;
return opcode == TRAPA_BUG_OPCODE;
}
#endif
......
......@@ -126,10 +126,10 @@
mov.l r3,@-r0 ! 30 LS
#else
3: mov r1,r3 ! OPQR
3: mov r7,r3 ! OPQR
shlr8 r3 ! xOPQ
mov.l @(r0,r5),r1 ! KLMN
mov r1,r6
mov.l @(r0,r5),r7 ! KLMN
mov r7,r6
shll16 r6
shll8 r6 ! Nxxx
or r6,r3 ! NOPQ
......@@ -733,24 +733,24 @@ ENTRY(memcpy)
movca.l r0,@r1 ! 40 LS (latency=3-7)
add #-0x1c, r1 ! 50 EX
mov.l r3, @(0x1c,r1) ! 33 LS
mov.l r3, @(0x18,r1) ! 33 LS
xtrct r11, r10 ! 48 EX
mov.l r6, @(0x18,r1) ! 33 LS
mov.l r6, @(0x14,r1) ! 33 LS
xtrct r12, r11 ! 48 EX
mov.l r7, @(0x14,r1) ! 33 LS
mov.l r7, @(0x10,r1) ! 33 LS
mov.l r8, @(0x10,r1) ! 33 LS
add #-0x3e, r5 ! 50 EX
mov.l r8, @(0x0c,r1) ! 33 LS
add #-0x1e, r5 ! 50 EX
mov.l r9, @(0x0c,r1) ! 33 LS
mov.l r9, @(0x08,r1) ! 33 LS
cmp/eq r2,r1 ! 54 MT
mov.l r10, @(0x08,r1) ! 33 LS
mov.l r10, @(0x04,r1) ! 33 LS
bf/s 2b ! 109 BR
mov.l r11, @(0x04,r1) ! 33 LS
mov.l r11, @(0x00,r1) ! 33 LS
#endif
mov.l @r15+, r12
......
......@@ -184,15 +184,15 @@ static void put_string(struct sci_port *sci_port, const char *buffer, int count)
int h, l;
c = *p++;
h = highhex(c);
l = lowhex(c);
h = hex_asc_hi(c);
l = hex_asc_lo(c);
put_char(port, h);
put_char(port, l);
checksum += h + l;
}
put_char(port, '#');
put_char(port, highhex(checksum));
put_char(port, lowhex(checksum));
put_char(port, hex_asc_hi(checksum));
put_char(port, hex_asc_lo(checksum));
} while (get_char(port) != '+');
} else
#endif /* CONFIG_SH_STANDARD_BIOS || CONFIG_SH_KGDB */
......
......@@ -66,18 +66,4 @@ extern int setjmp(jmp_buf __jmpb);
/* Forced breakpoint */
#define breakpoint() __asm__ __volatile__("trapa #0x3c")
/* Taken from sh-stub.c of GDB 4.18 */
static const char hexchars[] = "0123456789abcdef";
/* Get high hex bits */
static inline char highhex(const int x)
{
return hexchars[(x >> 4) & 0xf];
}
/* Get low hex bits */
static inline char lowhex(const int x)
{
return hexchars[x & 0xf];
}
#endif
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册