diff options
author | 2014-05-02 14:04:50 +0000 | |
---|---|---|
committer | 2014-05-02 14:04:50 +0000 | |
commit | 146f3dc6e737ef32113cf44c02abb98a14d47aff (patch) | |
tree | dfb8e1a0dfd5a86b12c78a95457fa4e3100277de | |
parent | 'for (part == 0; ...)' is not the same as 'for(part = 0; ...)'. (diff) | |
download | wireguard-openbsd-146f3dc6e737ef32113cf44c02abb98a14d47aff.tar.xz wireguard-openbsd-146f3dc6e737ef32113cf44c02abb98a14d47aff.zip |
Make acpi_mutex_acquire/release actually grab the global lock if it should.
Get rid of the fake global lock code that these functions were using before.
ok pirofti@, mlarkin@
-rw-r--r-- | sys/dev/acpi/dsdt.c | 14 |
1 files changed, 3 insertions, 11 deletions
diff --git a/sys/dev/acpi/dsdt.c b/sys/dev/acpi/dsdt.c index 6c29cd1078d..0fe6b80e01e 100644 --- a/sys/dev/acpi/dsdt.c +++ b/sys/dev/acpi/dsdt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dsdt.c,v 1.207 2014/04/26 21:45:50 kettenis Exp $ */ +/* $OpenBSD: dsdt.c,v 1.208 2014/05/02 14:04:50 kettenis Exp $ */ /* * Copyright (c) 2005 Jordan Hargrave <jordan@openbsd.org> * @@ -727,11 +727,7 @@ aml_delchildren(struct aml_node *node) void aml_unlockfield(struct aml_scope *, struct aml_value *); void aml_lockfield(struct aml_scope *, struct aml_value *); -long acpi_acquire_global_lock(void*); -long acpi_release_global_lock(void*); static long global_lock_count = 0; -#define acpi_acquire_global_lock(x) 1 -#define acpi_release_global_lock(x) 0 void acpi_glk_enter(void) @@ -2542,14 +2538,12 @@ int acpi_mutex_acquire(struct aml_scope *scope, struct aml_value *mtx, int timeout) { - int err; - if (mtx->v_mtx.owner == NULL || scope == mtx->v_mtx.owner) { /* We are now the owner */ mtx->v_mtx.owner = scope; if (mtx == aml_global_lock) { dnprintf(10,"LOCKING GLOBAL\n"); - err = acpi_acquire_global_lock(&acpi_softc->sc_facs->global_lock); + acpi_glk_enter(); } dnprintf(5,"%s acquires mutex %s\n", scope->node->name, mtx->node->name); @@ -2564,11 +2558,9 @@ acpi_mutex_acquire(struct aml_scope *scope, struct aml_value *mtx, void acpi_mutex_release(struct aml_scope *scope, struct aml_value *mtx) { - int err; - if (mtx == aml_global_lock) { dnprintf(10,"UNLOCKING GLOBAL\n"); - err=acpi_release_global_lock(&acpi_softc->sc_facs->global_lock); + acpi_glk_leave(); } dnprintf(5, "%s releases mutex %s\n", scope->node->name, mtx->node->name); |