source: rtems/c/src/lib/libbsp/i386/shared/pci/pcibios.h @ 5e1d6cb

Last change on this file since 5e1d6cb was 5e1d6cb, checked in by Ralf Corsepius <ralf.corsepius@…>, on Oct 8, 2003 at 3:37:53 PM

2003-10-08 Ralf Corsepius <corsepiu@…>

  • comm/uart.h: Add extern "C" guards.
  • pci/pcibios.h: Ditto.
  • 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
33#ifdef __cplusplus
34extern "C" {
35#endif
36
37int pcib_init(void);
38int pcib_find_by_devid(int vendorId, int devId, int idx, int *sig);
39int pcib_find_by_class(int classCode, int idx, int *sig);
40int pcib_special_cycle(int busNo, int data);
41int pcib_conf_read8(int sig, int off, unsigned char *data);
42int pcib_conf_read16(int sig, int off, unsigned short *data);
43int pcib_conf_read32(int sig, int off, unsigned int *data);
44int pcib_conf_write8(int sig, int off, unsigned int data);
45int pcib_conf_write16(int sig, int off, unsigned int data);
46int pcib_conf_write32(int sig, int off, unsigned int data);
47
48int
49BSP_pciFindDevice( unsigned short vendorid, unsigned short deviceid,
50                   int instance, int *pbus, int *pdev, int *pfun );
51
52#ifdef __cplusplus
53}
54#endif
55
56#endif /* _PCIB_H */
57
Note: See TracBrowser for help on using the repository browser.