Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181055
b: refs/heads/master
c: 94cd049
h: refs/heads/master
i:
  181053: 37a7dda
  181051: 03bbb6a
  181047: fc3c2a0
  181039: 54fda17
  181023: 3586412
  180991: 6d7d298
v: v3
  • Loading branch information
Paul Mundt committed Jan 12, 2010
1 parent ad59e84 commit bd97e6b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a99eae5417a09e0be66bf574a9a79a2a7388c967
refs/heads/master: 94cd049522136c2f3bbe063d2e98b2b8d4286fd3
15 changes: 11 additions & 4 deletions trunk/arch/sh/kernel/sh_bios.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand All @@ -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");
Expand Down Expand Up @@ -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
Expand All @@ -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");
}

/**
Expand Down

0 comments on commit bd97e6b

Please sign in to comment.