B.3   Interface Variations

This section describes particular routines that are specific to SPARC targets in one of the following ways:

For complete documentation on these routines, see the reference entries.


*

NOTE: Unless otherwise noted, the information in this section applies to both the SPARC and SPARClite. For SPARClite-specific information, see SPARClite Overview.

bALib

The following buffer-manipulation routines provided by bALib exploit the SPARC LDD and STD instructions.

bzeroDoubles( )
Zeroes out a buffer, 256 bytes at a time.

bfillDoubles( )
Fills a buffer with a specified eight-byte pattern.

bcopyDoubles( )
Copies one buffer to another, eight bytes at a time.

cacheMb930Lib

The library cacheMb930Lib contains routines that allow you to initialize, lock, and clear the Fujitsu MB86930 (SPARClite) cache. For more information, see the manual pages and Instruction and Data Cache Locking.

cacheMicroSparcLib

The library cacheMicroSparcLib contains routines that allow you to initialize, flush, and clear the MicroSparc I and II caches. For more information, see the manual pages.

dbgLib

If you are using the target shell, note the following architecture-specific information on routines in the dbgLib:

  • Optional Parameter for c( ) and s( )
  • The SPARC versions of c( ) (continue) and s( ) (single-step) can take a second address parameter, addr1. With this parameter, you can set nPC as well as the PC.

    Note that if addr is NULL, addr1 is ignored.

  • Restrictions on cret( )
  • In VxWorks for SPARC, cret( ) cannot determine the correct return address. Because the actual return address is determined by code within the routine, only the calling address is known. With C code in general, the calling instruction is a CALL and routines return with the following:

    ret 
    restore

    This is the assumption made by cret( ) when it places a breakpoint at the return address of the current subroutine and continues execution. Note that returns other than %i7 + 8 result in cret( ) setting an incorrect breakpoint value and continuing.

  • Restrictions on so( )
  • The so( ) routine single-steps a task stopped at a breakpoint, but steps over a subroutine. However, in the SPARC version, if the next instruction is a CALL or JMPL x, %o7, the routine breaks at the second instruction following the subroutine (that is, the first instruction following the delay slot's instruction). In general, the delay slot loads parameters for the subroutine. This loading can have unintended consequences if the delay slot is also a transfer of control.

  • Trace Routine, tt( )
  • save    %sp, -STACK_FRAME_SIZE, %sp 
    ... 
    ret 
    restore

    Although the tt( ) routine works correctly in general, note the following caveats:

    dbgArchLib

    If you are using the target shell, the following architecture-specific show routines are available if INCLUDE_DEBUG is defined:

    psrShow( )
    Displays the symbolic meaning of a specified PSR value on the standard output device.

    fsrShow( )
    Displays the symbolic meaning of a specified FSR value on the standard output device.

    fppArchLib

    The SPARC version of fppArchLib saves and restores a math coprocessor context appropriate to the SPARC floating-point architecture standard.

    intArchLib
    intLevelSet( )parameters
    The SPARC version of intLevelSet( ) takes an argument from 0 to 15.

    intLock( ) returns
    The SPARC version of intLock( ) returns an interrupt level.

    ioMmuMicroSparcLib

    The library ioMmuMicroSparcLib contains routines that allow you to initialize and map memory in the microSPARC I/O MMU. For more information, see the manual pages.

    mathALib

    Because the overall SPARC architecture includes hardware floating-point support, while the SPARClite variant does not, VxWorks includes mathALib hardware floating-point support for SPARC and software floating-point support for SPARClite.

  • SPARC
  • On SPARC targets, the following mathALib routines are available. Note that these are all double-precision routines; no single-precision routines are supported for SPARC:

    acos( )

    asin( )

    atan( )

    atan2( )

    cbrt( )

    ceil( )

    cos( )

    cosh( )

    exp( )

    fabs( )

    floor( )

    fmod( )

    irint( )

    iround( )

    log( )

    log10( )

    pow( )

    round( )

    sin( )

    sinh( )

    sqrt( )

    tan( )

    tanh( )

    trunc( )

  • SPARClite
  • On SPARClite targets, the following mathALib routines are supported (for information about how to use this support, see USS Floating-Point Emulation Library):

    • Double-precision routines:

      acos( )

      asin( )

      atan( )

      atan2( )

      ceil( )

      cos( )

      cosh( )

      exp( )

      fabs( )

      floor( )

      fmod( )

      frexp( )

      ldexp( )

      log( )

      log10( )

      pow( )

      sin( )

      sinh( )

      sqrt( )

      tan( )

      tanh( )

    • Single-precision routines:

      acosf( )

      asinf( )

      atanf( )

      atan2f( )

      ceilf( )

      cosf( )

      coshf( )

      expf( )

      fabsf( )

      floorf( )

      fmodf( )

      logf( )

      log10f( )

      modf( )

      powf( )

      sinf( )

      sinhf( )

      sqrtf( )

      tanf( )

      tanhf( )

    vxALib

    The test-and-set primitive vxTas( ) provides a C-callable interface to the SPARC ldstub instruction.

    vxLib

    The routine vxMemProbeAsi( ) probes addresses in SPARC ASI space.

    a.out-Specific Tools for SPARC and SPARClite

    The following tools are specific to the a.out format. For more information, see the reference entries for each tool.

    hex
    converts an a.out-format object file into Motorola hex records. The syntax is:

    hex [-a adrs] [-l] [-v] [-p PC] [-s SP] file 
    aoutToBin
    extracts text and data segments from an a.out file and writes it to standard output as a simple binary image. The syntax is:

    aoutToBin < inFile > outfile 
    xsym
    extracts the symbol table from an a.out file. The syntax is:

    xsym < objMod > symTbl