Changeset View
Changeset View
Standalone View
Standalone View
sys/sys/bus.h
Context not available. | |||||
#ifndef _SYS_BUS_H_ | #ifndef _SYS_BUS_H_ | ||||
#define _SYS_BUS_H_ | #define _SYS_BUS_H_ | ||||
#include <machine/_bus.h> | |||||
#include <machine/_limits.h> | #include <machine/_limits.h> | ||||
#include <sys/_bus_dma.h> | #include <sys/_bus_dma.h> | ||||
#include <sys/ioccom.h> | #include <sys/ioccom.h> | ||||
Context not available. | |||||
int rid; /**< @brief resource identifier */ | int rid; /**< @brief resource identifier */ | ||||
int flags; /**< @brief resource flags */ | int flags; /**< @brief resource flags */ | ||||
struct resource *res; /**< @brief the real resource when allocated */ | struct resource *res; /**< @brief the real resource when allocated */ | ||||
u_long start; /**< @brief start of resource range */ | rman_res_t start; /**< @brief start of resource range */ | ||||
u_long end; /**< @brief end of resource range */ | rman_res_t end; /**< @brief end of resource range */ | ||||
u_long count; /**< @brief count within range */ | rman_res_t count; /**< @brief count within range */ | ||||
}; | }; | ||||
STAILQ_HEAD(resource_list, resource_list_entry); | STAILQ_HEAD(resource_list, resource_list_entry); | ||||
Context not available. | |||||
struct resource_list_entry * | struct resource_list_entry * | ||||
resource_list_add(struct resource_list *rl, | resource_list_add(struct resource_list *rl, | ||||
int type, int rid, | int type, int rid, | ||||
u_long start, u_long end, u_long count); | rman_res_t start, rman_res_t end, rman_res_t count); | ||||
int resource_list_add_next(struct resource_list *rl, | int resource_list_add_next(struct resource_list *rl, | ||||
int type, | int type, | ||||
u_long start, u_long end, u_long count); | rman_res_t start, rman_res_t end, rman_res_t count); | ||||
int resource_list_busy(struct resource_list *rl, | int resource_list_busy(struct resource_list *rl, | ||||
int type, int rid); | int type, int rid); | ||||
int resource_list_reserved(struct resource_list *rl, int type, int rid); | int resource_list_reserved(struct resource_list *rl, int type, int rid); | ||||
Context not available. | |||||
resource_list_alloc(struct resource_list *rl, | resource_list_alloc(struct resource_list *rl, | ||||
device_t bus, device_t child, | device_t bus, device_t child, | ||||
int type, int *rid, | int type, int *rid, | ||||
u_long start, u_long end, | rman_res_t start, rman_res_t end, | ||||
u_long count, u_int flags); | rman_res_t count, u_int flags); | ||||
int resource_list_release(struct resource_list *rl, | int resource_list_release(struct resource_list *rl, | ||||
device_t bus, device_t child, | device_t bus, device_t child, | ||||
int type, int rid, struct resource *res); | int type, int rid, struct resource *res); | ||||
Context not available. | |||||
resource_list_reserve(struct resource_list *rl, | resource_list_reserve(struct resource_list *rl, | ||||
device_t bus, device_t child, | device_t bus, device_t child, | ||||
int type, int *rid, | int type, int *rid, | ||||
u_long start, u_long end, | rman_res_t start, rman_res_t end, | ||||
u_long count, u_int flags); | rman_res_t count, u_int flags); | ||||
int resource_list_unreserve(struct resource_list *rl, | int resource_list_unreserve(struct resource_list *rl, | ||||
device_t bus, device_t child, | device_t bus, device_t child, | ||||
int type, int rid); | int type, int rid); | ||||
Context not available. | |||||
bus_generic_add_child(device_t dev, u_int order, const char *name, | bus_generic_add_child(device_t dev, u_int order, const char *name, | ||||
int unit); | int unit); | ||||
int bus_generic_adjust_resource(device_t bus, device_t child, int type, | int bus_generic_adjust_resource(device_t bus, device_t child, int type, | ||||
struct resource *r, u_long start, | struct resource *r, rman_res_t start, | ||||
u_long end); | rman_res_t end); | ||||
struct resource * | struct resource * | ||||
bus_generic_alloc_resource(device_t bus, device_t child, int type, | bus_generic_alloc_resource(device_t bus, device_t child, int type, | ||||
int *rid, u_long start, u_long end, | int *rid, rman_res_t start, rman_res_t end, | ||||
u_long count, u_int flags); | rman_res_t count, u_int flags); | ||||
int bus_generic_attach(device_t dev); | int bus_generic_attach(device_t dev); | ||||
int bus_generic_bind_intr(device_t dev, device_t child, | int bus_generic_bind_intr(device_t dev, device_t child, | ||||
struct resource *irq, int cpu); | struct resource *irq, int cpu); | ||||
Context not available. | |||||
struct resource * | struct resource * | ||||
bus_generic_rl_alloc_resource (device_t, device_t, int, int *, | bus_generic_rl_alloc_resource (device_t, device_t, int, int *, | ||||
u_long, u_long, u_long, u_int); | rman_res_t, rman_res_t, rman_res_t, u_int); | ||||
void bus_generic_rl_delete_resource (device_t, device_t, int, int); | void bus_generic_rl_delete_resource (device_t, device_t, int, int); | ||||
int bus_generic_rl_get_resource (device_t, device_t, int, int, u_long *, | int bus_generic_rl_get_resource (device_t, device_t, int, int, rman_res_t *, | ||||
u_long *); | rman_res_t *); | ||||
int bus_generic_rl_set_resource (device_t, device_t, int, int, u_long, | int bus_generic_rl_set_resource (device_t, device_t, int, int, rman_res_t, | ||||
u_long); | rman_res_t); | ||||
int bus_generic_rl_release_resource (device_t, device_t, int, int, | int bus_generic_rl_release_resource (device_t, device_t, int, int, | ||||
struct resource *); | struct resource *); | ||||
Context not available. | |||||
struct resource **res); | struct resource **res); | ||||
int bus_adjust_resource(device_t child, int type, struct resource *r, | int bus_adjust_resource(device_t child, int type, struct resource *r, | ||||
u_long start, u_long end); | rman_res_t start, rman_res_t end); | ||||
struct resource *bus_alloc_resource(device_t dev, int type, int *rid, | struct resource *bus_alloc_resource(device_t dev, int type, int *rid, | ||||
u_long start, u_long end, u_long count, | rman_res_t start, rman_res_t end, | ||||
u_int flags); | rman_res_t count, u_int flags); | ||||
int bus_activate_resource(device_t dev, int type, int rid, | int bus_activate_resource(device_t dev, int type, int rid, | ||||
struct resource *r); | struct resource *r); | ||||
int bus_deactivate_resource(device_t dev, int type, int rid, | int bus_deactivate_resource(device_t dev, int type, int rid, | ||||
Context not available. | |||||
int bus_describe_intr(device_t dev, struct resource *irq, void *cookie, | int bus_describe_intr(device_t dev, struct resource *irq, void *cookie, | ||||
const char *fmt, ...); | const char *fmt, ...); | ||||
int bus_set_resource(device_t dev, int type, int rid, | int bus_set_resource(device_t dev, int type, int rid, | ||||
u_long start, u_long count); | rman_res_t start, rman_res_t count); | ||||
int bus_get_resource(device_t dev, int type, int rid, | int bus_get_resource(device_t dev, int type, int rid, | ||||
u_long *startp, u_long *countp); | rman_res_t *startp, rman_res_t *countp); | ||||
u_long bus_get_resource_start(device_t dev, int type, int rid); | rman_res_t bus_get_resource_start(device_t dev, int type, int rid); | ||||
u_long bus_get_resource_count(device_t dev, int type, int rid); | rman_res_t bus_get_resource_count(device_t dev, int type, int rid); | ||||
void bus_delete_resource(device_t dev, int type, int rid); | void bus_delete_resource(device_t dev, int type, int rid); | ||||
int bus_child_present(device_t child); | int bus_child_present(device_t child); | ||||
int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen); | int bus_child_pnpinfo_str(device_t child, char *buf, size_t buflen); | ||||
Context not available. | |||||
static __inline struct resource * | static __inline struct resource * | ||||
bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) | bus_alloc_resource_any(device_t dev, int type, int *rid, u_int flags) | ||||
{ | { | ||||
return (bus_alloc_resource(dev, type, rid, 0ul, ~0ul, 1, flags)); | return (bus_alloc_resource(dev, type, rid, 0, ~0, 1, flags)); | ||||
} | } | ||||
/* | /* | ||||
Context not available. |