API Reference: Libraries

Top

# sysLib

#### NAME

> sysLib - kontron_ktus system-dependent library

#### ROUTINES

> sysNvRamGet( ) - get the contents of non-volatile RAM
> sysNvRamSet( ) - write to non-volatile RAM
> sysLocalToBusAdrs( ) - convert a local address to a bus address
> sysBusToLocalAdrs( ) - convert a bus address to a local address
> sysBusIntAck( ) - acknowledge a bus interrupt
> sysBusIntGen( ) - generate a bus interrupt
> sysMailboxConnect( ) - connect a routine to the mailbox interrupt
> sysMailboxEnable( ) - enable the mailbox interrupt
> sysBusTas( ) - test and set a location across the bus
> i8259Init( ) - initialize the PIC
> i8259IntBoiEem( ) - issue EOI before the IRQ0 interrupt handler
> i8259IntBoiSmm( ) - enable Special Mask Mode before the IRQ0 interrupt handler
> i8259IntBoi( ) - detect whether it is spurious interrupt or not
> i8259IntEoiSmm( ) - disable Special Mask Mode with EOI signal to the master PIC
> i8259IntEoiMaster( ) - send EOI(end of interrupt) signal to the master PIC.
> i8259IntEoiSlave( ) - send EOI(end of interrupt) signal to the slave PIC.
> i8259IntEoiSlaveNfnm( ) - send EOI(end of interrupt) signal to the slave PIC.
> i8259IntEoiSlaveSfnm( ) - send EOI(end of interrupt) signal to the slave PIC.
> sysPciIvecToIrq( ) - get an IRQ(PIC or IOAPIC) number from vector address
> sysModel( ) - return the model name of the CPU board
> sysBspRev( ) - return the BSP version and revision number
> sysHwInit( ) - initialize the system hardware
> sysHwInit2( ) - additional system configuration and initialization
> sysPhysMemTop( ) - get the address of the top of physical memory
> sysMemTop( ) - get the address of the top of VxWorks memory
> sysToMonitor( ) - transfer control to the ROM monitor
> sysIntInitPIC( ) - initialize the interrupt controller
> sysIntLock( ) - lock out all interrupts
> sysIntUnlock( ) - unlock the PIC interrupts
> sysIntDisablePIC( ) - disable a bus interrupt level
> sysIntEnablePIC( ) - enable a bus interrupt level
> sysIntEoiGet( ) - get EOI/BOI function and its parameter
> sysIntLevel( ) - get an IRQ(PIC) or INTIN(APIC) number in service
> sysProcNumGet( ) - get the processor number
> sysProcNumSet( ) - set the processor number
> sysDelay( ) - allow recovery time for port accesses
> sysUsDelay( ) - delay specified number of microseconds
> sysStrayInt( ) - Do nothing for stray interrupts.
> sysMmuMapAdd( ) - insert a new MMU mapping

#### DESCRIPTION

> This library provides board-specific routines. The device configuration modules and device drivers included are:

> i8253Timer.c - Intel 8253 timer driver
> i8259Intr.c - Intel 8259 Programmable Interrupt Controller (PIC) library
> ioApicIntr.c - Intel IO APIC/xAPIC driver
> ioApicIntrShow.c - Intel IO APIC/xAPIC driver show routines
> iPiix4Pci.c - low level initalization code for PCI ISA/IDE Xcelerator
> loApicIntr.c - Intel Pentium[234] Local APIC/xAPIC driver
> loApicIntrShow.c - Intel Local APIC/xAPIC driver show routines
> loApicTimer.c - Intel Pentium2/3/4 Local APIC timer library
> sysNvRam.c - block device NVRAM library
> pccardLib.c - PC CARD enabler library
> pccardShow.c - PC CARD show library
> pciCfgStub.c - customizes pciConfigLib for the BSP
> pciCfgIntStub.c - customizes pciIntLib for the BSP
> pciConfigLib.c - PCI configuration space access support for PCI drivers
> pciIntLib.c - PCI shared interrupt support
> pciConfigShow.c - Show routines for PCI configuration library
> sysWindML.c - WindML BSP support routines

#### INCLUDE FILES

> sysLib.h

#### SEE ALSO

> VxWorks Programmer's Guide: Configuration

API Reference: Routines

Top

# sysNvRamGet( )

#### NAME

> sysNvRamGet( ) - get the contents of non-volatile RAM

#### SYNOPSIS

>     STATUS sysNvRamGet
>         (
>         char *string,   /* where to copy non-volatile RAM    */
>         int  strLen,    /* maximum number of bytes to copy   */
>         int  offset     /* byte offset into non-volatile RAM */
>         )

