core: use Mutex/Blockade

Issue #3612
This commit is contained in:
Alexander Boettcher
2020-02-18 15:29:47 +01:00
committed by Christian Helmuth
parent 85a1f91f59
commit e87d60ddf7
48 changed files with 218 additions and 232 deletions

View File

@@ -49,7 +49,7 @@ bool Hw::Address_space::insert_translation(addr_t virt, addr_t phys,
try {
for (;;) {
try {
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
_tt.insert_translation(virt, phys, size, flags, _tt_alloc);
return true;
} catch(Hw::Out_of_tables &) {
@@ -76,7 +76,7 @@ bool Hw::Address_space::lookup_translation(addr_t const virt, addr_t & phys)
void Hw::Address_space::flush(addr_t virt, size_t size, Core_local_addr)
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
try {
_tt.remove_translation(virt, size, _tt_alloc);

View File

@@ -72,7 +72,7 @@ class Hw::Address_space : public Genode::Address_space
using Table = Hw::Page_table;
using Array = Table::Allocator::Array<DEFAULT_TRANSLATION_TABLE_MAX>;
Genode::Lock _lock { }; /* table lock */
Genode::Mutex _mutex { }; /* table lock */
Table & _tt; /* table virt addr */
Genode::addr_t _tt_phys; /* table phys addr */
Array * _tt_array = nullptr;

View File

@@ -17,7 +17,7 @@
/* Genode includes */
#include <util/list.h>
#include <util/construct_at.h>
#include <base/lock.h>
#include <base/mutex.h>
#include <base/tslab.h>
#include <base/capability.h>
#include <base/log.h>
@@ -58,7 +58,7 @@ class Genode::Rpc_cap_factory
uint8_t _initial_slab_block[get_page_size()];
Slab _slab;
List<Kobject> _list { };
Lock _lock { };
Mutex _mutex { };
public:
@@ -69,7 +69,7 @@ class Genode::Rpc_cap_factory
~Rpc_cap_factory()
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
while (Kobject * obj = _list.first()) {
_list.remove(obj);
@@ -84,7 +84,7 @@ class Genode::Rpc_cap_factory
*/
Native_capability alloc(Native_capability ep)
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
/* allocate kernel object */
Kobject * obj;
@@ -106,7 +106,7 @@ class Genode::Rpc_cap_factory
void free(Native_capability cap)
{
Lock::Guard guard(_lock);
Mutex::Guard guard(_mutex);
for (Kobject * obj = _list.first(); obj; obj = obj->next()) {
if (obj->cap.data() == cap.data()) {