openblt

a hobby OS from the late 90s
git clone http://frotz.net/git/openblt.git
Log | Files | Refs | LICENSE

pci.h (815B)


      1 /* $Id$
      2 **
      3 ** Copyright 1999 Brian J. Swetland. All rights reserved.
      4 ** Distributed under the terms of the OpenBLT License
      5 */
      6 
      7 #ifndef _PCI_H
      8 #define _PCI_H
      9 
     10 #include <blt/types.h>
     11 
     12 typedef struct 
     13 {
     14 	/* normal header stuff */
     15 	uint16 vendor_id;
     16 	uint16 device_id;
     17 	
     18 	uint16 command;
     19 	uint16 status;
     20 	
     21 	uint8 revision_id;
     22 	uint8 interface;
     23 	uint8 sub_class;
     24 	uint8 base_class;
     25 	
     26 	uint8 cache_line_size;
     27 	uint8 latency_timer;
     28 	uint8 header_type;
     29 	uint8 bist;	
     30 	
     31 	/* device info */
     32 	uint8 bus;
     33 	uint8 dev;
     34 	uint8 func;
     35 	uint8 _pad;
     36 
     37 	/* base registers */	
     38 	uint32 base[6];
     39 	uint32 size[6];
     40 	
     41 } pci_cfg;
     42 
     43 int pci_find(pci_cfg *cfg, uint16 vendor_id, uint16 device_id);
     44 
     45 uint32 pci_read(int bus, int dev, int func, int reg, int bytes);
     46 void pci_write(int bus, int dev, int func, int reg, uint32 v, int bytes);
     47 
     48 
     49 #endif