summaryrefslogtreecommitdiffstats
path: root/rtemsbsd/include/rtems/bsd/local/pcib_if.h
blob: a7c06c31d3ebe212a0a7899f89495efef51007a4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
/*
 * This file is produced automatically.
 * Do not modify anything in here by hand.
 *
 * Created from source file
 *   freebsd-org/sys/dev/pci/pcib_if.m
 * with
 *   makeobjops.awk
 *
 * See the source file for legal information
 */


#ifndef _pcib_if_h_
#define _pcib_if_h_


#include "pci_if.h"

/** @brief Unique descriptor for the PCIB_MAXSLOTS() method */
extern struct kobjop_desc pcib_maxslots_desc;
/** @brief A function implementing the PCIB_MAXSLOTS() method */
typedef int pcib_maxslots_t(device_t dev);

static __inline int PCIB_MAXSLOTS(device_t dev)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_maxslots);
	return ((pcib_maxslots_t *) _m)(dev);
}

/** @brief Unique descriptor for the PCIB_MAXFUNCS() method */
extern struct kobjop_desc pcib_maxfuncs_desc;
/** @brief A function implementing the PCIB_MAXFUNCS() method */
typedef int pcib_maxfuncs_t(device_t dev);

static __inline int PCIB_MAXFUNCS(device_t dev)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_maxfuncs);
	return ((pcib_maxfuncs_t *) _m)(dev);
}

/** @brief Unique descriptor for the PCIB_READ_CONFIG() method */
extern struct kobjop_desc pcib_read_config_desc;
/** @brief A function implementing the PCIB_READ_CONFIG() method */
typedef u_int32_t pcib_read_config_t(device_t dev, u_int bus, u_int slot,
                                     u_int func, u_int reg, int width);

static __inline u_int32_t PCIB_READ_CONFIG(device_t dev, u_int bus, u_int slot,
                                           u_int func, u_int reg, int width)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_read_config);
	return ((pcib_read_config_t *) _m)(dev, bus, slot, func, reg, width);
}

/** @brief Unique descriptor for the PCIB_WRITE_CONFIG() method */
extern struct kobjop_desc pcib_write_config_desc;
/** @brief A function implementing the PCIB_WRITE_CONFIG() method */
typedef void pcib_write_config_t(device_t dev, u_int bus, u_int slot,
                                 u_int func, u_int reg, u_int32_t value,
                                 int width);

static __inline void PCIB_WRITE_CONFIG(device_t dev, u_int bus, u_int slot,
                                       u_int func, u_int reg, u_int32_t value,
                                       int width)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)dev)->ops,pcib_write_config);
	((pcib_write_config_t *) _m)(dev, bus, slot, func, reg, value, width);
}

/** @brief Unique descriptor for the PCIB_ROUTE_INTERRUPT() method */
extern struct kobjop_desc pcib_route_interrupt_desc;
/** @brief A function implementing the PCIB_ROUTE_INTERRUPT() method */
typedef int pcib_route_interrupt_t(device_t pcib, device_t dev, int pin);

static __inline int PCIB_ROUTE_INTERRUPT(device_t pcib, device_t dev, int pin)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_route_interrupt);
	return ((pcib_route_interrupt_t *) _m)(pcib, dev, pin);
}

/** @brief Unique descriptor for the PCIB_ALLOC_MSI() method */
extern struct kobjop_desc pcib_alloc_msi_desc;
/** @brief A function implementing the PCIB_ALLOC_MSI() method */
typedef int pcib_alloc_msi_t(device_t pcib, device_t dev, int count,
                             int maxcount, int *irqs);

static __inline int PCIB_ALLOC_MSI(device_t pcib, device_t dev, int count,
                                   int maxcount, int *irqs)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_alloc_msi);
	return ((pcib_alloc_msi_t *) _m)(pcib, dev, count, maxcount, irqs);
}

/** @brief Unique descriptor for the PCIB_RELEASE_MSI() method */
extern struct kobjop_desc pcib_release_msi_desc;
/** @brief A function implementing the PCIB_RELEASE_MSI() method */
typedef int pcib_release_msi_t(device_t pcib, device_t dev, int count,
                               int *irqs);

static __inline int PCIB_RELEASE_MSI(device_t pcib, device_t dev, int count,
                                     int *irqs)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_release_msi);
	return ((pcib_release_msi_t *) _m)(pcib, dev, count, irqs);
}

