X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=src%2Fpci.h;h=a0b6b9c3e3c356ec5afefedda167550b73a31971;hb=89eb6241e51bc825cfbc1292802a960dcb48d778;hp=6623fd93675951209ccd45532739d24ed380a7ea;hpb=4132e0213ea9b168dd619ca76f1f1bf075d1f4a4;p=seabios.git diff --git a/src/pci.h b/src/pci.h index 6623fd9..a0b6b9c 100644 --- a/src/pci.h +++ b/src/pci.h @@ -15,6 +15,9 @@ static inline u8 pci_bdf_to_dev(u16 bdf) { static inline u8 pci_bdf_to_fn(u16 bdf) { return bdf & 0x07; } +static inline u16 pci_to_bdf(int bus, int dev, int fn) { + return (bus<<8) | (dev<<3) | fn; +} void pci_config_writel(u16 bdf, u32 addr, u32 val); void pci_config_writew(u16 bdf, u32 addr, u16 val); @@ -22,7 +25,9 @@ void pci_config_writeb(u16 bdf, u32 addr, u8 val); u32 pci_config_readl(u16 bdf, u32 addr); u16 pci_config_readw(u16 bdf, u32 addr); u8 pci_config_readb(u16 bdf, u32 addr); +void pci_config_maskw(u16 bdf, u32 addr, u16 off, u16 on); +int pci_find_vga(); int pci_find_device(u16 vendid, u16 devid); int pci_find_class(u16 classid); @@ -40,6 +45,8 @@ void create_pirtable(); * PIR table ****************************************************************/ +extern u16 PirOffset; + struct link_info { u8 link; u16 bitmap;