Changeset ddfae71a in rtems


Ignore:
Timestamp:
Sep 9, 2009, 5:34:44 AM (10 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, master
Children:
3f7a0e1c
Parents:
ad41373
Message:

2009-09-09 Till Straumann <strauman@…>

  • 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.
Location:
c/src/lib/libbsp/m68k/uC5282
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/m68k/uC5282/ChangeLog

    rad41373 rddfae71a  
     12009-09-09      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * startup/bspstart.c: Added dummy implementation of firmware
     4        syscalls for use with QEMU. Dummy handler is installed if no
     5        pre-existing firmware handler is found.
     6
    172009-08-26      Joel Sherrill <joel.sherrill@oarcorp.com>
    28
  • c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c

    rad41373 rddfae71a  
    185185}
    186186
     187extern void bsp_fake_syscall();
     188
    187189/*
    188190 * The Arcturus boot ROM prints exception information improperly
     
    265267
    266268  /*
     269   * Qemu has no trap handler; install our fake syscall
     270   * implementation if there is no existing handler.
     271   */
     272  if ( 0 == *((void (**)(int))((32+2) * 4)) )
     273    *((void (**)(int))((32+2) * 4)) = bsp_fake_syscall;
     274
     275  /*
    267276   * Enable the cache
    268277   */
     
    394403syscall_3(int, flash_erase_range, volatile unsigned short *, flashptr, int, start, int, end);
    395404syscall_3(int, flash_write_range, volatile unsigned short *, flashptr, bsp_mnode_t *, chain, int, offset);
     405
     406/* Provide a dummy-implementation of these syscalls
     407 * for qemu (which lacks the firmware).
     408 */
     409
     410#define __STR(x)    #x
     411#define __STRSTR(x) __STR(x)
     412#define ERRVAL      __STRSTR(EACCES)
     413
     414/* reset-control register */
     415#define RCR "__IPSBAR + 0x110000"
     416
     417asm(
     418    "bsp_fake_syscall:         \n"
     419    "   cmpl  #0,  %d0         \n" /* sysreset    */
     420    "   bne   1f               \n"
     421    "   moveb #0x80, %d0       \n"
     422    "   moveb %d0, "RCR"       \n" /* reset-controller */
     423        /* should never get here - but we'd return -EACCESS if we do */
     424    "1:                        \n"
     425    "   cmpl  #12, %d0         \n" /* gethwaddr   */
     426    "   beq   2f               \n"
     427    "   cmpl  #14, %d0         \n" /* getbenv     */
     428    "   beq   2f               \n"
     429    "   movel #-"ERRVAL", %d0  \n" /* return -EACCESS */
     430    "   rte                    \n"
     431    "2:                        \n"
     432    "   movel #0,  %d0         \n" /* return NULL */
     433    "   rte                    \n"
     434);
     435
    396436
    397437/*
Note: See TracChangeset for help on using the changeset viewer.