acpi_hpet.c (161211) | acpi_hpet.c (168010) |
---|---|
1/*- 2 * Copyright (c) 2005 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2005 Poul-Henning Kamp 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24 * SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_hpet.c 161211 2006-08-11 17:12:16Z des $"); | 28__FBSDID("$FreeBSD: head/sys/dev/acpica/acpi_hpet.c 168010 2007-03-28 22:28:48Z njl $"); |
29 30#include "opt_acpi.h" 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/rman.h> 36#include <sys/time.h> --- 112 unchanged lines hidden (view full) --- 149acpi_hpet_detach(device_t dev) 150{ 151 ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); 152 153 /* XXX Without a tc_remove() function, we can't detach. */ 154 return (EBUSY); 155} 156 | 29 30#include "opt_acpi.h" 31#include <sys/param.h> 32#include <sys/bus.h> 33#include <sys/kernel.h> 34#include <sys/module.h> 35#include <sys/rman.h> 36#include <sys/time.h> --- 112 unchanged lines hidden (view full) --- 149acpi_hpet_detach(device_t dev) 150{ 151 ACPI_FUNCTION_TRACE((char *)(uintptr_t) __func__); 152 153 /* XXX Without a tc_remove() function, we can't detach. */ 154 return (EBUSY); 155} 156 |
157static int 158acpi_hpet_resume(device_t dev) 159{ 160 struct acpi_hpet_softc *sc; 161 162 /* Re-enable the timer after a resume to keep the clock advancing. */ 163 sc = device_get_softc(dev); 164 bus_write_4(sc->mem_res, HPET_OFFSET_ENABLE, 1); 165 166 return (0); 167} 168 |
|
157/* Print some basic latency/rate information to assist in debugging. */ 158static void 159acpi_hpet_test(struct acpi_hpet_softc *sc) 160{ 161 int i; 162 uint32_t u1, u2; 163 struct bintime b0, b1, b2; 164 struct timespec ts; --- 18 unchanged lines hidden (view full) --- 183 device_printf(sc->dev, "time per call: %ld ns\n", ts.tv_nsec / 1000); 184} 185 186static device_method_t acpi_hpet_methods[] = { 187 /* Device interface */ 188 DEVMETHOD(device_probe, acpi_hpet_probe), 189 DEVMETHOD(device_attach, acpi_hpet_attach), 190 DEVMETHOD(device_detach, acpi_hpet_detach), | 169/* Print some basic latency/rate information to assist in debugging. */ 170static void 171acpi_hpet_test(struct acpi_hpet_softc *sc) 172{ 173 int i; 174 uint32_t u1, u2; 175 struct bintime b0, b1, b2; 176 struct timespec ts; --- 18 unchanged lines hidden (view full) --- 195 device_printf(sc->dev, "time per call: %ld ns\n", ts.tv_nsec / 1000); 196} 197 198static device_method_t acpi_hpet_methods[] = { 199 /* Device interface */ 200 DEVMETHOD(device_probe, acpi_hpet_probe), 201 DEVMETHOD(device_attach, acpi_hpet_attach), 202 DEVMETHOD(device_detach, acpi_hpet_detach), |
203 DEVMETHOD(device_resume, acpi_hpet_resume), |
|
191 192 {0, 0} 193}; 194 195static driver_t acpi_hpet_driver = { 196 "acpi_hpet", 197 acpi_hpet_methods, 198 sizeof(struct acpi_hpet_softc), 199}; 200 201static devclass_t acpi_hpet_devclass; 202 203DRIVER_MODULE(acpi_hpet, acpi, acpi_hpet_driver, acpi_hpet_devclass, 0, 0); 204MODULE_DEPEND(acpi_hpet, acpi, 1, 1, 1); | 204 205 {0, 0} 206}; 207 208static driver_t acpi_hpet_driver = { 209 "acpi_hpet", 210 acpi_hpet_methods, 211 sizeof(struct acpi_hpet_softc), 212}; 213 214static devclass_t acpi_hpet_devclass; 215 216DRIVER_MODULE(acpi_hpet, acpi, acpi_hpet_driver, acpi_hpet_devclass, 0, 0); 217MODULE_DEPEND(acpi_hpet, acpi, 1, 1, 1); |