F.3   Interface Changes

This section describes particular routines and tools that are specific to PowerPC targets in any of the following ways:

For complete documentation, see the online documentation.

Memory Management Unit

VxWorks provides two levels of virtual memory support: the basic level bundled with VxWorks, and the full level that requires the optional product VxVMI.Check with your sales representative for the availability of VxVMI for PowerPC.

For detailed information on VxWorks MMU support, see 7. Virtual Memory Interface. The following subsections augment the information in that chapter.

Instruction and Data MMU

The PowerPC MMU introduces a distinction between instruction and data MMU and allows them to be separately enabled or disabled. Two parameters, USER_I_MMU_ENABLE and USER_D_MMU_ENABLE, are enabled by default in the Params tab of the Properties window under SELECT_MMU. To enable/disable one or both MMUs, select the corresponding parameter and remove the TRUE.

60X Memory Mapping

The PowerPC 603 and 604 MMU supports two models for memory mapping. The first, the BAT model, allows mapping of a memory block ranging in size from 128KB to 256MB into a BAT register. The second, the segment model, gives the ability to map the memory in pages of 4KB. Tornado for PowerPC supports both memory models.

  • 603/604 Block Address Translation Model
  • The size of a BAT register is two words of 32 bits. For the PowerPC 603 and PowerPC 604, eight BAT registers are implemented: four for the instruction MMU and four for the data MMU.

    The data structure sysBatDesc[], defined in sysLib.c, handles the BAT register configuration. The registers will be set by the initialization software in the MMU library. By default these registers are cleared and set to zero.

    All the configuration constants used to fill the sysBatDesc[] are defined in installDir/target/h/arch/ppc/mmu603Lib.h for both the PowerPC 603 and the PowerPC 604.

  • 603/604 Segment Model
  • This model specifies the configuration for each memory page. The entire physical memory is described by the data structure sysPhysMemDesc[], defined in sysLib.c. This data structure is made up of configuration constants for each page or group of pages. All the configuration constants defined in Table 7-1 of 7. Virtual Memory Interface are available for PowerPC virtual memory pages.

    Use of the VM_STATE_CACHEABLE constant listed in Table 7-1 for each page or group of pages, sets the cache to copy-back mode.

    In addition to VM_STATE_CACHEABLE, the following additional constants are supported:

    • VM_STATE_CACHEABLE_WRITETHROUGH
    • VM_STATE_MEM_COHERENCY
    • VM_STATE_MEM_COHERENCY_NOT
    • VM_STATE_GUARDED
    • VM_STATE_GUARDED_NOT

    The first constant sets the page descriptor cache mode field in cacheable write-through mode. Cache coherency and guarded modes are controlled by the other constants.

    For more information regarding cache modes, refer to PowerPC Microprocessor Family: The Programming Environments.

    For more information on memory page states, state flags, and state masks, see 7. Virtual Memory Interface.

    The page table size depends on the total memory to be mapped. The larger the memory to be mapped, the bigger the page table will be. The VxWorks implementation of the segment model follows the recommendations given in PowerPC Microprocessor Family: The Programming Environments. During MMU library initialization, the total size of the memory to be mapped is computed, allowing dynamic determination of the page table size. The following table shows the correspondence between the total amount of memory to map and the page table size.

    Table 9-4:  Page table size  


    Total Memory to map
    Page table size

    8 MB or less 
    64 KB 
    16 MB 
    128 KB 
    32 MB 
    256 KB 
    64 MB 
    512 KB 
    128 MB 
    1 MB 
    256 MB 
    2 MB 
    512 MB 
    4 MB 
    1 GB 
    8 MB 
    2 GB 
    16 MB 
    4 GB 
    32 MB 

    HI and HIADJ Macros

    The HI and HIADJ macros are used in PowerPC assembly code. The macro HI(x) is the simple high order 16 bits of the value x. The macro HIADJ(x) is the high order 16 bits adjusted by bit 15. If bit 15 is set, then the value is adjusted by adding 1.

    The macro HIADJ(x) must be used whenever the low order 16 bits are to be used with an instruction that interprets them as a signed quantity (for instance, addi, lwz). If the low order bits are used in an instruction that interprets them as an unsigned quantity (for instance, ori) then the proper macro is HI, not HIADJ.

    For example, addi uses a SIGNED quantity, so HIADJ is the proper macro:

    lis   rx, HIADJ(VALUE) 
    addi  rx, rx, LO(VALUE)

    However, ori uses an UNSIGNED quantity, so HI is the proper macro:

    lis   rx, HI(VALUE) 
    ori   rx, rx, LO(VALUE)

    ELF-Specific Tools

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

    elfHex
    converts an ELF-format object file into Motorola hex records. The syntax is:

    elfHex [-a adrs] [-l] [-v] [-p PC] [-s SP] file 
    elfToBin
    extracts text and data segments from an ELF file. The syntax is:

    elfToBin < inFile > outfile 
    elfXsyms
    extracts the symbol table from an ELF file. The syntax is:

    elfXsyms < objMod > symTbl