From bd97e6b4c0ae10f019e441fc84a7614d21cb780f Mon Sep 17 00:00:00 2001 From: Paul Mundt Date: Tue, 12 Jan 2010 18:42:52 +0900 Subject: [PATCH] --- yaml --- r: 181055 b: refs/heads/master c: 94cd049522136c2f3bbe063d2e98b2b8d4286fd3 h: refs/heads/master i: 181053: 37a7dda4a01ce850e5977ee05e2e535aedbf3cbd 181051: 03bbb6a84c9703be9840771f0862a057ad1bc5db 181047: fc3c2a095e43f1f9f5afb4679de002f591374dbf 181039: 54fda17a122d29049dbdaae751a0360d9fc3d3f7 181023: 35864125cca488aeb789ccd30f2c2e2da0b1a132 180991: 6d7d29831576d80148d07f65c664e457938e9716 v: v3 --- [refs] | 2 +- trunk/arch/sh/kernel/sh_bios.c | 15 +++++++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/[refs] b/[refs] index 878f8d20c51a..16b8a2faf883 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a99eae5417a09e0be66bf574a9a79a2a7388c967 +refs/heads/master: 94cd049522136c2f3bbe063d2e98b2b8d4286fd3 diff --git a/trunk/arch/sh/kernel/sh_bios.c b/trunk/arch/sh/kernel/sh_bios.c index 29cd2526e5c4..47475cca068a 100644 --- a/trunk/arch/sh/kernel/sh_bios.c +++ b/trunk/arch/sh/kernel/sh_bios.c @@ -23,6 +23,8 @@ #define BIOS_CALL_SHUTDOWN 11 #define BIOS_CALL_GDB_DETACH 0xff +void *gdb_vbr_vector = NULL; + static inline long sh_bios_call(long func, long arg0, long arg1, long arg2, long arg3) { @@ -32,6 +34,9 @@ static inline long sh_bios_call(long func, long arg0, long arg1, long arg2, register long r6 __asm__("r6") = arg2; register long r7 __asm__("r7") = arg3; + if (!gdb_vbr_vector) + return -ENOSYS; + __asm__ __volatile__("trapa #0x3f":"=z"(r0) :"0"(r0), "r"(r4), "r"(r5), "r"(r6), "r"(r7) :"memory"); @@ -60,8 +65,6 @@ void sh_bios_shutdown(unsigned int how) sh_bios_call(BIOS_CALL_SHUTDOWN, how, 0, 0, 0); } -void *gdb_vbr_vector = NULL; - /* * Read the old value of the VBR register to initialise the vector * through which debug and BIOS traps are delegated by the Linux trap @@ -76,8 +79,12 @@ void sh_bios_vbr_init(void) __asm__ __volatile__ ("stc vbr, %0" : "=r" (vbr)); - gdb_vbr_vector = (void *)(vbr + 0x100); - printk(KERN_NOTICE "Setting GDB trap vector to %p\n", gdb_vbr_vector); + if (vbr) { + gdb_vbr_vector = (void *)(vbr + 0x100); + printk(KERN_NOTICE "Setting GDB trap vector to %p\n", + gdb_vbr_vector); + } else + printk(KERN_NOTICE "SH-BIOS not detected\n"); } /**