#### DESCRIPTION

> This routine copies the contents of non-volatile memory into a specified string. The string is terminated with an EOS.

#### RETURNS

> OK, or ERROR if access is outside the non-volatile RAM range.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, sysNvRamSet( )

API Reference: Routines

Top

# sysNvRamSet( )

#### NAME

> sysNvRamSet( ) - write to non-volatile RAM

#### SYNOPSIS

>     STATUS sysNvRamSet
>         (
>         char *string,   /* string to be copied into non-volatile RAM */
>         int  strLen,    /* maximum number of bytes to copy           */
>         int  offset     /* byte offset into non-volatile RAM         */
>         )

#### DESCRIPTION

> This routine copies a specified string into non-volatile RAM.

#### RETURNS

> OK, or ERROR if access is outside the non-volatile RAM range.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, sysNvRamGet( )

API Reference: Routines

Top

# sysLocalToBusAdrs( )

#### NAME

> sysLocalToBusAdrs( ) - convert a local address to a bus address

#### SYNOPSIS

>     STATUS sysLocalToBusAdrs
>         (
>         int  adrsSpace,    /* bus address space in which busAdrs resides,  */
>                            /* use address modifier codes defined in vme.h, */
>                            /* such as VME_AM_STD_SUP_DATA                  */
>         char *localAdrs,   /* local address to convert                     */
>         char **pBusAdrs    /* where to return bus address                  */
>         )

#### DESCRIPTION

> This routine gets the VMEbus address that accesses a specified local memory address.

#### NOTE

> This routine has no effect, since there is no VMEbus.

#### RETURNS

> ERROR, always.

#### ERRNO

#### SEE ALSO

> sysLib, sysBusToLocalAdrs( )

API Reference: Routines

Top

# sysBusToLocalAdrs( )

#### NAME

> sysBusToLocalAdrs( ) - convert a bus address to a local address

#### SYNOPSIS

>     STATUS sysBusToLocalAdrs
>         (
>         int  adrsSpace,     /* bus address space in which busAdrs resides,  */
>                             /* use address modifier codes defined in vme.h, */
>                             /* such as VME_AM_STD_SUP_DATA                  */
>         char *busAdrs,      /* bus address to convert                       */
>         char **pLocalAdrs   /* where to return local address                */
>         )

#### DESCRIPTION

> This routine gets the local address that accesses a specified VMEbus address.

#### NOTE

> This routine has no effect, since there is no VMEbus.

#### RETURNS

> ERROR, always.

#### ERRNO

#### SEE ALSO

> sysLib, sysLocalToBusAdrs( )

API Reference: Routines

Top

# sysBusIntAck( )

#### NAME

> sysBusIntAck( ) - acknowledge a bus interrupt

#### SYNOPSIS

>     int sysBusIntAck
>         (
>         int intLevel   /* interrupt level to acknowledge */
>         )

#### DESCRIPTION

> This routine acknowledges a specified VMEbus interrupt level.

#### NOTE

> This routine has no effect, since there is no VMEbus.

#### RETURNS

> NULL.

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysBusIntGen( )

#### NAME

> sysBusIntGen( ) - generate a bus interrupt

#### SYNOPSIS

>     STATUS sysBusIntGen
>         (
>         int level,   /* bus interrupt level to generate          */
>         int vector   /* interrupt vector to return (0-255)       */
>         )

#### DESCRIPTION

> This routine generates a VMEbus interrupt for a specified level with a specified vector.

#### NOTE

> This routine has no effect, since there is no VMEbus.

#### RETURNS

> ERROR, always.

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysMailboxConnect( )

#### NAME

> sysMailboxConnect( ) - connect a routine to the mailbox interrupt

#### SYNOPSIS

>     STATUS sysMailboxConnect
>         (
>         FUNCPTR routine,   /* routine called at each mailbox interrupt */
>         int     arg        /* argument with which to call routine      */
>         )

#### DESCRIPTION

> This routine specifies the interrupt service routine to be called at each mailbox interrupt.

#### NOTE

> This routine has no effect, since the hardware does not support mailbox interrupts.

#### RETURNS

> ERROR, always.

#### ERRNO

#### SEE ALSO

> sysLib, sysMailboxEnable( )

API Reference: Routines

Top

# sysMailboxEnable( )

#### NAME

> sysMailboxEnable( ) - enable the mailbox interrupt

#### SYNOPSIS

>     STATUS sysMailboxEnable
>         (
>         char *mailboxAdrs   /* mailbox address */
>         )

#### DESCRIPTION

> This routine enables the mailbox interrupt.

