Changeset 6597e58 in rtems


Ignore:
Timestamp:
Sep 9, 2009, 2:17:10 PM (10 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.9
Children:
ff79baf0
Parents:
32b09a9
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

    r32b09a9 r6597e58  
     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-07-30  Eric Norum <norume@aps.anl.gov>
    28
  • c/src/lib/libbsp/m68k/uC5282/startup/bspstart.c

    r32b09a9 r6597e58  
    189189void bsp_pretasking_hook(void);         /* m68k version */
    190190
     191extern void bsp_fake_syscall();
     192
    191193/*
    192194 * The Arcturus boot ROM prints exception information improperly
     
    261263            *((void (**)(int))(i * 4)) = handler;
    262264
     265        /*
     266         * Qemu has no trap handler; install our fake syscall
     267         * implementation if there is no existing handler.
     268         */
     269        if ( 0 == *((void (**)(int))((32+2) * 4)) )
     270                *((void (**)(int))((32+2) * 4)) = bsp_fake_syscall;
     271
    263272  /*
    264273   *  Need to "allocate" the memory for the RTEMS Workspace and
     
    419428syscall_3(int, flash_erase_range, volatile unsigned short *, flashptr, int, start, int, end);
    420429syscall_3(int, flash_write_range, volatile unsigned short *, flashptr, bsp_mnode_t *, chain, int, offset);
     430
     431/* Provide a dummy-implementation of these syscalls
     432 * for qemu (which lacks the firmware).
     433 */
     434
     435#define __STR(x)    #x
     436#define __STRSTR(x) __STR(x)
     437#define ERRVAL      __STRSTR(EACCES)
     438
     439/* reset-control register */
     440#define RCR "__IPSBAR + 0x110000"
     441
     442asm(
     443    "bsp_fake_syscall:         \n"
     444    "   cmpl  #0,  %d0         \n" /* sysreset    */
     445    "   bne   1f               \n"
     446    "   moveb #0x80, %d0       \n"
     447    "   moveb %d0, "RCR"       \n" /* reset-controller */
     448        /* should never get here - but we'd return -EACCESS if we do */
     449    "1:                        \n"
     450    "   cmpl  #12, %d0         \n" /* gethwaddr   */
     451    "   beq   2f               \n"
     452    "   cmpl  #14, %d0         \n" /* getbenv     */
     453    "   beq   2f               \n"
     454    "   movel #-"ERRVAL", %d0  \n" /* return -EACCESS */
     455    "   rte                    \n"
     456    "2:                        \n"
     457    "   movel #0,  %d0         \n" /* return NULL */
     458    "   rte                    \n"
     459);
     460
    421461
    422462/*
Note: See TracChangeset for help on using the changeset viewer.