Deleted Added
full compact
OsdSynch.c (153706) OsdSynch.c (167814)
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:

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

25 * SUCH DAMAGE.
26 */
27
28/*
29 * 6.1 : Mutual Exclusion and Synchronisation
30 */
31
32#include <sys/cdefs.h>
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:

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

25 * SUCH DAMAGE.
26 */
27
28/*
29 * 6.1 : Mutual Exclusion and Synchronisation
30 */
31
32#include <sys/cdefs.h>
33__FBSDID("$FreeBSD: head/sys/dev/acpica/Osd/OsdSynch.c 153706 2005-12-24 22:22:17Z trhodes $");
33__FBSDID("$FreeBSD: head/sys/dev/acpica/Osd/OsdSynch.c 167814 2007-03-22 18:16:43Z jkim $");
34
35#include <contrib/dev/acpica/acpi.h>
36
37#include "opt_acpi.h"
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40#include <sys/sysctl.h>
41#include <sys/lock.h>

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

57 struct mtx as_mtx;
58 UINT32 as_units;
59 UINT32 as_maxunits;
60 UINT32 as_pendings;
61 UINT32 as_resetting;
62 UINT32 as_timeouts;
63};
64
34
35#include <contrib/dev/acpica/acpi.h>
36
37#include "opt_acpi.h"
38#include <sys/kernel.h>
39#include <sys/malloc.h>
40#include <sys/sysctl.h>
41#include <sys/lock.h>

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

57 struct mtx as_mtx;
58 UINT32 as_units;
59 UINT32 as_maxunits;
60 UINT32 as_pendings;
61 UINT32 as_resetting;
62 UINT32 as_timeouts;
63};
64
65/* Default number of maximum pending threads. */
65#ifndef ACPI_NO_SEMAPHORES
66#ifndef ACPI_SEMAPHORES_MAX_PENDING
67#define ACPI_SEMAPHORES_MAX_PENDING 4
68#endif
66#ifndef ACPI_NO_SEMAPHORES
67#ifndef ACPI_SEMAPHORES_MAX_PENDING
68#define ACPI_SEMAPHORES_MAX_PENDING 4
69#endif
70
69static int acpi_semaphore_debug = 0;
70TUNABLE_INT("debug.acpi_semaphore_debug", &acpi_semaphore_debug);
71SYSCTL_DECL(_debug_acpi);
72SYSCTL_INT(_debug_acpi, OID_AUTO, semaphore_debug, CTLFLAG_RW,
73 &acpi_semaphore_debug, 0, "Enable ACPI semaphore debug messages");
74#endif /* !ACPI_NO_SEMAPHORES */
75
76ACPI_STATUS

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

190 break;
191 }
192 if (as->as_units >= Units) {
193 as->as_units -= Units;
194 result = AE_OK;
195 break;
196 }
197
71static int acpi_semaphore_debug = 0;
72TUNABLE_INT("debug.acpi_semaphore_debug", &acpi_semaphore_debug);
73SYSCTL_DECL(_debug_acpi);
74SYSCTL_INT(_debug_acpi, OID_AUTO, semaphore_debug, CTLFLAG_RW,
75 &acpi_semaphore_debug, 0, "Enable ACPI semaphore debug messages");
76#endif /* !ACPI_NO_SEMAPHORES */
77
78ACPI_STATUS

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

192 break;
193 }
194 if (as->as_units >= Units) {
195 as->as_units -= Units;
196 result = AE_OK;
197 break;
198 }
199
198 /* limit number of pending treads */
200 /* limit number of pending threads */
199 if (as->as_pendings >= ACPI_SEMAPHORES_MAX_PENDING) {
200 result = AE_TIME;
201 break;
202 }
203
204 /* if timeout values of zero is specified, return immediately */
205 if (Timeout == 0) {
206 result = AE_TIME;

--- 211 unchanged lines hidden ---
201 if (as->as_pendings >= ACPI_SEMAPHORES_MAX_PENDING) {
202 result = AE_TIME;
203 break;
204 }
205
206 /* if timeout values of zero is specified, return immediately */
207 if (Timeout == 0) {
208 result = AE_TIME;

--- 211 unchanged lines hidden ---