pcibios.h File Reference

PCI configuration space access via PCI BIOS. More...

#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


Detailed Description

PCI configuration space access via PCI BIOS.

Definition in file pcibios.h.


Define Documentation

#define PCIAPI_PREFIX_pcbios   __pcbios_

Definition at line 17 of file pcibios.h.

#define PCIBIOS_INSTALLATION_CHECK   0xb1010000

Definition at line 22 of file pcibios.h.

Referenced by pcibios_max_bus().

#define PCIBIOS_READ_CONFIG_BYTE   0xb1080000

Definition at line 23 of file pcibios.h.

#define PCIBIOS_READ_CONFIG_WORD   0xb1090000

Definition at line 24 of file pcibios.h.

#define PCIBIOS_READ_CONFIG_DWORD   0xb10a0000

Definition at line 25 of file pcibios.h.

#define PCIBIOS_WRITE_CONFIG_BYTE   0xb10b0000

Definition at line 26 of file pcibios.h.

#define PCIBIOS_WRITE_CONFIG_WORD   0xb10c0000

Definition at line 27 of file pcibios.h.

#define PCIBIOS_WRITE_CONFIG_DWORD   0xb10d0000

Definition at line 28 of file pcibios.h.


Function Documentation

FILE_LICENCE ( GPL2_OR_LATER   ) 

int pcibios_read ( struct pci_device pci,
uint32_t  command,
uint32_t value 
)

Read configuration space via PCI BIOS.

Parameters:
pci PCI device
command PCI BIOS command
value Value read
Return values:
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.

Parameters:
pci PCI device
command PCI BIOS command
value Value to be written
Return values:
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.

Parameters:
pci PCI device
where Location within PCI configuration space
value Value read
Return values:
rc Return status code


Variable Documentation

__always_inline int unsigned int where

Definition at line 45 of file pcibios.h.


Generated on Tue Apr 6 20:01:13 2010 for gPXE by  doxygen 1.5.7.1