• fast_read_config_byte | Read configuration byte fast |
• fast_read_config_longword | Read configuration longword fast |
• fast_read_config_word | Read configuration word fast |
• find_pci_classcode | Find PCI class code |
• find_pci_device | Find PCI device |
• get_machine_id | Get machine ID |
• get_resource | Get resource Data |
• get_routing | Get interrupt routing options |
• hook_interrupt | Hook interrupt vector |
• read_config_byte | Read configuration byte |
• read_config_longword | Read configuration longword |
• read_config_word | Read configuration word |
• set_interrupt | Set hardware interrupt |
• special_cycle | Generates special cycle |
• unhook_interrupt | Unhook interrupt vector |
• write_config_byte | Write configuration byte |
• write_config_longword | Write configuration longword |
• write_config_word | Write configuration word |
Querverweis: PCI-BIOS Fehlercodes Cookie _PCI Cookie XPCI
Name: | »Read configuration byte fast«
| ||||
Xbiosnummer: | 305
| ||||
Deklaration: | int8_t fast_read_config_byte (int32_t handle, uint8_t reg);
| ||||
Beschreibung: | Diese Funktion erlaubt das Lesen von Registern im
Konfigurationsbereich ohne aufwendige Fehler- und
Plausibilitätschecks und ist daher auch etwas schneller als ihre
Schwester (daher besonders geeignet für Interrupt-Routinen und wenn
man ganz genau weiß, was man tut ;-).
| ||||
Ergebnis: | PCI-BIOS Fehlercode
| ||||
Verfügbar: | PCI-BIOS V2.00
| ||||
Gruppe: | PCI-BIOS
| ||||
Querverweis: | Binding read_config_byte read_config_word
fast_read_config_word read_config_longword
fast_read_config_longword
|
C: | #include <tos.h>
int8_t fast_read_config_byte (int32_t handle, uint8_t reg); |
Assembler: |
move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #305,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #8,sp ; Stack korrigieren |
Name: | »Read configuration longword fast«
| ||||
Xbiosnummer: | 307
| ||||
Deklaration: | int32_t fast_read_config_longword (int32_t handle, uint8_t
reg);
| ||||
Beschreibung: | Diese Funktion erlaubt das Lesen von Registern im
Konfigurationsbereich ohne aufwendige Fehler- und
Plausibilitätschecks und ist daher auch etwas schneller als ihre
Schwester (daher besonders geeignet für Interrupt-Routinen und wenn
man ganz genau weiß, was man tut ;-).
| ||||
Ergebnis: | PCI-BIOS Fehlercode
| ||||
Verfügbar: | PCI-BIOS V2.00
| ||||
Gruppe: | PCI-BIOS
| ||||
Querverweis: | Binding read_config_byte fast_read_config_byte
read_config_word fast_read_config_word read_config_longword
|
C: | #include <tos.h>
int32_t fast_read_config_longword (int32_t handle, uint8_t reg); |
Assembler: |
move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #307,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #8,sp ; Stack korrigieren |
Name: | »Read configuration word fast«
| ||||
Xbiosnummer: | 306
| ||||
Deklaration: | int16_t fast_read_config_word (int32_t handle, uint8_t reg);
| ||||
Beschreibung: | Diese Funktion erlaubt das Lesen von Registern im
Konfigurationsbereich ohne aufwendige Fehler- und
Plausibilitätschecks und ist daher auch etwas schneller als ihre
Schwester (daher besonders geeignet für Interrupt-Routinen und wenn
man ganz genau weiß, was man tut ;-).
| ||||
Ergebnis: | PCI-BIOS Fehlercode
| ||||
Verfügbar: | PCI-BIOS V2.00
| ||||
Gruppe: | PCI-BIOS
| ||||
Querverweis: | Binding read_config_byte fast_read_config_byte
read_config_word read_config_longword fast_read_config_longword
|
C: | #include <tos.h>
int16_t fast_read_config_word (int32_t handle, uint8_t reg); |
Assembler: |
move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #306,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #8,sp ; Stack korrigieren |
Name: | »find_pci_classcode« - Liefert ein Devicehandle für ein
Gerät einer bestimmten Geräteklasse.
| ||||||
Xbiosnummer: | 301
| ||||||
Deklaration: | int32_t find_pci_classcode( int32_t classcode, int16_t index );
| ||||||
Beschreibung: | Die Funktion liefert ein Devicehandle für ein Gerät, das dem
angegebenen Gerät entspricht.
Der Treiber kann diese Funktion mehrmals für eine Geräte ID aufrufen und den index = 0,1,2,... für jeden Aufruf hochzählen, bis die Funktion PCI_DEVICE_NOT_FOUND liefert.
| ||||||
Ergebnis: | Devicehandle für das Gerät oder PCI_DEVICE_NOT_FOUND.
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding find_pci_device
|
C: | #include <tos.h>
int32_t find_pci_classcode( int32_t classcode, int16_t index ); |
Assembler: |
move.w index,-(sp) ; Offset 6 move.l classcode,-(sp) ; Offset 2 move.w #301,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #8,sp ; Stack korrigieren |
Name: | »find_pci_device« - Liefert ein Devicehandle für ein Gerät,
das dem angegebenen Gerät und der Hersteller ID entspricht.
| ||||||
Xbiosnummer: | 300
| ||||||
Deklaration: | int32_t find_pci_device( int32_t id, int16_t index);
| ||||||
Beschreibung: | Die Funktion liefert ein Devicehandle für ein Gerät, das dem
angegebenen Gerät und der Hersteller ID entspricht. Der Treiber kann
diese Funktion mehrmals für eine Geräte und Hersteller ID aufrufen
und den index = 0,1,2,... für jeden Aufruf hochzählen, bis die
Funktion PCI_DEVICE_NOT_FOUND liefert.
Als Spezialfall kann die Hersteller ID $FFFF benutzt weren, um alle Geräte abzufragen. Die Geräte ID wird in diesem Fall ignoriert.
| ||||||
Ergebnis: | Devicehandle für das Gerät oder PCI_DEVICE_NOT_FOUND.
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding find_pci_classcode
|
C: | #include <tos.h>
int32_t find_pci_device( int32_t id, int16_t index); |
Assembler: |
move.w index,-(sp) ; Offset 6 move.l id,-(sp) ; Offset 2 move.w #300,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #8,sp ; Stack korrigieren |
Name: | »Get Machine ID«
| ||||||||
Xbiosnummer: | 337
| ||||||||
Deklaration: | int32_t get_machine_id ( void );
| ||||||||
Beschreibung: | This function can be used to get a unique machine ID for the
computer the driver is running on.
| ||||||||
Ergebnis: | Machine ID oder 0 (keine ID verfügbar) oder PCI-BIOS
Fehlercodes
Positive, non-zero values are machine IDs. They contain a manufacturer code in bit 24..31 and a unique serial number which is set by the manufacturer during production in bit 0..23. The following manufacturer codes are defined:
| ||||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||||
Gruppe: | PCI-BIOS
| ||||||||
Querverweis: | Binding
|
C: | #include <tos.h>
int32_t get_machine_id ( void ); |
Assembler: |
move.w #337,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #2,sp ; Stack korrigieren |
Name: | »Get Resource Data«
| ||
Xbiosnummer: | 316
| ||
Deklaration: | int32_t get_resource ( int32_t handle );
| ||
Beschreibung: | Liefert sämtliche Infos zu den Resourcen einer PCI-Karte (bzw.
eines PCI-Gerätes im Fall von Multifunktionskarten). Die
zurückgelieferten Infos dürfen von den Geräte-Treibern keinesfalls
verändert werden. Der Geräte-Treiber kann an Hand der angebotenen
Informationen (Byte ordering usw.) die Karte dann direkt ansprechen.
Eine weitere Möglichkeit ist die Verwendung der BIOS-Routinen
read_mem_..., write_mem_..., read_io_... und write_io_..., wobei man
sich dann um keinerlei Nebenbedingungen selbst kümmern muß.
Die Routine liefert einen Zeiger auf den ersten Resource Deskriptor des gewünschten PCI-Gerätes. Der Geräte-Treiber kann dann die weiteren Deskriptoren über einen Offset (Länge eines Deskriptors) erreichen. Der letzte Deskriptor des Geräts ist wiederrum speziell markiert. Die Reihenfolge der Despriptoren entspricht derer der Basisadreßregister im PCI-Konfigurationsbereich. Ein PCI-Gerät kann auch mehrere Resourcen des gleichen Typs anfordern/verwenden.
| ||
Ergebnis: | positiv - Zeiger auf Resourcen-Informationen (erster
Deskriptor)
negativ - PCI-BIOS Fehlercodes | ||
Verfügbar: | PCI-BIOS V2.00
| ||
Gruppe: | PCI-BIOS
| ||
Querverweis: | Binding
|
C: | #include <tos.h>
int32_t get_resource ( int32_t handle ); |
Assembler: |
move.l handle,-(sp) ; Offset 2 move.w #316,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #6,sp ; Stack korrigieren |
Name: | »Get Interrupt Routing Options«
|
Xbiosnummer: | 314
|
Deklaration: | int32_t get_routing ( int32_t handle );
|
Beschreibung: | To be defined. Not for use by device drivers.
|
Ergebnis: | PCI-BIOS Fehlercodes
|
Verfügbar: | PCI-BIOS V2.00
|
Gruppe: | PCI-BIOS
|
Querverweis: | Binding
|
C: | #include <tos.h>
int32_t get_routing ( int32_t handle ); |
Assembler: |
move.l handle,-(sp) ; Offset 2 move.w #314,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #6,sp ; Stack korrigieren |
Name: | »Hook Interrupt Vector«
| ||||||
Xbiosnummer: | 311
| ||||||
Deklaration: | int32_t hook_interrupt (int32_t handle, uint32_t *routine,
uint32_t *parameter);
| ||||||
Beschreibung: | This function hooks the driver into the interrupt chain to
which a specific interrupt on the given card is routed. The interrupt
is enabled on the system level, however, it is the drivers
responsibility to enable the interrupt on the card as needed.
The driver should first hook into the interrupt chain, and then enable the interrupt on the card, in order not to cause spurious interrupts.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding unhook_interrupt
|
C: | #include <tos.h>
int32_t hook_interrupt (int32_t handle, uint32_t *routine, uint32_t *parameter); |
Assembler: |
move.l parameter,-(sp) ; Offset 10 move.l routine,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #311,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 14(sp),sp ; Stack korrigieren |
Name: | »Read configuration byte«
| ||||||
Xbiosnummer: | 302
| ||||||
Deklaration: | int32_t read_config_byte (int32_t handle, uint8_t reg, uint8_t
*address);
| ||||||
Beschreibung: | Dies Funktion erlaubt den Lesezugriffe auf die
Konfigurationsregister eines PCI-Gerätes, dessen Geräte-Handle zuvor
mittels find_pci_device oder find_pci_classcode ermittelt wurde.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding fast_read_config_byte read_config_word
fast_read_config_word read_config_longword
fast_read_config_longword
|
C: | #include <tos.h>
int32_t read_config_byte (int32_t handle, uint8_t reg, uint8_t *address); |
Assembler: |
pea address ; Offset 8 move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #302,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 12(sp),sp ; Stack korrigieren |
Name: | »Read configuration longword«
| ||||||
Xbiosnummer: | 304
| ||||||
Deklaration: | int32_t read_config_longword (int32_t handle, uint8_t reg,
uint32_t *address);
| ||||||
Beschreibung: | Dies Funktion erlaubt den Lesezugriffe auf die
Konfigurationsregister eines PCI-Gerätes, dessen Geräte-Handle zuvor
mittels find_pci_device oder find_pci_classcode ermittelt wurde.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding read_config_byte fast_read_config_byte
read_config_word fast_read_config_word fast_read_config_longword
|
C: | #include <tos.h>
int32_t read_config_longword (int32_t handle, uint8_t reg, uint32_t *address); |
Assembler: |
pea address ; Offset 8 move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #304,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 12(sp),sp ; Stack korrigieren |
Name: | »Read configuration word«
| ||||||
Xbiosnummer: | 303
| ||||||
Deklaration: | int32_t read_config_word (int32_t handle, uint8_t reg, uint16_t
*address);
| ||||||
Beschreibung: | Dies Funktion erlaubt den Lesezugriffe auf die
Konfigurationsregister eines PCI-Gerätes, dessen Geräte-Handle zuvor
mittels find_pci_device oder find_pci_classcode ermittelt wurde.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding read_config_byte fast_read_config_byte
fast_read_config_word read_config_longword
fast_read_config_longword
|
C: | #include <tos.h>
int32_t read_config_word (int32_t handle, uint8_t reg, uint16_t *address); |
Assembler: |
pea address ; Offset 8 move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #303,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 12(sp),sp ; Stack korrigieren |
Name: | »Set Hardware Interrupt«
|
Xbiosnummer: | 315
|
Deklaration: | int32_t set_interrupt ( int32_t handle );
|
Beschreibung: | To be defined. Not for use by device drivers.
|
Ergebnis: | PCI-BIOS Fehlercodes
|
Verfügbar: | PCI-BIOS V2.00
|
Gruppe: | PCI-BIOS
|
Querverweis: | Binding
|
C: | #include <tos.h>
int32_t set_interrupt ( int32_t handle ); |
Assembler: |
move.l handle,-(sp) ; Offset 2 move.w #315,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #6,sp ; Stack korrigieren |
Name: | »Generates special cycle«
| ||||
Xbiosnummer: | 313
| ||||
Deklaration: | int32_t special_cycle ( unit8_t bus, uint32_t data );
| ||||
Beschreibung: | This function generates a special cycle on the PCI bus.
| ||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||
Verfügbar: | PCI-BIOS V2.00
| ||||
Gruppe: | PCI-BIOS
| ||||
Querverweis: | Binding
|
C: | #include <tos.h>
int32_t special_cycle ( unit8_t bus, uint32_t data ); |
Assembler: |
move.l data,-(sp) ; Offset 4 move.w bus,-(sp) ; Offset 2 move.w #313,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #8,sp ; Stack korrigieren |
Name: | » «
| ||
Xbiosnummer: | 312
| ||
Deklaration: | int32_t unhook_interrupt (int32_t handle);
| ||
Beschreibung: | Mit dieser Routine kann man einen mittels hook_interrupt
angemeldeten Interrupt-Handler wieder entfernen. Der Treiber muß
allerdings beachten, daß die Interrupts auf dem PCI-Gerät schon vor
dem Aufruf dieser BIOS-Funktion deaktiviert werden müssen, da es
sonst zu spurious interrupts kommen kann.
| ||
Ergebnis: | PCI-BIOS Fehlercodes
| ||
Verfügbar: | PCI-BIOS V2.00
| ||
Gruppe: | PCI-BIOS
| ||
Querverweis: | Binding hook_interrupt
|
C: | #include <tos.h>
int32_t unhook_interrupt (int32_t handle); |
Assembler: |
move.l handle,-(sp) ; Offset 2 move.w #305,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen addq.l #6,sp ; Stack korrigieren |
Name: | <Write Configuration Byte>
| ||||||
Xbiosnummer: | 308
| ||||||
Deklaration: | int32_t write_config_byte (int32_t handle, uint8_t reg, uint8_t
val);
| ||||||
Beschreibung: | Dies Routine dient zum Schreiben von Konfigurationsregistern
eines PCI-Gerätes.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding write_config_word write_config_longword
read_config_byte read_config_word read_config_longword
|
C: | #include <tos.h>
int32_t write_config_byte (int32_t handle, uint8_t reg, uint8_t val); |
Assembler: |
move.w val,-(sp) ; Offset 7 move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #308,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 10(sp),sp ; Stack korrigieren |
Name: | »Write configuration longword«
| ||||||
Xbiosnummer: | 310
| ||||||
Deklaration: | int32_t write_config_longword (int32_t handle, uint8_t reg,
uint32_t val);
| ||||||
Beschreibung: | Dies Routine dient zum Schreiben von Konfigurationsregistern
eines PCI-Gerätes.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding write_config_byte write_config_word
read_config_byte read_config_word read_config_longword
|
C: | #include <tos.h>
int32_t write_config_longword (int32_t handle, uint8_t reg, uint32_t val); |
Assembler: |
move.l val,-(sp) ; Offset 8 move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #310,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 12(sp),sp ; Stack korrigieren |
Name: | »Write configuration word«
| ||||||
Xbiosnummer: | 309
| ||||||
Deklaration: | int32_t write_config_word (int32_t handle, uint8_t reg,
uint16_t val);
| ||||||
Beschreibung: | Dies Routine dient zum Schreiben von Konfigurationsregistern
eines PCI-Gerätes.
| ||||||
Ergebnis: | PCI-BIOS Fehlercodes
| ||||||
Verfügbar: | PCI-BIOS V2.00
| ||||||
Gruppe: | PCI-BIOS
| ||||||
Querverweis: | Binding write_config_byte write_config_longword
read_config_byte read_config_word read_config_longword
|
C: | #include <tos.h>
int32_t write_config_word (int32_t handle, uint8_t reg, uint16_t val); |
Assembler: |
move.w val,-(sp) ; Offset 8 move.w reg,-(sp) ; Offset 6 move.l handle,-(sp) ; Offset 2 move.w #309,-(sp) ; Offset 0 trap #14 ; XBIOS aufrufen lea 10(sp),sp ; Correct stack |
Die folgende Fehlercodes können im Fehlerfall von den BIOS-Routinen zurückgeliefert werden.
0x00000000 | PCI_SUCCESSFUL |
0xFFFFFFFE | PCI_FUNC_NOT_SUPPORTED |
0xFFFFFFFD | PCI_BAD_VENDOR_ID |
0xFFFFFFFC | PCI_DEVICE_NOT_FOUND |
0xFFFFFFFB | PCI_BAD_REGISTER_NUMBER |
0xFFFFFFFA | PCI_SET_FAILED |
0xFFFFFFF9 | PCI_BUFFER_TOO_SMALL |
0xFFFFFFF8 | PCI_GENERAL_ERROR |
0xFFFFFFF7 | PCI_BAD_HANDLE |
Die folgenden beiden Fehlercodes werden zwar nicht von den BIOS-Routinen selbst verwendet, sind aber für eine PCI-Library reserviert.
0xFFFFF001 | PCI_BIOS_NOT_INSTALLED |
0xFFFFF000 | PCI_BIOS_WRONG_VERSION |