OsdInterrupt.c (79000) | OsdInterrupt.c (79386) |
---|---|
1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * | 1/*- 2 * Copyright (c) 2000 Michael Smith 3 * Copyright (c) 2000 BSDi 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions 8 * are met: --- 10 unchanged lines hidden (view full) --- 19 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 20 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 25 * SUCH DAMAGE. 26 * |
27 * $FreeBSD: head/sys/dev/acpica/Osd/OsdInterrupt.c 79000 2001-06-29 21:21:08Z msmith $ | 27 * $FreeBSD: head/sys/dev/acpica/Osd/OsdInterrupt.c 79386 2001-07-07 10:18:10Z msmith $ |
28 */ 29 30/* 31 * 6.5 : Interrupt handling 32 */ 33 34#include "acpi.h" 35 --- 16 unchanged lines hidden (view full) --- 52 */ 53ACPI_STATUS 54AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine, void *Context) 55{ 56 struct acpi_softc *sc; 57 58 FUNCTION_TRACE(__func__); 59 | 28 */ 29 30/* 31 * 6.5 : Interrupt handling 32 */ 33 34#include "acpi.h" 35 --- 16 unchanged lines hidden (view full) --- 52 */ 53ACPI_STATUS 54AcpiOsInstallInterruptHandler(UINT32 InterruptNumber, OSD_HANDLER ServiceRoutine, void *Context) 55{ 56 struct acpi_softc *sc; 57 58 FUNCTION_TRACE(__func__); 59 |
60 if ((sc = devclass_get_softc(acpi_devclass, 0)) == NULL) 61 panic("can't find ACPI device to register interrupt"); 62 if (sc->acpi_dev == NULL) 63 panic("acpi softc has invalid device"); 64 |
|
60 if ((InterruptNumber < 0) || (InterruptNumber > 255)) 61 return_ACPI_STATUS(AE_BAD_PARAMETER); 62 if (ServiceRoutine == NULL) 63 return_ACPI_STATUS(AE_BAD_PARAMETER); 64 if (InterruptHandler != NULL) { 65 device_printf(sc->acpi_dev, "can't register more than one ACPI interrupt\n"); 66 return_ACPI_STATUS(AE_BAD_PARAMETER); 67 } 68 InterruptHandler = ServiceRoutine; 69 | 65 if ((InterruptNumber < 0) || (InterruptNumber > 255)) 66 return_ACPI_STATUS(AE_BAD_PARAMETER); 67 if (ServiceRoutine == NULL) 68 return_ACPI_STATUS(AE_BAD_PARAMETER); 69 if (InterruptHandler != NULL) { 70 device_printf(sc->acpi_dev, "can't register more than one ACPI interrupt\n"); 71 return_ACPI_STATUS(AE_BAD_PARAMETER); 72 } 73 InterruptHandler = ServiceRoutine; 74 |
70 if ((sc = devclass_get_softc(acpi_devclass, 0)) == NULL) 71 panic("can't find ACPI device to register interrupt"); 72 if (sc->acpi_dev == NULL) 73 panic("acpi softc has invalid device"); 74 | |
75 /* 76 * This isn't strictly true, as we ought to be able to handle > 1 interrupt. The ACPI 77 * spec doesn't call for this though. 78 */ 79 if (sc->acpi_irq != NULL) { 80 device_printf(sc->acpi_dev, "attempt to register more than one interrupt handler\n"); 81 return_ACPI_STATUS(AE_EXIST); 82 } --- 53 unchanged lines hidden --- | 75 /* 76 * This isn't strictly true, as we ought to be able to handle > 1 interrupt. The ACPI 77 * spec doesn't call for this though. 78 */ 79 if (sc->acpi_irq != NULL) { 80 device_printf(sc->acpi_dev, "attempt to register more than one interrupt handler\n"); 81 return_ACPI_STATUS(AE_EXIST); 82 } --- 53 unchanged lines hidden --- |