/** @brief Unique descriptor for the PCIB_ALLOC_MSIX() method */
extern struct kobjop_desc pcib_alloc_msix_desc;
/** @brief A function implementing the PCIB_ALLOC_MSIX() method */
typedef int pcib_alloc_msix_t(device_t pcib, device_t dev, int *irq);

static __inline int PCIB_ALLOC_MSIX(device_t pcib, device_t dev, int *irq)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_alloc_msix);
	return ((pcib_alloc_msix_t *) _m)(pcib, dev, irq);
}

/** @brief Unique descriptor for the PCIB_RELEASE_MSIX() method */
extern struct kobjop_desc pcib_release_msix_desc;
/** @brief A function implementing the PCIB_RELEASE_MSIX() method */
typedef int pcib_release_msix_t(device_t pcib, device_t dev, int irq);

static __inline int PCIB_RELEASE_MSIX(device_t pcib, device_t dev, int irq)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_release_msix);
	return ((pcib_release_msix_t *) _m)(pcib, dev, irq);
}

/** @brief Unique descriptor for the PCIB_MAP_MSI() method */
extern struct kobjop_desc pcib_map_msi_desc;
/** @brief A function implementing the PCIB_MAP_MSI() method */
typedef int pcib_map_msi_t(device_t pcib, device_t dev, int irq, uint64_t *addr,
                           uint32_t *data);

static __inline int PCIB_MAP_MSI(device_t pcib, device_t dev, int irq,
                                 uint64_t *addr, uint32_t *data)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_map_msi);
	return ((pcib_map_msi_t *) _m)(pcib, dev, irq, addr, data);
}

/** @brief Unique descriptor for the PCIB_POWER_FOR_SLEEP() method */
extern struct kobjop_desc pcib_power_for_sleep_desc;
/** @brief A function implementing the PCIB_POWER_FOR_SLEEP() method */
typedef int pcib_power_for_sleep_t(device_t pcib, device_t dev, int *pstate);

static __inline int PCIB_POWER_FOR_SLEEP(device_t pcib, device_t dev,
                                         int *pstate)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_power_for_sleep);
	return ((pcib_power_for_sleep_t *) _m)(pcib, dev, pstate);
}

/** @brief Unique descriptor for the PCIB_GET_ID() method */
extern struct kobjop_desc pcib_get_id_desc;
/** @brief A function implementing the PCIB_GET_ID() method */
typedef int pcib_get_id_t(device_t pcib, device_t dev, enum pci_id_type type,
                          uintptr_t *id);

static __inline int PCIB_GET_ID(device_t pcib, device_t dev,
                                enum pci_id_type type, uintptr_t *id)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_get_id);
	return ((pcib_get_id_t *) _m)(pcib, dev, type, id);
}

/** @brief Unique descriptor for the PCIB_TRY_ENABLE_ARI() method */
extern struct kobjop_desc pcib_try_enable_ari_desc;
/** @brief A function implementing the PCIB_TRY_ENABLE_ARI() method */
typedef int pcib_try_enable_ari_t(device_t pcib, device_t dev);

static __inline int PCIB_TRY_ENABLE_ARI(device_t pcib, device_t dev)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_try_enable_ari);
	return ((pcib_try_enable_ari_t *) _m)(pcib, dev);
}

/** @brief Unique descriptor for the PCIB_ARI_ENABLED() method */
extern struct kobjop_desc pcib_ari_enabled_desc;
/** @brief A function implementing the PCIB_ARI_ENABLED() method */
typedef int pcib_ari_enabled_t(device_t pcib);

static __inline int PCIB_ARI_ENABLED(device_t pcib)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_ari_enabled);
	return ((pcib_ari_enabled_t *) _m)(pcib);
}

/** @brief Unique descriptor for the PCIB_DECODE_RID() method */
extern struct kobjop_desc pcib_decode_rid_desc;
/** @brief A function implementing the PCIB_DECODE_RID() method */
typedef void pcib_decode_rid_t(device_t pcib, uint16_t rid, int *bus, int *slot,
                               int *func);

static __inline void PCIB_DECODE_RID(device_t pcib, uint16_t rid, int *bus,
                                     int *slot, int *func)
{
	kobjop_t _m;
	KOBJOPLOOKUP(((kobj_t)pcib)->ops,pcib_decode_rid);
	((pcib_decode_rid_t *) _m)(pcib, rid, bus, slot, func);
}

#endif /* _pcib_if_h_ */