mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
parent
5af4552511
commit
5936d00b5e
@ -15,6 +15,7 @@
|
||||
#include <base/attached_io_mem_dataspace.h>
|
||||
#include <base/attached_rom_dataspace.h>
|
||||
#include <base/log.h>
|
||||
#include <base/sleep.h>
|
||||
#include <util/misc_math.h>
|
||||
|
||||
#include <io_mem_session/connection.h>
|
||||
@ -31,8 +32,7 @@ extern "C" {
|
||||
#define FAIL(retval) \
|
||||
{ \
|
||||
Genode::error(__func__, ":", __LINE__, " called - dead"); \
|
||||
Genode::Lock lock; \
|
||||
while (1) lock.lock(); \
|
||||
while (1) Genode::sleep_forever(); \
|
||||
return retval; \
|
||||
}
|
||||
|
||||
|
@ -12,6 +12,7 @@
|
||||
*/
|
||||
|
||||
#include <base/log.h>
|
||||
#include <base/sleep.h>
|
||||
#include <util/misc_math.h>
|
||||
|
||||
#include <io_port_session/connection.h>
|
||||
@ -30,8 +31,7 @@ extern "C" {
|
||||
#define FAIL(retval) \
|
||||
{ \
|
||||
Genode::error(__func__, ":", __LINE__, " called - dead"); \
|
||||
Genode::Lock lock; \
|
||||
while (1) lock.lock(); \
|
||||
while (1) Genode::sleep_forever(); \
|
||||
return retval; \
|
||||
}
|
||||
|
||||
@ -56,26 +56,26 @@ void AcpiOsFree (void *ptr)
|
||||
|
||||
ACPI_STATUS AcpiOsCreateLock (ACPI_SPINLOCK *spin_lock)
|
||||
{
|
||||
*spin_lock = new (Acpica::heap()) Genode::Lock();
|
||||
*spin_lock = new (Acpica::heap()) Genode::Mutex();
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
ACPI_CPU_FLAGS AcpiOsAcquireLock (ACPI_SPINLOCK h)
|
||||
{
|
||||
Genode::Lock *lock = reinterpret_cast<Genode::Lock *>(h);
|
||||
lock->lock();
|
||||
Genode::Mutex *mutex = reinterpret_cast<Genode::Mutex *>(h);
|
||||
mutex->acquire();
|
||||
|
||||
return AE_OK;
|
||||
}
|
||||
|
||||
void AcpiOsReleaseLock (ACPI_SPINLOCK h, ACPI_CPU_FLAGS flags)
|
||||
{
|
||||
Genode::Lock *lock = reinterpret_cast<Genode::Lock *>(h);
|
||||
Genode::Mutex *mutex = reinterpret_cast<Genode::Mutex *>(h);
|
||||
|
||||
if (flags != AE_OK)
|
||||
Genode::warning("warning - unknown flags in ", __func__);
|
||||
|
||||
lock->unlock();
|
||||
mutex->release();
|
||||
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user