Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/acpica/acpi_hpet.c
Show First 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | hpet_attach(device_t dev) | ||||
sc->mem_rid = 0; | sc->mem_rid = 0; | ||||
sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, | sc->mem_res = bus_alloc_resource_any(dev, SYS_RES_MEMORY, &sc->mem_rid, | ||||
RF_ACTIVE); | RF_ACTIVE); | ||||
if (sc->mem_res == NULL) | if (sc->mem_res == NULL) | ||||
return (ENOMEM); | return (ENOMEM); | ||||
/* Validate that we can access the whole region. */ | /* Validate that we can access the whole region. */ | ||||
if (rman_get_size(sc->mem_res) < HPET_MEM_WIDTH) { | if (rman_get_size(sc->mem_res) < HPET_MEM_WIDTH) { | ||||
device_printf(dev, "memory region width %ld too small\n", | device_printf(dev, "memory region width %jd too small\n", | ||||
rman_get_size(sc->mem_res)); | rman_get_size(sc->mem_res)); | ||||
bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res); | bus_free_resource(dev, SYS_RES_MEMORY, sc->mem_res); | ||||
return (ENXIO); | return (ENXIO); | ||||
} | } | ||||
/* Be sure timer is enabled. */ | /* Be sure timer is enabled. */ | ||||
hpet_enable(sc); | hpet_enable(sc); | ||||
▲ Show 20 Lines • Show All 487 Lines • Show Last 20 Lines |