implemented trap #0 handler in assembler

This commit is contained in:
Markus Fröschle
2013-05-11 10:08:24 +00:00
parent d64f4571f9
commit 838e731ef6
2 changed files with 28 additions and 29 deletions

View File

@@ -32,30 +32,6 @@
static BPB sd_bpb[4]; /* space for four partitions on SD card */
static xhdi_call_fun old_vector = NULL;
extern uint32_t xhdi_vec(uint16_t *stack);
__attribute__((__interrupt__)) xhdi_call_fun xhdi_sd_install(xhdi_call_fun ov)
{
old_vector = ov;
uint32_t *_drvbits = (uint32_t *) 0x4c2;
__asm__ __volatile__ (
"move.l %[xhdi_call],d1\n\t"
"move.l d1,(sp)\n\t" /* FIXME: dirty overwrite of saved register on stack with return value */
"move.l d1,8(sp)\n\t"
: /* output */
: [xhdi_call]"g"(xhdi_vec)
: "d1","memory");
*_drvbits |= (uint32_t) 1 << ('S' - 'A');
/*
* this is just to make the compiler happy, the return value is overwritten anyway. Therefore we previously overwrite
* the saved register value on the stack so everything is as we want it to be
*/
return (xhdi_call_fun) xhdi_call;
}
uint16_t xhdi_version(void)
{
xprintf("xhdi_version() called\r\n");