RTEMS 5.2
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
libpci.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2011 Cobham Gaisler AB
3 *
4 * The license and distribution terms for this file may be
5 * found in the file LICENSE in this distribution or at
6 * http://www.rtems.org/license/LICENSE.
7 */
8
17#ifndef _RTEMS_CONFDEFS_LIBPCI_H
18#define _RTEMS_CONFDEFS_LIBPCI_H
19
20#ifndef __CONFIGURATION_TEMPLATE_h
21#error "Do not include this file directly, use <rtems/confdefs.h> instead"
22#endif
23
24#ifdef __cplusplus
25extern "C" {
26#endif /* __cplusplus */
27
28/*
29 * Select PCI Configuration Library
30 */
31#ifdef RTEMS_PCI_CONFIG_LIB
32 #ifdef CONFIGURE_INIT
33 #define PCI_LIB_NONE 0
34 #define PCI_LIB_AUTO 1
35 #define PCI_LIB_STATIC 2
36 #define PCI_LIB_READ 3
37 #define PCI_LIB_PERIPHERAL 4
38 #if CONFIGURE_PCI_LIB == PCI_LIB_AUTO
39 #define PCI_CFG_AUTO_LIB
40 #include <pci/cfg.h>
41 struct pci_bus pci_hb;
42 #define PCI_LIB_INIT pci_config_auto
43 #define PCI_LIB_CONFIG pci_config_auto_register
44 #elif CONFIGURE_PCI_LIB == PCI_LIB_STATIC
45 #define PCI_CFG_STATIC_LIB
46 #include <pci/cfg.h>
47 #define PCI_LIB_INIT pci_config_static
48 #define PCI_LIB_CONFIG NULL
49 /* Let user define PCI configuration (struct pci_bus pci_hb) */
50 #elif CONFIGURE_PCI_LIB == PCI_LIB_READ
51 #define PCI_CFG_READ_LIB
52 #include <pci/cfg.h>
53 #define PCI_LIB_INIT pci_config_read
54 #define PCI_LIB_CONFIG NULL
55 struct pci_bus pci_hb;
56 #elif CONFIGURE_PCI_LIB == PCI_LIB_PERIPHERAL
57 #define PCI_LIB_INIT pci_config_peripheral
58 #define PCI_LIB_CONFIG NULL
59 /* Let user define PCI configuration (struct pci_bus pci_hb) */
60 #elif CONFIGURE_PCI_LIB == PCI_LIB_NONE
61 #define PCI_LIB_INIT NULL
62 #define PCI_LIB_CONFIG NULL
63 /* No PCI Configuration at all, user can use/debug access routines */
64 #else
65 #error NO PCI LIBRARY DEFINED
66 #endif
67
68 const int pci_config_lib_type = CONFIGURE_PCI_LIB;
69 int (*pci_config_lib_init)(void) = PCI_LIB_INIT;
70 void (*pci_config_lib_register)(void *config) = PCI_LIB_CONFIG;
71 #endif
72#endif
73
74#ifdef __cplusplus
75}
76#endif /* __cplusplus */
77
78#endif /* _RTEMS_CONFDEFS_LIBPCI_H */
Definition: deflate.c:115
Definition: pci.h:75