source: rtems/c/src/lib/libbsp/i386/shared/pci/pcibios.h @ 0ffa407

4.104.114.84.95
Last change on this file since 0ffa407 was 0ffa407, checked in by Joel Sherrill <joel.sherrill@…>, on 07/18/03 at 15:52:41

2003-07-16 Greg Menke <gregory.menke@…>

PR 428/bsps
PR 432/bsps

  • pci/pcibios.c, pci/pcibios.h: Added BSP_pci_Find_Device() which is copied from motorola_shared.
  • Property mode set to 100644
File size: 1.8 KB
Line 
1/*
2 * This software is Copyright (C) 1998 by T.sqware - all rights limited
3 * It is provided in to the public domain "as is", can be freely modified
4 * as far as this copyight notice is kept unchanged, but does not imply
5 * an endorsement by T.sqware of the product in which it is included.
6 */
7
8#ifndef _PCIB_H
9#define _PCIB_H
10
11/* Error codes */
12#define PCIB_ERR_SUCCESS       (0)
13#define PCIB_ERR_UNINITIALIZED (-1)  /* PCI BIOS is not initilized */
14#define PCIB_ERR_NOTPRESENT    (-2)  /* PCI BIOS not present */
15#define PCIB_ERR_NOFUNC        (-3)  /* Function not supported */
16#define PCIB_ERR_BADVENDOR     (-4)  /* Bad Vendor ID */
17#define PCIB_ERR_DEVNOTFOUND   (-5)  /* Device not found */
18#define PCIB_ERR_BADREG        (-6)  /* Bad register number */   
19
20/*
21 * Make device signature from bus number, device numebr and function
22 * number
23 */
24#define PCIB_DEVSIG_MAKE(b,d,f) ((b<<8)|(d<<3)|(f))
25
26/*
27 * Extract valrous part from device signature
28 */
29#define PCIB_DEVSIG_BUS(x) (((x)>>8) &0xff)
30#define PCIB_DEVSIG_DEV(x) (((x)>>3) & 0x1f)
31#define PCIB_DEVSIG_FUNC(x) ((x) & 0x7)
32
33int pcib_init(void);
34int pcib_find_by_devid(int vendorId, int devId, int idx, int *sig);
35int pcib_find_by_class(int classCode, int idx, int *sig);
36int pcib_special_cycle(int busNo, int data);
37int pcib_conf_read8(int sig, int off, unsigned char *data);
38int pcib_conf_read16(int sig, int off, unsigned short *data);
39int pcib_conf_read32(int sig, int off, unsigned int *data);
40int pcib_conf_write8(int sig, int off, unsigned int data);
41int pcib_conf_write16(int sig, int off, unsigned int data);
42int pcib_conf_write32(int sig, int off, unsigned int data);
43
44int
45BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
46                   int instance, int *pbus, int *pdev, int *pfun );
47
48
49#endif /* _PCIB_H */
50
Note: See TracBrowser for help on using the repository browser.