mirror of
https://git.rtems.org/rtems-libbsd/
synced 2025-07-25 07:03:11 +08:00
Add PCI and PCIB interface files
This commit is contained in:
parent
68df6075af
commit
837df26074
2
Makefile
2
Makefile
@ -314,6 +314,8 @@ C_FILES += freebsd/local/bus_if.c
|
||||
C_FILES += freebsd/local/device_if.c
|
||||
C_FILES += freebsd/local/cryptodev_if.c
|
||||
C_FILES += freebsd/local/miibus_if.c
|
||||
C_FILES += freebsd/local/pci_if.c
|
||||
C_FILES += freebsd/local/pcib_if.c
|
||||
C_FILES += freebsd/kern/init_main.c
|
||||
C_FILES += freebsd/kern/kern_mib.c
|
||||
C_FILES += freebsd/kern/kern_mbuf.c
|
||||
|
@ -563,7 +563,6 @@ rtems.addEmptyHeaderFiles(
|
||||
#'machine/vmparam.h',
|
||||
'local/opt_bce.h',
|
||||
'local/opt_ntp.h',
|
||||
'local/pci_if.h',
|
||||
'security/audit/audit.h',
|
||||
'sys/bio.h',
|
||||
'sys/copyright.h',
|
||||
@ -680,6 +679,8 @@ local.addHeaderFiles(
|
||||
'local/cryptodev_if.h',
|
||||
'local/miibus_if.h',
|
||||
'local/miidevs.h',
|
||||
'local/pci_if.h',
|
||||
'local/pcib_if.h',
|
||||
]
|
||||
)
|
||||
local.addSourceFiles(
|
||||
@ -690,6 +691,8 @@ local.addSourceFiles(
|
||||
'local/device_if.c',
|
||||
'local/cryptodev_if.c',
|
||||
'local/miibus_if.c',
|
||||
'local/pci_if.c',
|
||||
'local/pcib_if.c',
|
||||
]
|
||||
)
|
||||
|
||||
|
172
freebsd/local/pci_if.c
Normal file
172
freebsd/local/pci_if.c
Normal file
@ -0,0 +1,172 @@
|
||||
#include <freebsd/machine/rtems-bsd-config.h>
|
||||
|
||||
/*
|
||||
* This file is produced automatically.
|
||||
* Do not modify anything in here by hand.
|
||||
*
|
||||
* Created from source file
|
||||
* dev/pci/pci_if.m
|
||||
* with
|
||||
* makeobjops.awk
|
||||
*
|
||||
* See the source file for legal information
|
||||
*/
|
||||
|
||||
#include <freebsd/sys/param.h>
|
||||
#include <freebsd/sys/queue.h>
|
||||
#include <freebsd/sys/kernel.h>
|
||||
#include <freebsd/sys/kobj.h>
|
||||
#include <freebsd/sys/bus.h>
|
||||
#include <freebsd/local/pci_if.h>
|
||||
|
||||
|
||||
static int
|
||||
null_msi_count(device_t dev, device_t child)
|
||||
{
|
||||
return (0);
|
||||
}
|
||||
|
||||
struct kobj_method pci_read_config_method_default = {
|
||||
&pci_read_config_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_read_config_desc = {
|
||||
0, &pci_read_config_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_write_config_method_default = {
|
||||
&pci_write_config_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_write_config_desc = {
|
||||
0, &pci_write_config_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_get_powerstate_method_default = {
|
||||
&pci_get_powerstate_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_get_powerstate_desc = {
|
||||
0, &pci_get_powerstate_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_set_powerstate_method_default = {
|
||||
&pci_set_powerstate_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_set_powerstate_desc = {
|
||||
0, &pci_set_powerstate_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_get_vpd_ident_method_default = {
|
||||
&pci_get_vpd_ident_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_get_vpd_ident_desc = {
|
||||
0, &pci_get_vpd_ident_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_get_vpd_readonly_method_default = {
|
||||
&pci_get_vpd_readonly_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_get_vpd_readonly_desc = {
|
||||
0, &pci_get_vpd_readonly_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_enable_busmaster_method_default = {
|
||||
&pci_enable_busmaster_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_enable_busmaster_desc = {
|
||||
0, &pci_enable_busmaster_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_disable_busmaster_method_default = {
|
||||
&pci_disable_busmaster_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_disable_busmaster_desc = {
|
||||
0, &pci_disable_busmaster_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_enable_io_method_default = {
|
||||
&pci_enable_io_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_enable_io_desc = {
|
||||
0, &pci_enable_io_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_disable_io_method_default = {
|
||||
&pci_disable_io_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_disable_io_desc = {
|
||||
0, &pci_disable_io_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_assign_interrupt_method_default = {
|
||||
&pci_assign_interrupt_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_assign_interrupt_desc = {
|
||||
0, &pci_assign_interrupt_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_find_extcap_method_default = {
|
||||
&pci_find_extcap_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_find_extcap_desc = {
|
||||
0, &pci_find_extcap_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_alloc_msi_method_default = {
|
||||
&pci_alloc_msi_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_alloc_msi_desc = {
|
||||
0, &pci_alloc_msi_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_alloc_msix_method_default = {
|
||||
&pci_alloc_msix_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_alloc_msix_desc = {
|
||||
0, &pci_alloc_msix_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_remap_msix_method_default = {
|
||||
&pci_remap_msix_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_remap_msix_desc = {
|
||||
0, &pci_remap_msix_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_release_msi_method_default = {
|
||||
&pci_release_msi_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_release_msi_desc = {
|
||||
0, &pci_release_msi_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_msi_count_method_default = {
|
||||
&pci_msi_count_desc, (kobjop_t) null_msi_count
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_msi_count_desc = {
|
||||
0, &pci_msi_count_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pci_msix_count_method_default = {
|
||||
&pci_msix_count_desc, (kobjop_t) null_msi_count
|
||||
};
|
||||
|
||||
struct kobjop_desc pci_msix_count_desc = {
|
||||
0, &pci_msix_count_method_default
|
||||
};
|
||||
|
@ -1 +1,245 @@
|
||||
/* EMPTY */
|
||||
/*
|
||||
* This file is produced automatically.
|
||||
* Do not modify anything in here by hand.
|
||||
*
|
||||
* Created from source file
|
||||
* dev/pci/pci_if.m
|
||||
* with
|
||||
* makeobjops.awk
|
||||
*
|
||||
* See the source file for legal information
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _pci_if_h_
|
||||
#define _pci_if_h_
|
||||
|
||||
/** @brief Unique descriptor for the PCI_READ_CONFIG() method */
|
||||
extern struct kobjop_desc pci_read_config_desc;
|
||||
/** @brief A function implementing the PCI_READ_CONFIG() method */
|
||||
typedef u_int32_t pci_read_config_t(device_t dev, device_t child, int reg,
|
||||
int width);
|
||||
|
||||
static __inline u_int32_t PCI_READ_CONFIG(device_t dev, device_t child, int reg,
|
||||
int width)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_read_config);
|
||||
return ((pci_read_config_t *) _m)(dev, child, reg, width);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_WRITE_CONFIG() method */
|
||||
extern struct kobjop_desc pci_write_config_desc;
|
||||
/** @brief A function implementing the PCI_WRITE_CONFIG() method */
|
||||
typedef void pci_write_config_t(device_t dev, device_t child, int reg,
|
||||
u_int32_t val, int width);
|
||||
|
||||
static __inline void PCI_WRITE_CONFIG(device_t dev, device_t child, int reg,
|
||||
u_int32_t val, int width)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_write_config);
|
||||
((pci_write_config_t *) _m)(dev, child, reg, val, width);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_GET_POWERSTATE() method */
|
||||
extern struct kobjop_desc pci_get_powerstate_desc;
|
||||
/** @brief A function implementing the PCI_GET_POWERSTATE() method */
|
||||
typedef int pci_get_powerstate_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_GET_POWERSTATE(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_get_powerstate);
|
||||
return ((pci_get_powerstate_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_SET_POWERSTATE() method */
|
||||
extern struct kobjop_desc pci_set_powerstate_desc;
|
||||
/** @brief A function implementing the PCI_SET_POWERSTATE() method */
|
||||
typedef int pci_set_powerstate_t(device_t dev, device_t child, int state);
|
||||
|
||||
static __inline int PCI_SET_POWERSTATE(device_t dev, device_t child, int state)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_set_powerstate);
|
||||
return ((pci_set_powerstate_t *) _m)(dev, child, state);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_GET_VPD_IDENT() method */
|
||||
extern struct kobjop_desc pci_get_vpd_ident_desc;
|
||||
/** @brief A function implementing the PCI_GET_VPD_IDENT() method */
|
||||
typedef int pci_get_vpd_ident_t(device_t dev, device_t child,
|
||||
const char **identptr);
|
||||
|
||||
static __inline int PCI_GET_VPD_IDENT(device_t dev, device_t child,
|
||||
const char **identptr)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_get_vpd_ident);
|
||||
return ((pci_get_vpd_ident_t *) _m)(dev, child, identptr);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_GET_VPD_READONLY() method */
|
||||
extern struct kobjop_desc pci_get_vpd_readonly_desc;
|
||||
/** @brief A function implementing the PCI_GET_VPD_READONLY() method */
|
||||
typedef int pci_get_vpd_readonly_t(device_t dev, device_t child, const char *kw,
|
||||
const char **vptr);
|
||||
|
||||
static __inline int PCI_GET_VPD_READONLY(device_t dev, device_t child,
|
||||
const char *kw, const char **vptr)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_get_vpd_readonly);
|
||||
return ((pci_get_vpd_readonly_t *) _m)(dev, child, kw, vptr);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_ENABLE_BUSMASTER() method */
|
||||
extern struct kobjop_desc pci_enable_busmaster_desc;
|
||||
/** @brief A function implementing the PCI_ENABLE_BUSMASTER() method */
|
||||
typedef int pci_enable_busmaster_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_ENABLE_BUSMASTER(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_enable_busmaster);
|
||||
return ((pci_enable_busmaster_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_DISABLE_BUSMASTER() method */
|
||||
extern struct kobjop_desc pci_disable_busmaster_desc;
|
||||
/** @brief A function implementing the PCI_DISABLE_BUSMASTER() method */
|
||||
typedef int pci_disable_busmaster_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_DISABLE_BUSMASTER(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_disable_busmaster);
|
||||
return ((pci_disable_busmaster_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_ENABLE_IO() method */
|
||||
extern struct kobjop_desc pci_enable_io_desc;
|
||||
/** @brief A function implementing the PCI_ENABLE_IO() method */
|
||||
typedef int pci_enable_io_t(device_t dev, device_t child, int space);
|
||||
|
||||
static __inline int PCI_ENABLE_IO(device_t dev, device_t child, int space)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_enable_io);
|
||||
return ((pci_enable_io_t *) _m)(dev, child, space);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_DISABLE_IO() method */
|
||||
extern struct kobjop_desc pci_disable_io_desc;
|
||||
/** @brief A function implementing the PCI_DISABLE_IO() method */
|
||||
typedef int pci_disable_io_t(device_t dev, device_t child, int space);
|
||||
|
||||
static __inline int PCI_DISABLE_IO(device_t dev, device_t child, int space)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_disable_io);
|
||||
return ((pci_disable_io_t *) _m)(dev, child, space);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_ASSIGN_INTERRUPT() method */
|
||||
extern struct kobjop_desc pci_assign_interrupt_desc;
|
||||
/** @brief A function implementing the PCI_ASSIGN_INTERRUPT() method */
|
||||
typedef int pci_assign_interrupt_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_ASSIGN_INTERRUPT(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_assign_interrupt);
|
||||
return ((pci_assign_interrupt_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_FIND_EXTCAP() method */
|
||||
extern struct kobjop_desc pci_find_extcap_desc;
|
||||
/** @brief A function implementing the PCI_FIND_EXTCAP() method */
|
||||
typedef int pci_find_extcap_t(device_t dev, device_t child, int capability,
|
||||
int *capreg);
|
||||
|
||||
static __inline int PCI_FIND_EXTCAP(device_t dev, device_t child,
|
||||
int capability, int *capreg)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_find_extcap);
|
||||
return ((pci_find_extcap_t *) _m)(dev, child, capability, capreg);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_ALLOC_MSI() method */
|
||||
extern struct kobjop_desc pci_alloc_msi_desc;
|
||||
/** @brief A function implementing the PCI_ALLOC_MSI() method */
|
||||
typedef int pci_alloc_msi_t(device_t dev, device_t child, int *count);
|
||||
|
||||
static __inline int PCI_ALLOC_MSI(device_t dev, device_t child, int *count)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_alloc_msi);
|
||||
return ((pci_alloc_msi_t *) _m)(dev, child, count);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_ALLOC_MSIX() method */
|
||||
extern struct kobjop_desc pci_alloc_msix_desc;
|
||||
/** @brief A function implementing the PCI_ALLOC_MSIX() method */
|
||||
typedef int pci_alloc_msix_t(device_t dev, device_t child, int *count);
|
||||
|
||||
static __inline int PCI_ALLOC_MSIX(device_t dev, device_t child, int *count)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_alloc_msix);
|
||||
return ((pci_alloc_msix_t *) _m)(dev, child, count);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_REMAP_MSIX() method */
|
||||
extern struct kobjop_desc pci_remap_msix_desc;
|
||||
/** @brief A function implementing the PCI_REMAP_MSIX() method */
|
||||
typedef int pci_remap_msix_t(device_t dev, device_t child, int count,
|
||||
const u_int *vectors);
|
||||
|
||||
static __inline int PCI_REMAP_MSIX(device_t dev, device_t child, int count,
|
||||
const u_int *vectors)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_remap_msix);
|
||||
return ((pci_remap_msix_t *) _m)(dev, child, count, vectors);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_RELEASE_MSI() method */
|
||||
extern struct kobjop_desc pci_release_msi_desc;
|
||||
/** @brief A function implementing the PCI_RELEASE_MSI() method */
|
||||
typedef int pci_release_msi_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_RELEASE_MSI(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_release_msi);
|
||||
return ((pci_release_msi_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_MSI_COUNT() method */
|
||||
extern struct kobjop_desc pci_msi_count_desc;
|
||||
/** @brief A function implementing the PCI_MSI_COUNT() method */
|
||||
typedef int pci_msi_count_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_MSI_COUNT(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_msi_count);
|
||||
return ((pci_msi_count_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
/** @brief Unique descriptor for the PCI_MSIX_COUNT() method */
|
||||
extern struct kobjop_desc pci_msix_count_desc;
|
||||
/** @brief A function implementing the PCI_MSIX_COUNT() method */
|
||||
typedef int pci_msix_count_t(device_t dev, device_t child);
|
||||
|
||||
static __inline int PCI_MSIX_COUNT(device_t dev, device_t child)
|
||||
{
|
||||
kobjop_t _m;
|
||||
KOBJOPLOOKUP(((kobj_t)dev)->ops,pci_msix_count);
|
||||
return ((pci_msix_count_t *) _m)(dev, child);
|
||||
}
|
||||
|
||||
#endif /* _pci_if_h_ */
|
||||
|
101
freebsd/local/pcib_if.c
Normal file
101
freebsd/local/pcib_if.c
Normal file
@ -0,0 +1,101 @@
|
||||
#include <freebsd/machine/rtems-bsd-config.h>
|
||||
|
||||
/*
|
||||
* This file is produced automatically.
|
||||
* Do not modify anything in here by hand.
|
||||
*
|
||||
* Created from source file
|
||||
* dev/pci/pcib_if.m
|
||||
* with
|
||||
* makeobjops.awk
|
||||
*
|
||||
* See the source file for legal information
|
||||
*/
|
||||
|
||||
#include <freebsd/sys/param.h>
|
||||
#include <freebsd/sys/queue.h>
|
||||
#include <freebsd/sys/kernel.h>
|
||||
#include <freebsd/sys/kobj.h>
|
||||
#include <freebsd/sys/bus.h>
|
||||
#include <freebsd/dev/pci/pcivar.h>
|
||||
#include <freebsd/local/pcib_if.h>
|
||||
|
||||
|
||||
static int
|
||||
null_route_interrupt(device_t pcib, device_t dev, int pin)
|
||||
{
|
||||
return (PCI_INVALID_IRQ);
|
||||
}
|
||||
|
||||
struct kobj_method pcib_maxslots_method_default = {
|
||||
&pcib_maxslots_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_maxslots_desc = {
|
||||
0, &pcib_maxslots_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_read_config_method_default = {
|
||||
&pcib_read_config_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_read_config_desc = {
|
||||
0, &pcib_read_config_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_write_config_method_default = {
|
||||
&pcib_write_config_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_write_config_desc = {
|
||||
0, &pcib_write_config_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_route_interrupt_method_default = {
|
||||
&pcib_route_interrupt_desc, (kobjop_t) null_route_interrupt
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_route_interrupt_desc = {
|
||||
0, &pcib_route_interrupt_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_alloc_msi_method_default = {
|
||||
&pcib_alloc_msi_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_alloc_msi_desc = {
|
||||
0, &pcib_alloc_msi_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_release_msi_method_default = {
|
||||
&pcib_release_msi_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_release_msi_desc = {
|
||||
0, &pcib_release_msi_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_alloc_msix_method_default = {
|
||||
&pcib_alloc_msix_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_alloc_msix_desc = {
|
||||
0, &pcib_alloc_msix_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_release_msix_method_default = {
|
||||
&pcib_release_msix_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_release_msix_desc = {
|
||||
0, &pcib_release_msix_method_default
|
||||
};
|
||||
|
||||
struct kobj_method pcib_map_msi_method_default = {
|
||||
&pcib_map_msi_desc, (kobjop_t) kobj_error_method
|
||||
};
|
||||
|
||||
struct kobjop_desc pcib_map_msi_desc = {
|
||||
0, &pcib_map_msi_method_default
|
||||
};
|
||||
|
137
freebsd/local/pcib_if.h
Normal file
137
freebsd/local/pcib_if.h
Normal file
@ -0,0 +1,137 @@
|
||||
/*
|
||||
* This file is produced automatically.
|
||||
* Do not modify anything in here by hand.
|
||||
*
|
||||
* Created from source file
|
||||
* dev/pci/pcib_if.m
|
||||
* with
|
||||
* makeobjops.awk
|
||||
*
|
||||
* See the source file for legal information
|
||||
*/
|
||||
|
||||
|
||||
#ifndef _pcib_if_h_
|
||||
#define _pcib_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_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);
|
||||
}
|
||||
|
||||
#endif /* _pcib_if_h_ */
|
Loading…
x
Reference in New Issue
Block a user