#### NOTE

> This routine has no effect, since the hardware does not support mailbox interrupts.

#### RETURNS

> ERROR, always.

#### ERRNO

#### SEE ALSO

> sysLib, sysMailboxConnect( )

API Reference: Routines

Top

# sysBusTas( )

#### NAME

> sysBusTas( ) - test and set a location across the bus

#### SYNOPSIS

>     BOOL sysBusTas
>         (
>         char *addr   /* address to be tested and set */
>         )

#### DESCRIPTION

> This routine performs a test-and-set (TAS) instruction across the backplane.

#### NOTE

> This routine is equivalent to vxTas( ), since there is no VMEbus.

#### RETURNS

> TRUE if the value had not been set but is now, or FALSE if the value was set already.

#### ERRNO

#### SEE ALSO

> sysLib, vxTas( )

API Reference: Routines

Top

# i8259Init( )

#### NAME

> i8259Init( ) - initialize the PIC

#### SYNOPSIS

>     VOID i8259Init (void)

#### DESCRIPTION

> This routine initializes the PIC.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntBoiEem( )

#### NAME

> i8259IntBoiEem( ) - issue EOI before the IRQ0 interrupt handler

#### SYNOPSIS

>     VOID i8259IntBoiEem
>         (
>         int irqNo   /* IRQ number of the interrupt */
>         )

#### DESCRIPTION

> This routine is called before the IRQ0 interrupt handler that is PIT(8253) channel 0 system clock interrupt handler in the Early EOI Mode.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntBoiSmm( )

#### NAME

> i8259IntBoiSmm( ) - enable Special Mask Mode before the IRQ0 interrupt handler

#### SYNOPSIS

>     VOID i8259IntBoiSmm
>         (
>         int irqNo   /* IRQ number of the interrupt */
>         )

#### DESCRIPTION

> This routine is called before the IRQ0 interrupt handler that is PIT(8253) channel 0 system clock interrupt handler, in the Special Mask Mode.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntBoi( )

#### NAME

> i8259IntBoi( ) - detect whether it is spurious interrupt or not

#### SYNOPSIS

>     VOID i8259IntBoi
>         (
>         INT32 irqNo   /* IRQ number of the interrupt */
>         )

#### DESCRIPTION

> This routine is called before the user's interrupt handler to detect the spurious interrupt.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntEoiSmm( )

#### NAME

> i8259IntEoiSmm( ) - disable Special Mask Mode with EOI signal to the master PIC

#### SYNOPSIS

>     VOID i8259IntEoiSmm
>         (
>         int irqNo   /* IRQ number to send EOI */
>         )

#### DESCRIPTION

> This routine is called at the end of the IRQ0 interrupt handler that is PIT(8253) channel 0 system clock interrupt handler in the Special Mask Mode.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntEoiMaster( )

#### NAME

> i8259IntEoiMaster( ) - send EOI(end of interrupt) signal to the master PIC.

#### SYNOPSIS

>     VOID i8259IntEoiMaster
>         (
>         INT32 irqNo   /* IRQ number to send EOI */
>         )

#### DESCRIPTION

> This routine is called at the end of the interrupt handler.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntEoiSlave( )

#### NAME

> i8259IntEoiSlave( ) - send EOI(end of interrupt) signal to the slave PIC.

#### SYNOPSIS

>     VOID i8259IntEoiSlave
>         (
>         INT32 irqNo   /* IRQ number to send EOI */
>         )

#### DESCRIPTION

> This routine is called at the end of the interrupt handler in the Normal Fully Nested Mode. This is kept for the backward compatibility.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntEoiSlaveNfnm( )

#### NAME

> i8259IntEoiSlaveNfnm( ) - send EOI(end of interrupt) signal to the slave PIC.

#### SYNOPSIS

>     VOID i8259IntEoiSlaveNfnm
>         (
>         INT32 irqNo   /* IRQ number to send EOI */
>         )

#### DESCRIPTION

> This routine is called at the end of the interrupt handler in the Normal Fully Nested Mode.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# i8259IntEoiSlaveSfnm( )

#### NAME

> i8259IntEoiSlaveSfnm( ) - send EOI(end of interrupt) signal to the slave PIC.

#### SYNOPSIS

>     VOID i8259IntEoiSlaveSfnm
>         (
>         int irqNo   /* IRQ number to send EOI */
>         )

#### DESCRIPTION

> This routine is called at the end of the interrupt handler in the Special Fully Nested Mode.

#### RETURNS

> N/A

#### ERRNO

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysPciIvecToIrq( )

#### NAME

