⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 syslib.c

📁 Tornado 2.0 BSP for HaeDong HD860-R3 韩国HaeDong公司开发的基于Motorola的MPC860处理器的开发板的BSP
💻 C
📖 第 1 页 / 共 3 页
字号:
/*                                                                          */
/* Purpose. : Returns the top of the VxWorks memory.                        */
/*                                                                          */
/* Returns. : Pointer to first byte of memory not in VxWorks control.       */
/*                                                                          */
/* Notes... : USER_RESERVED_MEM can be redefined in config.h                */
/*                                                                          */
/****************************************************************************/

char *sysMemTop( void )
{
    static char * memTop = NULL;

    if ( memTop == NULL )
    {
      memTop = sysPhysMemTop() - USER_RESERVED_MEM ;
    }

    return memTop ;
}

/****************************************************************************/
/*                                                                          */
/* Function : sysToMonitor( int startType )                                 */
/*                                                                          */
/* Purpose. : Transfers control to the ROM Monitor.                         */
/*                                                                          */
/* Returns. : OK - if return from the ROM Monitor                           */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

STATUS sysToMonitor
    (
       int startType    /* parameter passed to ROM to tell it how to boot   */
    )
{
    FUNCPTR pRom = (FUNCPTR) (ROM_TEXT_ADRS + 4);       /* Warm reboot      */

    sysCpmEnetDisable( 0 );     /* disable the ethernet device              */
    sysCpmEnetIntDisable( 0 );  /* disable the ethernet device interrupt    */
    sysSerialReset();           /* reset the serail device                  */
    (*pRom) (startType);        /* jump to bootrom entry point              */

    return( OK );               /* in case we continue from ROM monitor     */
}

/****************************************************************************/
/*                                                                          */
/* Function : sysHwInit2( void )                                            */
/*                                                                          */
/* Purpose. : Connects system interrupts and starts the clock.              */
/*                                                                          */
/* Returns. : None                                                          */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

void sysHwInit2 (void)
{
    static BOOL configured = FALSE ; 
    int    immrVal;                 

    if ( ! configured )
    {

        /*                                                                  */
        /* Get the location of the IMMR register.                           */
        /*                                                                  */
        immrVal = vxImmrGet() ;

        /*                                                                  */
        /* initialize serial interrupts                                     */
        /*                                                                  */
        sysSerialHwInit2() ;

        /*																	*/
        /*  Determine 32khz/25mhz in order to correctly specify 			*/
        /*  Timebase source.                                				*/

        if ( *SCCR(immrVal) & SCCR_RTSEL )
          *SCCR(immrVal) &= ~SCCR_TBS;
        else
          *SCCR(immrVal) |= SCCR_TBS;  

        /*    													            */
        /*  Un-freeze the Time Base clock.                      			*/
        /*    													            */

        *TBSCR(immrVal) = TBSCR_TBE | TBSCR_TBF; 

        /*                                                                  */
        /* Indicate we have been through this procedure for reentrancy.     */
        /*                                                                  */
        configured = TRUE ;
    }
}

/****************************************************************************/
/*                                                                          */
/* Function : sysProcNumSet( void )                                         */
/*                                                                          */
/* Purpose. : Returns the process number of the CPU board.                  */
/*                                                                          */
/* Returns. : Processor number                                              */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

int sysProcNumGet( void )
{
 return( sysProcNum );
}

/****************************************************************************/
/*                                                                          */
/* Function : sysProcNumSet( int procNum )                                  */
/*                                                                          */
/* Purpose. : Sets the CPU processor numbers.                               */
/*                                                                          */
/* Returns. : None                                                          */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

void sysProcNumSet
    (
        int     procNum         /* processor number */
    )
{
    sysProcNum = procNum;
}

/****************************************************************************/
/*                                                                          */
/* Function : sysLocalToBusAdrs( int      adrsSpace ,                       */
/*                               char *   localAdrs ,                       */
/*                               char **   pBusAdrs                         */
/*                                                                          */
/* Purpose. : Convert a local address to a bus address.                     */
/*                                                                          */
/* Returns. : ERROR                                                         */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/
 
STATUS sysLocalToBusAdrs
    (
       int  adrsSpace ,     /* bus address space where busAdrs resides  */
       char *   localAdrs , /* local address to convert                 */ 
       char **  pBusAdrs    /* where to return bus address              */ 
    )
{
    return( ERROR ) ;
}

/****************************************************************************/
/*                                                                          */
/* Function : sysBusToLocalAdrs( int      adrsSpaceo  ,                     */
/*                               char *   busAdrs     ,                     */
/*                               char **  pLocalAdrs                        */
/*                                                                          */
/* Purpose. : Convert a BUS address to a local address.                     */
/*                                                                          */
/* Returns. : ERROR                                                         */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

STATUS sysBusToLocalAdrs
    (
        int     adrsSpace,  /* bus address space where busAdrs resides  */
        char *  busAdrs,    /* bus address to convert                   */
        char ** pLocalAdrs  /* where to return local address            */
    )
{
    return( ERROR ) ;
}

/****************************************************************************/
/*                                                                          */
/* Function : sysBusTas( char * adrs )                                      */
/*                                                                          */
/* Purpose. : Perform an atomic test-and-set operation across the bus.      */
/*                                                                          */
/* Returns. : FALSE                                                         */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

BOOL sysBusTas
    (
       char *   adrs        /* address to be tested-and-set  */
    )
{
    return( FALSE ) ;
}

/****************************************************************************/
/*                                                                          */
/* Function : sysBusClearTas( char * address )                              */
/*                                                                          */
/* Purpose. : Performs an atomic clear-and-set operation across the bus.    */
/*                                                                          */
/* Returns. : None                                                          */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

void sysBusClearTas
    (
        volatile char * address        /* address to be tested-and-cleared */
    )
{
} 

/****************************************************************************/
/*                                                                          */
/* Function : sysCpmEnetDisable( int unit )                                 */
/*                                                                          */
/* Purpose. : Disables the Ethernet controller                              */
/*                                                                          */
/* Returns. : None                                                          */
/*                                                                          */
/* Notes... : None                                                          */
/*                                                                          */
/****************************************************************************/

void sysCpmEnetDisable
    (
       int         unit    /* not used - only slave SCC1 is wired to port   */
    )
{

    /*                                                                      */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -