source: rtems-libbsd/rtemsbsd/include/rtems/bsd/local/pcib_if.h @ c1205ee

55-freebsd-126-freebsd-12
Last change on this file since c1205ee was c40e45b, checked in by Sebastian Huber <sebastian.huber@…>, on 10/07/16 at 13:10:20

Update to FreeBSD head 2016-08-23

Git mirror commit 9fe7c416e6abb28b1398fd3e5687099846800cfd.

  • Property mode set to 100644
File size: 7.8 KB
Line 
1/*
2 * This file is produced automatically.
3 * Do not modify anything in here by hand.
4 *
5 * Created from source file
6 *   freebsd-org/sys/dev/pci/pcib_if.m
7 * with
8 *   makeobjops.awk
9 *
10 * See the source file for legal information
11 */
12
13
14#ifndef _pcib_if_h_
15#define _pcib_if_h_
16
17
18#include "pci_if.h"
19
20/** @brief Unique descriptor for the PCIB_MAXSLOTS() method */
21extern struct kobjop_desc pcib_maxslots_desc;
22/** @brief A function implementing the PCIB_MAXSLOTS() method */
23typedef int pcib_maxslots_t(device_t dev);
24
25static __inline int PCIB_MAXSLOTS(device_t dev)
26{
27        kobjop_t _m;
28        KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_maxslots);
29        return ((pcib_maxslots_t *) _m)(dev);
30}
31
32/** @brief Unique descriptor for the PCIB_MAXFUNCS() method */
33extern struct kobjop_desc pcib_maxfuncs_desc;
34/** @brief A function implementing the PCIB_MAXFUNCS() method */
35typedef int pcib_maxfuncs_t(device_t dev);
36
37static __inline int PCIB_MAXFUNCS(device_t dev)
38{
39        kobjop_t _m;
40        KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_maxfuncs);
41        return ((pcib_maxfuncs_t *) _m)(dev);
42}
43
44/** @brief Unique descriptor for the PCIB_READ_CONFIG() method */
45extern struct kobjop_desc pcib_read_config_desc;
46/** @brief A function implementing the PCIB_READ_CONFIG() method */
47typedef u_int32_t pcib_read_config_t(device_t dev, u_int bus, u_int slot,
48                                     u_int func, u_int reg, int width);
49
50static __inline u_int32_t PCIB_READ_CONFIG(device_t dev, u_int bus, u_int slot,
51                                           u_int func, u_int reg, int width)
52{
53        kobjop_t _m;
54        KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_read_config);
55        return ((pcib_read_config_t *) _m)(dev, bus, slot, func, reg, width);
56}
57
58/** @brief Unique descriptor for the PCIB_WRITE_CONFIG() method */
59extern struct kobjop_desc pcib_write_config_desc;
60/** @brief A function implementing the PCIB_WRITE_CONFIG() method */
61typedef void pcib_write_config_t(device_t dev, u_int bus, u_int slot,
62                                 u_int func, u_int reg, u_int32_t value,
63                                 int width);
64
65static __inline void PCIB_WRITE_CONFIG(device_t dev, u_int bus, u_int slot,
66                                       u_int func, u_int reg, u_int32_t value,
67                                       int width)
68{
69        kobjop_t _m;
70        KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_write_config);
71        ((pcib_write_config_t *) _m)(dev, bus, slot, func, reg, value, width);
72}
73
74/** @brief Unique descriptor for the PCIB_ROUTE_INTERRUPT() method */
75extern struct kobjop_desc pcib_route_interrupt_desc;
76/** @brief A function implementing the PCIB_ROUTE_INTERRUPT() method */
77typedef int pcib_route_interrupt_t(device_t pcib, device_t dev, int pin);
78
79static __inline int PCIB_ROUTE_INTERRUPT(device_t pcib, device_t dev, int pin)
80{
81        kobjop_t _m;
82        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_route_interrupt);
83        return ((pcib_route_interrupt_t *) _m)(pcib, dev, pin);
84}
85
86/** @brief Unique descriptor for the PCIB_ALLOC_MSI() method */
87extern struct kobjop_desc pcib_alloc_msi_desc;
88/** @brief A function implementing the PCIB_ALLOC_MSI() method */
89typedef int pcib_alloc_msi_t(device_t pcib, device_t dev, int count,
90                             int maxcount, int *irqs);
91
92static __inline int PCIB_ALLOC_MSI(device_t pcib, device_t dev, int count,
93                                   int maxcount, int *irqs)
94{
95        kobjop_t _m;
96        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_alloc_msi);
97        return ((pcib_alloc_msi_t *) _m)(pcib, dev, count, maxcount, irqs);
98}
99
100/** @brief Unique descriptor for the PCIB_RELEASE_MSI() method */
101extern struct kobjop_desc pcib_release_msi_desc;
102/** @brief A function implementing the PCIB_RELEASE_MSI() method */
103typedef int pcib_release_msi_t(device_t pcib, device_t dev, int count,
104                               int *irqs);
105
106static __inline int PCIB_RELEASE_MSI(device_t pcib, device_t dev, int count,
107                                     int *irqs)
108{
109        kobjop_t _m;
110        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_release_msi);
111        return ((pcib_release_msi_t *) _m)(pcib, dev, count, irqs);
112}
113
114/** @brief Unique descriptor for the PCIB_ALLOC_MSIX() method */
115extern struct kobjop_desc pcib_alloc_msix_desc;
116/** @brief A function implementing the PCIB_ALLOC_MSIX() method */
117typedef int pcib_alloc_msix_t(device_t pcib, device_t dev, int *irq);
118
119static __inline int PCIB_ALLOC_MSIX(device_t pcib, device_t dev, int *irq)
120{
121        kobjop_t _m;
122        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_alloc_msix);
123        return ((pcib_alloc_msix_t *) _m)(pcib, dev, irq);
124}
125
126/** @brief Unique descriptor for the PCIB_RELEASE_MSIX() method */
127extern struct kobjop_desc pcib_release_msix_desc;
128/** @brief A function implementing the PCIB_RELEASE_MSIX() method */
129typedef int pcib_release_msix_t(device_t pcib, device_t dev, int irq);
130
131static __inline int PCIB_RELEASE_MSIX(device_t pcib, device_t dev, int irq)
132{
133        kobjop_t _m;
134        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_release_msix);
135        return ((pcib_release_msix_t *) _m)(pcib, dev, irq);
136}
137
138/** @brief Unique descriptor for the PCIB_MAP_MSI() method */
139extern struct kobjop_desc pcib_map_msi_desc;
140/** @brief A function implementing the PCIB_MAP_MSI() method */
141typedef int pcib_map_msi_t(device_t pcib, device_t dev, int irq, uint64_t *addr,
142                           uint32_t *data);
143
144static __inline int PCIB_MAP_MSI(device_t pcib, device_t dev, int irq,
145                                 uint64_t *addr, uint32_t *data)
146{
147        kobjop_t _m;
148        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_map_msi);
149        return ((pcib_map_msi_t *) _m)(pcib, dev, irq, addr, data);
150}
151
152/** @brief Unique descriptor for the PCIB_POWER_FOR_SLEEP() method */
153extern struct kobjop_desc pcib_power_for_sleep_desc;
154/** @brief A function implementing the PCIB_POWER_FOR_SLEEP() method */
155typedef int pcib_power_for_sleep_t(device_t pcib, device_t dev, int *pstate);
156
157static __inline int PCIB_POWER_FOR_SLEEP(device_t pcib, device_t dev,
158                                         int *pstate)
159{
160        kobjop_t _m;
161        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_power_for_sleep);
162        return ((pcib_power_for_sleep_t *) _m)(pcib, dev, pstate);
163}
164
165/** @brief Unique descriptor for the PCIB_GET_ID() method */
166extern struct kobjop_desc pcib_get_id_desc;
167/** @brief A function implementing the PCIB_GET_ID() method */
168typedef int pcib_get_id_t(device_t pcib, device_t dev, enum pci_id_type type,
169                          uintptr_t *id);
170
171static __inline int PCIB_GET_ID(device_t pcib, device_t dev,
172                                enum pci_id_type type, uintptr_t *id)
173{
174        kobjop_t _m;
175        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_get_id);
176        return ((pcib_get_id_t *) _m)(pcib, dev, type, id);
177}
178
179/** @brief Unique descriptor for the PCIB_TRY_ENABLE_ARI() method */
180extern struct kobjop_desc pcib_try_enable_ari_desc;
181/** @brief A function implementing the PCIB_TRY_ENABLE_ARI() method */
182typedef int pcib_try_enable_ari_t(device_t pcib, device_t dev);
183
184static __inline int PCIB_TRY_ENABLE_ARI(device_t pcib, device_t dev)
185{
186        kobjop_t _m;
187        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_try_enable_ari);
188        return ((pcib_try_enable_ari_t *) _m)(pcib, dev);
189}
190
191/** @brief Unique descriptor for the PCIB_ARI_ENABLED() method */
192extern struct kobjop_desc pcib_ari_enabled_desc;
193/** @brief A function implementing the PCIB_ARI_ENABLED() method */
194typedef int pcib_ari_enabled_t(device_t pcib);
195
196static __inline int PCIB_ARI_ENABLED(device_t pcib)
197{
198        kobjop_t _m;
199        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_ari_enabled);
200        return ((pcib_ari_enabled_t *) _m)(pcib);
201}
202
203/** @brief Unique descriptor for the PCIB_DECODE_RID() method */
204extern struct kobjop_desc pcib_decode_rid_desc;
205/** @brief A function implementing the PCIB_DECODE_RID() method */
206typedef void pcib_decode_rid_t(device_t pcib, uint16_t rid, int *bus, int *slot,
207                               int *func);
208
209static __inline void PCIB_DECODE_RID(device_t pcib, uint16_t rid, int *bus,
210                                     int *slot, int *func)
211{
212        kobjop_t _m;
213        KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_decode_rid);
214        ((pcib_decode_rid_t *) _m)(pcib, rid, bus, slot, func);
215}
216
217#endif /* _pcib_if_h_ */
Note: See TracBrowser for help on using the repository browser.