Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/superio/superio.c
Show All 35 Lines | |||||
#include <sys/conf.h> | #include <sys/conf.h> | ||||
#include <sys/kernel.h> | #include <sys/kernel.h> | ||||
#include <sys/lock.h> | #include <sys/lock.h> | ||||
#include <sys/mutex.h> | #include <sys/mutex.h> | ||||
#include <sys/malloc.h> | #include <sys/malloc.h> | ||||
#include <sys/module.h> | #include <sys/module.h> | ||||
#include <sys/proc.h> | #include <sys/proc.h> | ||||
#include <sys/rman.h> | #include <sys/rman.h> | ||||
#include <sys/sbuf.h> | |||||
#include <sys/time.h> | #include <sys/time.h> | ||||
#include <machine/bus.h> | #include <machine/bus.h> | ||||
#include <machine/resource.h> | #include <machine/resource.h> | ||||
#include <machine/stdarg.h> | #include <machine/stdarg.h> | ||||
#include <isa/isavar.h> | #include <isa/isavar.h> | ||||
▲ Show 20 Lines • Show All 745 Lines • ▼ Show 20 Lines | if (resource_list_release_active(rl, dev, child, SYS_RES_IRQ) != 0) | ||||
superio_printf(dinfo, "Device leaked IRQ resources\n"); | superio_printf(dinfo, "Device leaked IRQ resources\n"); | ||||
if (resource_list_release_active(rl, dev, child, SYS_RES_MEMORY) != 0) | if (resource_list_release_active(rl, dev, child, SYS_RES_MEMORY) != 0) | ||||
superio_printf(dinfo, "Device leaked memory resources\n"); | superio_printf(dinfo, "Device leaked memory resources\n"); | ||||
if (resource_list_release_active(rl, dev, child, SYS_RES_IOPORT) != 0) | if (resource_list_release_active(rl, dev, child, SYS_RES_IOPORT) != 0) | ||||
superio_printf(dinfo, "Device leaked I/O resources\n"); | superio_printf(dinfo, "Device leaked I/O resources\n"); | ||||
} | } | ||||
static int | static int | ||||
superio_child_location_str(device_t parent, device_t child, char *buf, | superio_child_location(device_t parent, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
uint8_t ldn; | uint8_t ldn; | ||||
ldn = superio_get_ldn(child); | ldn = superio_get_ldn(child); | ||||
snprintf(buf, buflen, "ldn=0x%02x", ldn); | sbuf_printf(sb, "ldn=0x%02x", ldn); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
superio_child_pnp_str(device_t parent, device_t child, char *buf, | superio_child_pnp(device_t parent, device_t child, struct sbuf *sb) | ||||
size_t buflen) | |||||
{ | { | ||||
superio_dev_type_t type; | superio_dev_type_t type; | ||||
type = superio_get_type(child); | type = superio_get_type(child); | ||||
snprintf(buf, buflen, "type=%s", devtype_to_str(type)); | sbuf_printf(sb, "type=%s", devtype_to_str(type)); | ||||
return (0); | return (0); | ||||
} | } | ||||
static int | static int | ||||
superio_print_child(device_t parent, device_t child) | superio_print_child(device_t parent, device_t child) | ||||
{ | { | ||||
superio_dev_type_t type; | superio_dev_type_t type; | ||||
uint8_t ldn; | uint8_t ldn; | ||||
▲ Show 20 Lines • Show All 170 Lines • ▼ Show 20 Lines | static device_method_t superio_methods[] = { | ||||
DEVMETHOD(device_attach, superio_attach), | DEVMETHOD(device_attach, superio_attach), | ||||
DEVMETHOD(device_detach, superio_detach), | DEVMETHOD(device_detach, superio_detach), | ||||
DEVMETHOD(device_shutdown, bus_generic_shutdown), | DEVMETHOD(device_shutdown, bus_generic_shutdown), | ||||
DEVMETHOD(device_suspend, bus_generic_suspend), | DEVMETHOD(device_suspend, bus_generic_suspend), | ||||
DEVMETHOD(device_resume, bus_generic_resume), | DEVMETHOD(device_resume, bus_generic_resume), | ||||
DEVMETHOD(bus_add_child, superio_add_child), | DEVMETHOD(bus_add_child, superio_add_child), | ||||
DEVMETHOD(bus_child_detached, superio_child_detached), | DEVMETHOD(bus_child_detached, superio_child_detached), | ||||
DEVMETHOD(bus_child_location_str, superio_child_location_str), | DEVMETHOD(bus_child_location, superio_child_location), | ||||
DEVMETHOD(bus_child_pnpinfo_str, superio_child_pnp_str), | DEVMETHOD(bus_child_pnpinfo, superio_child_pnp), | ||||
DEVMETHOD(bus_print_child, superio_print_child), | DEVMETHOD(bus_print_child, superio_print_child), | ||||
DEVMETHOD(bus_read_ivar, superio_read_ivar), | DEVMETHOD(bus_read_ivar, superio_read_ivar), | ||||
DEVMETHOD(bus_write_ivar, superio_write_ivar), | DEVMETHOD(bus_write_ivar, superio_write_ivar), | ||||
DEVMETHOD(bus_get_resource_list, superio_get_resource_list), | DEVMETHOD(bus_get_resource_list, superio_get_resource_list), | ||||
DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), | DEVMETHOD(bus_alloc_resource, bus_generic_rl_alloc_resource), | ||||
DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), | DEVMETHOD(bus_release_resource, bus_generic_rl_release_resource), | ||||
DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), | DEVMETHOD(bus_set_resource, bus_generic_rl_set_resource), | ||||
DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), | DEVMETHOD(bus_get_resource, bus_generic_rl_get_resource), | ||||
Show All 17 Lines |