#include <stdint.h>
Go to the source code of this file.
Defines | |
| #define | PCIAPI_PREFIX_pcbios __pcbios_ |
| #define | PCIBIOS_INSTALLATION_CHECK 0xb1010000 |
| #define | PCIBIOS_READ_CONFIG_BYTE 0xb1080000 |
| #define | PCIBIOS_READ_CONFIG_WORD 0xb1090000 |
| #define | PCIBIOS_READ_CONFIG_DWORD 0xb10a0000 |
| #define | PCIBIOS_WRITE_CONFIG_BYTE 0xb10b0000 |
| #define | PCIBIOS_WRITE_CONFIG_WORD 0xb10c0000 |
| #define | PCIBIOS_WRITE_CONFIG_DWORD 0xb10d0000 |
Functions | |
| FILE_LICENCE (GPL2_OR_LATER) | |
| int | pcibios_read (struct pci_device *pci, uint32_t command, uint32_t *value) |
| Read configuration space via PCI BIOS. | |
| int | pcibios_write (struct pci_device *pci, uint32_t command, uint32_t value) |
| Write configuration space via PCI BIOS. | |
| static __always_inline int | PCIAPI_INLINE (pcbios, pci_read_config_byte)(struct pci_device *pci |
| Read byte from PCI configuration space via PCI BIOS. | |
Variables | |
| static __always_inline int unsigned int | where |
Definition in file pcibios.h.
| #define PCIBIOS_INSTALLATION_CHECK 0xb1010000 |
| FILE_LICENCE | ( | GPL2_OR_LATER | ) |
| int pcibios_read | ( | struct pci_device * | pci, | |
| uint32_t | command, | |||
| uint32_t * | value | |||
| ) |
Read configuration space via PCI BIOS.
| rc | Return status code |
Definition at line 62 of file pcibios.c.
References __asm__(), pci_device::bus, pci_device::devfn, PCI_BUSDEVFN, and REAL_CODE.
00062 { 00063 int discard_b, discard_D; 00064 int status; 00065 00066 __asm__ __volatile__ ( REAL_CODE ( "stc\n\t" 00067 "int $0x1a\n\t" 00068 "jnc 1f\n\t" 00069 "xorl %%eax, %%eax\n\t" 00070 "decl %%eax\n\t" 00071 "movl %%eax, %%ecx\n\t" 00072 "\n1:\n\t" ) 00073 : "=a" ( status ), "=b" ( discard_b ), 00074 "=c" ( *value ), "=D" ( discard_D ) 00075 : "a" ( command >> 16 ), "D" ( command ), 00076 "b" ( PCI_BUSDEVFN ( pci->bus, pci->devfn ) ) 00077 : "edx" ); 00078 00079 return ( ( status >> 8 ) & 0xff ); 00080 }
| int pcibios_write | ( | struct pci_device * | pci, | |
| uint32_t | command, | |||
| uint32_t | value | |||
| ) |
Write configuration space via PCI BIOS.
| rc | Return status code |
Definition at line 90 of file pcibios.c.
References __asm__(), pci_device::bus, pci_device::devfn, PCI_BUSDEVFN, and REAL_CODE.
00090 { 00091 int discard_b, discard_c, discard_D; 00092 int status; 00093 00094 __asm__ __volatile__ ( REAL_CODE ( "stc\n\t" 00095 "int $0x1a\n\t" 00096 "jnc 1f\n\t" 00097 "movb $0xff, %%ah\n\t" 00098 "\n1:\n\t" ) 00099 : "=a" ( status ), "=b" ( discard_b ), 00100 "=c" ( discard_c ), "=D" ( discard_D ) 00101 : "a" ( command >> 16 ), "D" ( command ), 00102 "b" ( PCI_BUSDEVFN ( pci->bus, pci->devfn ) ), 00103 "c" ( value ) 00104 : "edx" ); 00105 00106 return ( ( status >> 8 ) & 0xff ); 00107 }
| static __always_inline int PCIAPI_INLINE | ( | pcbios | , | |
| pci_read_config_byte | ||||
| ) | [inline, static] |
Read byte from PCI configuration space via PCI BIOS.
| pci | PCI device | |
| where | Location within PCI configuration space | |
| value | Value read |
| rc | Return status code |
1.5.7.1