API Reference: Libraries

Top

# sysLib

#### NAME

> sysLib - Kontron KTGM45 platform 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
> sysPciIvecToIrq( ) - get an IRQ(PIC or IOAPIC) number from vector address
> sysPciPirqEnable( ) - enable or disbable PCI PIRQ direct handling
> sysPciPirqShow( ) - show the PCI PIRQ[A-H] to IRQ[0-15] routing status
> 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
> apicIntrIntHelper( ) - initialize pointers to vxBus driver routines.
> 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
> sysLoApicTimerFreqUpdate( ) - update Local APIC clock frequency
> sysBootWait( ) - wait until necessary tasks starts
> sysBootLineInit( ) - initialize boot line for Profile BootApp VIP

#### 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
> nullNvRam.c - null NVRAM library
> nullVme.c - null VMEbus 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
> sysDec21x40End.c - system configuration module for dec21x40End driver
> sysEl3c509End.c - system configuration module for elt3c509End driver
> sysEl3c90xEnd.c - system configuration module for el3c90xEnd driver
> sysFei82557End.c - system configuration module for fei82557End driver
> sysGei82543End.c - system configuration module for gei82543End driver
> sysLn97xEnd.c - system configuration module for ln97xEnd driver
> sysNe2000End.c - system configuration module for ne2000End driver
> sysUltraEnd.c - system configuration module for SMC Elite ultraEnd driver
> 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.

#### NOTE

> This routine has no effect, since there is no non-volatile RAM.

#### RETURNS

> ERROR, always.

#### 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.

#### NOTE

> This routine has no effect, since there is no non-volatile RAM.

#### RETURNS

> ERROR, always.

#### 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

# 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

# sysPciPirqEnable( )

#### NAME

> sysPciPirqEnable( ) - enable or disbable PCI PIRQ direct handling

#### SYNOPSIS

>     VOID sysPciPirqEnable
>         (
>         BOOL enable   /* TRUE to enable, FALSE to disable */
>         )

#### DESCRIPTION

> This routine enables or disbales the PCI PIRQ direct handling.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysPciPirqShow( )

#### NAME

> sysPciPirqShow( ) - show the PCI PIRQ[A-H] to IRQ[0-15] routing status

#### SYNOPSIS

>     void sysPciPirqShow (void)

#### DESCRIPTION

> This routine shows the PCI PIRQ[A-H] to IRQ[0-15] routing status

#### RETURNS

> N/A

#### 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

# apicIntrIntHelper( )

#### NAME

> apicIntrIntHelper( ) - initialize pointers to vxBus driver routines.

#### SYNOPSIS

>     STATUS apicIntrIntHelper
>         (
>         VXB_DEVICE_ID pDev,
>         void *        unused
>         )

#### DESCRIPTION

> This routine initializes pointers to vxBus driver routines up front, rather than calling into vxBus API...

> Called from "sysPciPirqEnable" because we require intEnable/Disable early on during PCI initialization...

#### RETURNS

> STATUS

#### 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

API Reference: Routines

Top

# sysLoApicTimerFreqUpdate( )

#### NAME

> sysLoApicTimerFreqUpdate( ) - update Local APIC clock frequency

#### DESCRIPTION

> This routine updates local APIC clock frequency based on value read from a north bridge.

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysBootWait( )

#### NAME

> sysBootWait( ) - wait until necessary tasks starts

#### SYNOPSIS

>     void sysBootWait (void)

#### DESCRIPTION

> This routine wait until necessary tasks required in bootrom starts before boot procedure starts

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib

API Reference: Routines

Top

# sysBootLineInit( )

#### NAME

> sysBootLineInit( ) - initialize boot line for Profile BootApp VIP

#### SYNOPSIS

>     void sysBootLineInit
>         (
>         void
>         )

#### DESCRIPTION

> none

#### RETURNS

> N/A

#### ERRNO

> Not Available

#### SEE ALSO

> sysLib