Deleted Added
full compact
OsdInterrupt.c (217240) OsdInterrupt.c (217241)
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * Copyright (c) 2011 Jung-uk Kim <jkim@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * SUCH DAMAGE.
27 */
28
29/*
30 * 6.5 : Interrupt handling
31 */
32
33#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2000 Michael Smith
3 * Copyright (c) 2000 BSDi
4 * Copyright (c) 2011 Jung-uk Kim <jkim@FreeBSD.org>
5 * All rights reserved.
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions

--- 17 unchanged lines hidden (view full) ---

26 * SUCH DAMAGE.
27 */
28
29/*
30 * 6.5 : Interrupt handling
31 */
32
33#include <sys/cdefs.h>
34__FBSDID("$FreeBSD: head/sys/dev/acpica/Osd/OsdInterrupt.c 217240 2011-01-10 21:01:41Z jkim $");
34__FBSDID("$FreeBSD: head/sys/dev/acpica/Osd/OsdInterrupt.c 217241 2011-01-10 21:09:38Z jkim $");
35
36#include <sys/param.h>
37#include <sys/kernel.h>
38#include <sys/bus.h>
39#include <sys/lock.h>
40#include <sys/malloc.h>
41#include <sys/mutex.h>
42#include <machine/bus.h>

--- 56 unchanged lines hidden (view full) ---

99 struct acpi_intr *ai, *ap;
100
101 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
102
103 sc = devclass_get_softc(devclass_find("acpi"), 0);
104 KASSERT(sc != NULL && sc->acpi_dev != NULL,
105 ("can't find ACPI device to register interrupt"));
106
35
36#include <sys/param.h>
37#include <sys/kernel.h>
38#include <sys/bus.h>
39#include <sys/lock.h>
40#include <sys/malloc.h>
41#include <sys/mutex.h>
42#include <machine/bus.h>

--- 56 unchanged lines hidden (view full) ---

99 struct acpi_intr *ai, *ap;
100
101 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
102
103 sc = devclass_get_softc(devclass_find("acpi"), 0);
104 KASSERT(sc != NULL && sc->acpi_dev != NULL,
105 ("can't find ACPI device to register interrupt"));
106
107 if (InterruptNumber < 0 || InterruptNumber > 255 ||
108 ServiceRoutine == NULL)
107 if (InterruptNumber > 255 || ServiceRoutine == NULL)
109 return_ACPI_STATUS (AE_BAD_PARAMETER);
110
111 ai = malloc(sizeof(*ai), M_ACPIINTR, M_WAITOK | M_ZERO);
112 mtx_lock(&acpi_intr_lock);
113 SLIST_FOREACH(ap, &acpi_intr_list, ai_link) {
114 if (InterruptNumber == ap->ai_number ||
115 (InterruptNumber == InterruptOverride &&
116 InterruptNumber != AcpiGbl_FADT.SciInterrupt)) {

--- 59 unchanged lines hidden (view full) ---

176 struct acpi_intr *ai;
177
178 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
179
180 sc = devclass_get_softc(devclass_find("acpi"), 0);
181 KASSERT(sc != NULL && sc->acpi_dev != NULL,
182 ("can't find ACPI device to deregister interrupt"));
183
108 return_ACPI_STATUS (AE_BAD_PARAMETER);
109
110 ai = malloc(sizeof(*ai), M_ACPIINTR, M_WAITOK | M_ZERO);
111 mtx_lock(&acpi_intr_lock);
112 SLIST_FOREACH(ap, &acpi_intr_list, ai_link) {
113 if (InterruptNumber == ap->ai_number ||
114 (InterruptNumber == InterruptOverride &&
115 InterruptNumber != AcpiGbl_FADT.SciInterrupt)) {

--- 59 unchanged lines hidden (view full) ---

175 struct acpi_intr *ai;
176
177 ACPI_FUNCTION_TRACE((char *)(uintptr_t)__func__);
178
179 sc = devclass_get_softc(devclass_find("acpi"), 0);
180 KASSERT(sc != NULL && sc->acpi_dev != NULL,
181 ("can't find ACPI device to deregister interrupt"));
182
184 if (InterruptNumber < 0 || InterruptNumber > 255 ||
185 ServiceRoutine == NULL)
183 if (InterruptNumber > 255 || ServiceRoutine == NULL)
186 return_ACPI_STATUS (AE_BAD_PARAMETER);
187 mtx_lock(&acpi_intr_lock);
188 SLIST_FOREACH(ai, &acpi_intr_list, ai_link)
189 if (InterruptNumber == ai->ai_number) {
190 if (ServiceRoutine != ai->ai_handler) {
191 mtx_unlock(&acpi_intr_lock);
192 return_ACPI_STATUS (AE_BAD_PARAMETER);
193 }

--- 24 unchanged lines hidden ---
184 return_ACPI_STATUS (AE_BAD_PARAMETER);
185 mtx_lock(&acpi_intr_lock);
186 SLIST_FOREACH(ai, &acpi_intr_list, ai_link)
187 if (InterruptNumber == ai->ai_number) {
188 if (ServiceRoutine != ai->ai_handler) {
189 mtx_unlock(&acpi_intr_lock);
190 return_ACPI_STATUS (AE_BAD_PARAMETER);
191 }

--- 24 unchanged lines hidden ---