Home |
RTTarget-32 Programming Manual PC Cards (PCMCIA) Function RTPCSetConfigRegister System Management BIOS (SMBIOS) Advanced Programmable Interrupt Controller (APIC) |
PC Cards (PCMCIA)RTTarget-32 supports one or two Intel 82365SL compatible PC card controllers with one to four PCMCIA card slots. RTTarget-32 has functions to detect card status changes (e.g., card removal or insertion), identify a card type, and to map its resources into the computer's address space. Currently, only 16-bit PC Cards are supported (no 32-bit Cardbus Cards). The PC Card functions return one of the following values: RTPC_SUCCESSThe respective function has completed successfully. RTPC_BAD_SOCKETThe given socket number is invalid. Parameter Socket is a zero-based index of the socket to be addressed. RTPC_NO_CARDThe card has been removed. RTPC_NO_MORE_ITEMSThe card's information space does not contain a function ID tuple. The card is probably defect. RTTarget-32 is not a plug-and-play operating system. RTTarget-32 has no built-in support for resource allocation and management. Applications must ensure that PC Cards are mapped in such a way that no resource conflicts occur. Applications to support PCMCIA PC Cards must perform the following steps:
RTTarget-32 demo programs PCCard and PCCardMT (for multithreaded applications) show how to do this. In multithreaded programs, it is strongly recommended to set up a separate thread to perform these steps. Single threaded programs must poll for and react to insertion/removal events periodically. The PCMCIA driver is not reentrant. Thus, the steps outlined above may be performed only by a single thread and they must not be performed by interrupt handlers. If the driver is not operated in polling mode, the PCMCIA driver's callback to signal insertion/removal events is called by an interrupt handler and thus cannot perform card configuration. Rather, the callback handler must record the event and inform a separate thread or the main program's event loop to process the event at a later time. The PCMCIA driver needs some address space to map a card's Configuration Information Space (CIS) into the computer's address space. If paging is enabled, such a region with a size of 4k can be allocated automatically by the driver. However, it is frequently desirable to assign a fixed address. This can be achieved by allocating a suitable region named PCMCIA in the RTLoc configuration file. Example:Region PCMCIA C8000h 4k Device ReadWrite Such a PCMCIA region must be located below 16M and must have at least 4k size. You can choose any address not used for any other purpose (in particular, it should be an address with no associated RAM, ROM, or other device). If the PCMCIA controller is a PCI cardbus controller, the RTTarget-32 PCMCIA driver also requires memory to map the controller's registers into the computer's address space. If paging is used, such a region with 4k size per PCMCIA slot can be allocated automatically. However, it is frequently desirable to assign a fixed address. This can be achieved by allocating a suitable region named CARDBUS in the RTLoc configuration file. Example:Region CARDBUS 3G 8k Device ReadWrite Such a CARDBUS region must have a size of at least 4k (8k for supporting two sockets). You can choose any address not used for any other purpose (in particular, it should be an address with no associated RAM, ROM, or other device). All data structures, constants, and functions made available by the PCMCIA driver are declared in header file Rtpcmcia.h. For Pascal, the driver's API is defined in unit Rtpcmcia.pas. More information about PC Cards and PCMCIA are available in the PC Card Standard available from the Personal Computer Memory Card International Association, 2635 North First Street, Suite 209, San Jose, CA 95134, USA, http://www.pc-card.com. Function RTPCSetConfigRegister
|