fixed vector bending (very ugly)

This commit is contained in:
Markus Fröschle
2013-05-01 16:30:15 +00:00
parent 2f566bc499
commit 839277710a
2 changed files with 10 additions and 3 deletions

View File

@@ -72,7 +72,7 @@ typedef void* (*xhdi_call_fun)(int xhdi_fun, ...);
extern uint32_t xhdi_call(int xhdi_fun, ...);
extern void *xhdi_sd_install(xhdi_call_fun old_vector) __attribute__((__interrupt__));
extern xhdi_call_fun xhdi_sd_install(xhdi_call_fun old_vector) __attribute__((__interrupt__));
extern uint32_t xhdi_version(void); /* XHDI 0 */

View File

@@ -14,10 +14,17 @@
static xhdi_call_fun old_vector = NULL;
__attribute__((__interrupt__)) void *xhdi_sd_install(xhdi_call_fun ov)
__attribute__((__interrupt__)) xhdi_call_fun xhdi_sd_install(xhdi_call_fun ov)
{
old_vector = ov;
return (void *) xhdi_call;
/* THIS does not work: return (xhdi_call_fun) &xhdi_call; */
__asm__ __volatile__ (
"move.l %[xhdi_call],d1\n\t"
"move.l d1,(sp)\n\t"
: /* output */
: [xhdi_call]"g"(xhdi_call)
: "d1","memory");
return (xhdi_call_fun) xhdi_call;
}
uint32_t xhdi_version(void)