diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-05-02 14:04:51 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2014-05-02 14:04:51 +0000 |
commit | 3e7a19816d5b0e13a3a4db7f79d88961edb7f6e0 (patch) | |
tree | 4e95293457e8c205dfe528e29a9d96d00b328643 /sys/dev | |
parent | 6f7d218b06590e1fd70c71c54876258f507633d7 (diff) |
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@
Diffstat (limited to 'sys/dev')
-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); |