> sysPciIvecToIrq( ) - get an IRQ(PIC or IOAPIC) number from vector address

#### SYNOPSIS

>     int sysPciIvecToIrq
>         (
>         int vector   /* vector address */
>         )

#### DESCRIPTION

> This routine gets an IRQ(PIC or IOAPIC) number from vector address. Assumptions are following:
> - IRQ number is 0 - 15 in PIC or VIRTUAL_WIRE mode
> - IRQ number is 0 - 23 in SYMMETRIC_IO mode

#### RETURNS

> IRQ 0 - 15/23, or -1 if we failed to get it.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysModel( )

#### NAME

> sysModel( ) - return the model name of the CPU board

#### SYNOPSIS

>     char *sysModel (void)

#### DESCRIPTION

> This routine returns the model name of the CPU board.

#### RETURNS

> A pointer to the string "PC 386, 486, PENTIUM or PENTIUM[234]".

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysBspRev( )

#### NAME

> sysBspRev( ) - return the BSP version and revision number

#### SYNOPSIS

>     char * sysBspRev (void)

#### DESCRIPTION

> This routine returns a pointer to a BSP version and revision number, for example, 1.1/0. BSP_REV is concatenated to BSP_VERSION and returned.

#### RETURNS

> A pointer to the BSP version/revision string.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysHwInit( )

#### NAME

> sysHwInit( ) - initialize the system hardware

#### SYNOPSIS

>     void sysHwInit (void)

#### DESCRIPTION

> This routine initializes various features of the i386/i486 board. It is called from usrInit( ) in usrConfig.c.

#### NOTE

> This routine should not be called directly by the user application.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysHwInit2( )

#### NAME

> sysHwInit2( ) - additional system configuration and initialization

#### SYNOPSIS

>     void sysHwInit2 (void)

#### DESCRIPTION

> This routine connects system interrupts and does any additional configuration necessary.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysPhysMemTop( )

#### NAME

> sysPhysMemTop( ) - get the address of the top of physical memory

#### SYNOPSIS

>     char * sysPhysMemTop (void)

#### DESCRIPTION

> This routine returns the address of the first missing byte of memory, which indicates the top of physical memory.

#### RETURNS

> The address of the top of physical memory.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysMemTop( )

#### NAME

> sysMemTop( ) - get the address of the top of VxWorks memory

#### SYNOPSIS

>     char * sysMemTop (void)

#### DESCRIPTION

> This routine returns a pointer to the first byte of memory not controlled or used by VxWorks.

> The user can reserve memory space by defining the macro USER_RESERVED_MEM in config.h. This routine returns the address of the reserved memory area. The value of USER_RESERVED_MEM is in bytes.

#### RETURNS

> The address of the top of VxWorks memory.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysToMonitor( )

#### NAME

> sysToMonitor( ) - transfer control to the ROM monitor

#### SYNOPSIS

>     STATUS sysToMonitor
>         (
>         int startType   /* passed to ROM to tell it how to boot */
>         )

#### DESCRIPTION

> This routine transfers control to the ROM monitor. It is usually called only by reboot( ) -- which services ^X -- and by bus errors at interrupt level. However, in some circumstances, the user may wish to introduce a new startType to enable special boot ROM facilities.

#### RETURNS

> Does not return.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysIntInitPIC( )

#### NAME

> sysIntInitPIC( ) - initialize the interrupt controller

#### SYNOPSIS

>     void sysIntInitPIC (void)

#### DESCRIPTION

> This routine initializes the interrupt controller. Maps APIC and HPET Memory space.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysIntLock( )

#### NAME

> sysIntLock( ) - lock out all interrupts

#### SYNOPSIS

>     VOID sysIntLock (void)

#### DESCRIPTION

> This routine saves the mask and locks out all interrupts.

#### RETURNS

> Not Available

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, sysIntUnlock( )

API Reference: Routines

Top

# sysIntUnlock( )

#### NAME

> sysIntUnlock( ) - unlock the PIC interrupts

#### SYNOPSIS

>     VOID sysIntUnlock (void)

#### DESCRIPTION

> This routine restores the mask and unlocks the PIC interrupts

#### RETURNS

> Not Available

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, sysIntLock( )

API Reference: Routines

Top

# sysIntDisablePIC( )

#### NAME

> sysIntDisablePIC( ) - disable a bus interrupt level

#### SYNOPSIS

>     STATUS sysIntDisablePIC
>         (
>         int irqNo   /* IRQ(PIC) or INTIN(APIC) number to disable */
>         )

#### DESCRIPTION

> This routine disables a specified bus interrupt level.

#### RETURNS

