forked from Imagelibrary/rtems
2009-09-09 Till Straumann <strauman@slac.stanford.edu>
* startup/bspstart.c: Added dummy implementation of firmware syscalls for use with QEMU. Dummy handler is installed if no pre-existing firmware handler is found.
This commit is contained in:
@@ -1,3 +1,9 @@
|
|||||||
|
2009-09-09 Till Straumann <strauman@slac.stanford.edu>
|
||||||
|
|
||||||
|
* startup/bspstart.c: Added dummy implementation of firmware
|
||||||
|
syscalls for use with QEMU. Dummy handler is installed if no
|
||||||
|
pre-existing firmware handler is found.
|
||||||
|
|
||||||
2009-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
|
2009-08-26 Joel Sherrill <joel.sherrill@oarcorp.com>
|
||||||
|
|
||||||
* clock/clock.c, include/bsp.h: Rename BSP specific idle thread to
|
* clock/clock.c, include/bsp.h: Rename BSP specific idle thread to
|
||||||
|
|||||||
@@ -184,6 +184,8 @@ void _CPU_cache_invalidate_1_data_line(const void *addr)
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
extern void bsp_fake_syscall();
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The Arcturus boot ROM prints exception information improperly
|
* The Arcturus boot ROM prints exception information improperly
|
||||||
* so use this default exception handler instead. This one also
|
* so use this default exception handler instead. This one also
|
||||||
@@ -263,6 +265,13 @@ void bsp_start( void )
|
|||||||
MCF5XXX_ACR_BWE;
|
MCF5XXX_ACR_BWE;
|
||||||
m68k_set_acr0(mcf5282_acr0_mode);
|
m68k_set_acr0(mcf5282_acr0_mode);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Qemu has no trap handler; install our fake syscall
|
||||||
|
* implementation if there is no existing handler.
|
||||||
|
*/
|
||||||
|
if ( 0 == *((void (**)(int))((32+2) * 4)) )
|
||||||
|
*((void (**)(int))((32+2) * 4)) = bsp_fake_syscall;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Enable the cache
|
* Enable the cache
|
||||||
*/
|
*/
|
||||||
@@ -394,6 +403,37 @@ syscall_2(int, program, bsp_mnode_t *, chain, int, flags)
|
|||||||
syscall_3(int, flash_erase_range, volatile unsigned short *, flashptr, int, start, int, end);
|
syscall_3(int, flash_erase_range, volatile unsigned short *, flashptr, int, start, int, end);
|
||||||
syscall_3(int, flash_write_range, volatile unsigned short *, flashptr, bsp_mnode_t *, chain, int, offset);
|
syscall_3(int, flash_write_range, volatile unsigned short *, flashptr, bsp_mnode_t *, chain, int, offset);
|
||||||
|
|
||||||
|
/* Provide a dummy-implementation of these syscalls
|
||||||
|
* for qemu (which lacks the firmware).
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define __STR(x) #x
|
||||||
|
#define __STRSTR(x) __STR(x)
|
||||||
|
#define ERRVAL __STRSTR(EACCES)
|
||||||
|
|
||||||
|
/* reset-control register */
|
||||||
|
#define RCR "__IPSBAR + 0x110000"
|
||||||
|
|
||||||
|
asm(
|
||||||
|
"bsp_fake_syscall: \n"
|
||||||
|
" cmpl #0, %d0 \n" /* sysreset */
|
||||||
|
" bne 1f \n"
|
||||||
|
" moveb #0x80, %d0 \n"
|
||||||
|
" moveb %d0, "RCR" \n" /* reset-controller */
|
||||||
|
/* should never get here - but we'd return -EACCESS if we do */
|
||||||
|
"1: \n"
|
||||||
|
" cmpl #12, %d0 \n" /* gethwaddr */
|
||||||
|
" beq 2f \n"
|
||||||
|
" cmpl #14, %d0 \n" /* getbenv */
|
||||||
|
" beq 2f \n"
|
||||||
|
" movel #-"ERRVAL", %d0 \n" /* return -EACCESS */
|
||||||
|
" rte \n"
|
||||||
|
"2: \n"
|
||||||
|
" movel #0, %d0 \n" /* return NULL */
|
||||||
|
" rte \n"
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* 'Extended BSP' routines
|
* 'Extended BSP' routines
|
||||||
* Should move to cpukit/score/cpu/m68k/cpu.c someday.
|
* Should move to cpukit/score/cpu/m68k/cpu.c someday.
|
||||||
|
|||||||
Reference in New Issue
Block a user