version 1.16, 2007/03/04 06:00:10 |
version 1.16.28.2, 2007/12/26 21:38:47 |
|
|
* 2. Redistributions in binary form must reproduce the above copyright |
* 2. Redistributions in binary form must reproduce the above copyright |
* notice, this list of conditions and the following disclaimer in the |
* notice, this list of conditions and the following disclaimer in the |
* documentation and/or other materials provided with the distribution. |
* documentation and/or other materials provided with the distribution. |
* 3. All advertising materials mentioning features or use of this software |
* 3. Neither the names of the authors nor the names of contributors |
* must display the following acknowledgement: |
|
* This product includes software developed by the University of |
|
* California, Berkeley and its contributors. |
|
* 4. Neither the name of the University nor the names of its contributors |
|
* may be used to endorse or promote products derived from this software |
* may be used to endorse or promote products derived from this software |
* without specific prior written permission. |
* without specific prior written permission. |
* |
* |
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND |
* THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS |
* OR SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
* OR SERVICES; LOSS OF MIND, USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) |
Line 52 __KERNEL_RCSID(0, "$NetBSD$"); |
|
Line 48 __KERNEL_RCSID(0, "$NetBSD$"); |
|
#include <sys/device.h> |
#include <sys/device.h> |
#include <sys/fcntl.h> |
#include <sys/fcntl.h> |
#include <sys/ioctl.h> |
#include <sys/ioctl.h> |
|
#include <sys/mutex.h> |
#ifdef __OpenBSD__ |
#ifdef __OpenBSD__ |
#include <sys/event.h> |
#include <sys/event.h> |
#endif |
#endif |
Line 87 struct apm_softc { |
|
Line 84 struct apm_softc { |
|
int sc_flags; |
int sc_flags; |
int event_count; |
int event_count; |
int event_ptr; |
int event_ptr; |
struct lock sc_lock; |
kmutex_t sc_lock; |
struct apm_event_info event_list[APM_NEVENTS]; |
struct apm_event_info event_list[APM_NEVENTS]; |
}; |
}; |
|
|
Line 98 struct apm_softc { |
|
Line 95 struct apm_softc { |
|
* user context. |
* user context. |
*/ |
*/ |
#ifdef __NetBSD__ |
#ifdef __NetBSD__ |
#define APM_LOCK(apmsc) \ |
#define APM_LOCK(apmsc) mutex_enter(&(apmsc)->sc_lock) |
(void) lockmgr(&(apmsc)->sc_lock, LK_EXCLUSIVE, NULL) |
#define APM_UNLOCK(apmsc) mutex_exit(&(apmsc)->sc_lock) |
#define APM_UNLOCK(apmsc) \ |
|
(void) lockmgr(&(apmsc)->sc_lock, LK_RELEASE, NULL) |
|
#else |
#else |
#define APM_LOCK(apmsc) |
#define APM_LOCK(apmsc) |
#define APM_UNLOCK(apmsc) |
#define APM_UNLOCK(apmsc) |
Line 198 apmattach(parent, self, aux) |
|
Line 193 apmattach(parent, self, aux) |
|
sc->sc_flags = 0; |
sc->sc_flags = 0; |
sc->event_ptr = 0; |
sc->event_ptr = 0; |
sc->event_count = 0; |
sc->event_count = 0; |
lockinit(&sc->sc_lock, PWAIT, "apmlk", 0, 0); |
mutex_init(&sc->sc_lock, MUTEX_DEFAULT, IPL_NONE); |
} |
} |
|
|
int |
int |