> OK, or ERROR if failed.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysIntEnablePIC( )

#### NAME

> sysIntEnablePIC( ) - enable a bus interrupt level

#### SYNOPSIS

>     STATUS sysIntEnablePIC
>         (
>         int irqNo   /* IRQ(PIC) or INTIN(APIC) number to enable */
>         )

#### DESCRIPTION

> This routine enables a specified bus interrupt level.

#### RETURNS

> OK, or ERROR if failed.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysIntEoiGet( )

#### NAME

> sysIntEoiGet( ) - get EOI/BOI function and its parameter

#### SYNOPSIS

>     void sysIntEoiGet
>         (
>         VOIDFUNCPTR * vector,         /* interrupt vector to attach to */
>         VOIDFUNCPTR * routineBoi,     /* BOI function */
>         int *         parameterBoi,   /* a parameter of the BOI function */
>         VOIDFUNCPTR * routineEoi,     /* EOI function */
>         int *         parameterEoi    /* a parameter of the EOI function */
>         )

#### DESCRIPTION

> This routine gets EOI function and its parameter for the interrupt controller. If returned EOI/BOI function is NULL, intHandlerCreateX86( ) replaces "call _routineBoi/Eoi" in intConnectCode[] with NOP instruction.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysIntLevel( )

#### NAME

> sysIntLevel( ) - get an IRQ(PIC) or INTIN(APIC) number in service

#### SYNOPSIS

>     int sysIntLevel
>         (
>         int arg   /* parameter to get the stack pointer */
>         )

#### DESCRIPTION

> This routine gets an IRQ(PIC) or INTIN(APIC) number in service. We assume the following:
> - this function is called in intEnt( )
> - IRQ number of the interrupt is at intConnectCode [29]

#### RETURNS

> 0 - (sysInumTblNumEnt - 1), or sysInumTblNumEnt if we failed to get it.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysProcNumGet( )

#### NAME

> sysProcNumGet( ) - get the processor number

#### SYNOPSIS

>     int sysProcNumGet (void)

#### DESCRIPTION

> This routine returns the processor number for the CPU board, which is set with sysProcNumSet( ).

#### RETURNS

> The processor number for the CPU board.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, sysProcNumSet( )

API Reference: Routines

Top

# sysProcNumSet( )

#### NAME

> sysProcNumSet( ) - set the processor number

#### SYNOPSIS

>     void sysProcNumSet
>         (
>         int procNum   /* processor number */
>         )

#### DESCRIPTION

> Set the processor number for the CPU board. Processor numbers should be unique on a single backplane.

#### NOTE

> By convention, only Processor 0 should dual-port its memory.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, sysProcNumGet( )

API Reference: Routines

Top

# sysDelay( )

#### NAME

> sysDelay( ) - allow recovery time for port accesses

#### SYNOPSIS

>     void sysDelay (void)

#### DESCRIPTION

> This routine provides a brief delay used between accesses to the same serial port chip.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysUsDelay( )

#### NAME

> sysUsDelay( ) - delay specified number of microseconds

#### SYNOPSIS

>     void sysUsDelay
>         (
>         int uSec
>         )

#### DESCRIPTION

> This routine provides a brief delay used between accesses to the same serial port chip.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysStrayInt( )

#### NAME

> sysStrayInt( ) - Do nothing for stray interrupts.

#### SYNOPSIS

>     void sysStrayInt (void)

#### DESCRIPTION

> Do nothing for stray interrupts.

#### RETURNS

> Not Available

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysMmuMapAdd( )

#### NAME

> sysMmuMapAdd( ) - insert a new MMU mapping

#### SYNOPSIS

>     STATUS sysMmuMapAdd
>         (
>         void * address,            /* memory region base address */
>         UINT   length,             /* memory region length in bytes*/
>         UINT   initialStateMask,   /* PHYS_MEM_DESC state mask */
>         UINT   initialState        /* PHYS_MEM_DESC state */
>         )

#### DESCRIPTION

> This routine will create a new sysPhysMemDesc table entry for a memory region of specified length in bytes and with a specified base address. The initialStateMask and initialState parameters specify a PHYS_MEM_DESC type state mask and state for the memory region.

#### CAVEATS

> This routine must be used before the sysPhysMemDesc table is referenced for the purpose of initializing the MMU or processor address space (us. in usrMmuInit( )).

> The length in bytes will be rounded up to a multiple of VM_PAGE_SIZE bytes if necessary.

> The current implementation assumes a one-to-one mapping of physical to virtual addresses.

#### RETURNS

> OK or ERROR depending on availability of free mappings.

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib, vmLib