From 468e7a825c8dad17338840f4a206fc3a17a40cae Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Wed, 7 Apr 2021 19:13:32 +0200 Subject: [PATCH] base/cache.h: rename Cache_attribute to Cache The short name is better because the type will become prominently visible at the API. Issue #2243 --- .../base-fiasco/src/core/include/ipc_pager.h | 3 +- repos/base-foc/src/core/include/ipc_pager.h | 22 ++++++------ repos/base-hw/src/core/pager.h | 12 +++---- .../base-hw/src/core/vm_session_component.cc | 3 +- repos/base-hw/src/include/hw/page_flags.h | 12 +++---- repos/base-hw/src/include/hw/spec/arm/lpae.h | 4 +-- .../src/include/hw/spec/x86_64/page_table.h | 4 +-- .../src/core/include/dataspace_component.h | 5 ++- .../core/include/io_mem_session_component.h | 6 ++-- .../core/spec/linux/dataspace_component.cc | 2 +- .../spec/linux/io_mem_session_component.cc | 2 +- .../src/core/spec/pc/dataspace_component.cc | 2 +- .../core/spec/pc/io_mem_session_component.cc | 2 +- repos/base-linux/src/core/stack_area.cc | 3 +- repos/base-nova/src/core/include/ipc_pager.h | 20 +++++------ repos/base-okl4/src/core/include/ipc_pager.h | 3 +- repos/base-okl4/src/core/pager.cc | 2 +- .../src/core/include/ipc_pager.h | 6 ++-- repos/base-pistachio/src/core/pager.cc | 5 ++- repos/base-sel4/src/core/include/ipc_pager.h | 33 +++++++++--------- repos/base-sel4/src/core/include/map_local.h | 2 +- repos/base-sel4/src/core/include/vm_space.h | 12 +++---- repos/base-sel4/src/core/platform_pd.cc | 2 +- repos/base-sel4/src/core/spec/arm/vm_space.cc | 2 +- .../src/core/spec/x86/vm_session_component.cc | 2 +- repos/base-sel4/src/core/spec/x86/vm_space.cc | 4 +-- repos/base-sel4/src/core/stack_area.cc | 2 +- .../include/base/attached_ram_dataspace.h | 10 +++--- repos/base/include/base/cache.h | 2 +- repos/base/include/base/ram_allocator.h | 13 ++++--- repos/base/include/pd_session/client.h | 5 ++- repos/base/include/pd_session/pd_session.h | 2 +- .../src/core/include/dataspace_component.h | 12 +++---- .../core/include/io_mem_session_component.h | 12 +++---- .../src/core/include/pd_session_component.h | 2 +- .../src/core/include/ram_dataspace_factory.h | 2 +- .../src/core/include/synced_ram_allocator.h | 4 +-- repos/base/src/core/pd_session_component.cc | 4 +-- repos/base/src/core/ram_dataspace_factory.cc | 4 +-- repos/base/src/core/stack_area.cc | 2 +- .../internal/expanding_pd_session_client.h | 4 +-- .../src/drivers/framebuffer/imx8/lx_emul.cc | 2 +- .../src/drivers/framebuffer/imx8/platform.cc | 4 +-- .../dde_linux/src/drivers/nic/fec/platform.cc | 4 +-- .../drivers/usb/spec/arm/platform_generic.cc | 4 +-- .../dde_linux/src/drivers/usb_hid/lx_emul.cc | 13 +++++-- .../src/drivers/usb_host/spec/arm/platform.cc | 3 +- .../src/drivers/usb_modem/lx_emul.cc | 7 ++-- .../dde_linux/src/drivers/usb_net/lx_emul.cc | 7 ++-- .../dde_linux/src/include/lx_emul/impl/gfp.h | 8 ++--- .../src/include/lx_kit/backend_alloc.h | 3 +- .../src/include/lx_kit/internal/pci_dev.h | 5 ++- .../src/include/lx_kit/mapped_io_mem_range.h | 2 +- .../src/include/lx_kit/pci_dev_registry.h | 10 +++--- repos/dde_linux/src/lib/lxip/lxcc_emul.cc | 2 +- repos/dde_linux/src/lib/wifi/lx.h | 2 +- repos/dde_linux/src/lx_kit/malloc.cc | 16 ++++----- .../src/lx_kit/mapped_io_mem_range.cc | 6 ++-- repos/dde_linux/src/lx_kit/pci.cc | 4 +-- .../dde_rump/src/include/util/allocator_fap.h | 11 +++--- .../lib/libc/internal/malloc_ram_allocator.h | 4 +-- repos/os/include/nic/component.h | 34 +++++++++---------- repos/os/include/platform_device/device.h | 3 +- .../include/spec/arm/platform_device/client.h | 10 ++---- .../arm/platform_device/platform_device.h | 5 ++- .../include/spec/x86/platform_device/client.h | 4 +-- .../x86/platform_device/platform_device.h | 2 +- .../src/drivers/platform/spec/arm/device.cc | 5 ++- .../os/src/drivers/platform/spec/arm/device.h | 2 +- .../platform/spec/arm/device_component.cc | 4 +-- .../platform/spec/arm/device_component.h | 2 +- .../platform/spec/x86/nonpci_devices.cc | 2 +- .../drivers/platform/spec/x86/pci_device.cc | 8 ++--- .../platform/spec/x86/pci_device_component.h | 2 +- repos/os/src/server/nic_router/session_env.h | 4 +-- .../app/gdb_monitor/pd_session_component.h | 4 +-- 76 files changed, 226 insertions(+), 237 deletions(-) diff --git a/repos/base-fiasco/src/core/include/ipc_pager.h b/repos/base-fiasco/src/core/include/ipc_pager.h index b0cca99ecc..c8ce0ab198 100644 --- a/repos/base-fiasco/src/core/include/ipc_pager.h +++ b/repos/base-fiasco/src/core/include/ipc_pager.h @@ -49,8 +49,7 @@ class Genode::Mapping /** * Constructor */ - Mapping(addr_t dst_addr, addr_t src_addr, - Cache_attribute cacheability, bool, + Mapping(addr_t dst_addr, addr_t src_addr, Cache cacheability, bool, unsigned l2size, bool rw, bool) : _dst_addr(dst_addr), diff --git a/repos/base-foc/src/core/include/ipc_pager.h b/repos/base-foc/src/core/include/ipc_pager.h index de3e1a8433..44c0e69c2a 100644 --- a/repos/base-foc/src/core/include/ipc_pager.h +++ b/repos/base-foc/src/core/include/ipc_pager.h @@ -42,21 +42,20 @@ class Genode::Mapping { private: - addr_t _dst_addr; + addr_t _dst_addr; Foc::l4_fpage_t _fpage { }; - Cache_attribute _cacheability; - bool _iomem; + Cache _cacheability; + bool _iomem; public: /** * Constructor */ - Mapping(addr_t dst_addr, addr_t src_addr, - Cache_attribute c, bool io_mem, + Mapping(addr_t dst_addr, addr_t src_addr, Cache cache, bool io_mem, unsigned log2size, bool write, bool executable) : - _dst_addr(dst_addr), _cacheability(c), _iomem(io_mem) + _dst_addr(dst_addr), _cacheability(cache), _iomem(io_mem) { typedef Foc::L4_fpage_rights Rights; Rights rights = ( write && executable) ? Foc::L4_FPAGE_RWX : @@ -73,11 +72,12 @@ class Genode::Mapping Mapping() : _dst_addr(0), _fpage(Foc::l4_fpage_invalid()), _cacheability(UNCACHED), _iomem(false) { } - Foc::l4_umword_t dst_addr() const { return _dst_addr; } - bool grant() const { return false; } - Foc::l4_fpage_t fpage() const { return _fpage; } - Cache_attribute cacheability() const { return _cacheability; } - bool iomem() const { return _iomem; } + Foc::l4_umword_t dst_addr() const { return _dst_addr; } + bool grant() const { return false; } + Foc::l4_fpage_t fpage() const { return _fpage; } + Cache cacheability() const { return _cacheability; } + bool iomem() const { return _iomem; } + /** * Prepare map operation is not needed on Fiasco.OC, since we clear the * dataspace before this function is called. diff --git a/repos/base-hw/src/core/pager.h b/repos/base-hw/src/core/pager.h index e7648bf89b..4adfd8c368 100644 --- a/repos/base-hw/src/core/pager.h +++ b/repos/base-hw/src/core/pager.h @@ -60,13 +60,13 @@ struct Genode::Mapping : Hw::Mapping { Mapping() {} - Mapping(addr_t virt, - addr_t phys, - Cache_attribute cacheable, - bool io, + Mapping(addr_t virt, + addr_t phys, + Cache cacheable, + bool io, unsigned size_log2, - bool writeable, - bool executable) + bool writeable, + bool executable) : Hw::Mapping(phys, virt, 1 << size_log2, { writeable ? Hw::RW : Hw::RO, diff --git a/repos/base-hw/src/core/vm_session_component.cc b/repos/base-hw/src/core/vm_session_component.cc index bc72bd29ce..aaf9bc2ba8 100644 --- a/repos/base-hw/src/core/vm_session_component.cc +++ b/repos/base-hw/src/core/vm_session_component.cc @@ -65,8 +65,7 @@ Capability Vm_session_component::create_vcpu(Thread_cap Vcpu & vcpu = *_vcpus[_vcpu_id_alloc]; try { - vcpu.ds_cap = _constrained_md_ram_alloc.alloc(_ds_size(), - Cache_attribute::UNCACHED); + vcpu.ds_cap = _constrained_md_ram_alloc.alloc(_ds_size(), Cache::UNCACHED); vcpu.ds_addr = _region_map.attach(vcpu.ds_cap); } catch (...) { if (vcpu.ds_cap.valid()) diff --git a/repos/base-hw/src/include/hw/page_flags.h b/repos/base-hw/src/include/hw/page_flags.h index a427d67bd8..0622577f90 100644 --- a/repos/base-hw/src/include/hw/page_flags.h +++ b/repos/base-hw/src/include/hw/page_flags.h @@ -31,12 +31,12 @@ namespace Hw { struct Hw::Page_flags { - Writeable writeable; - Executeable executable; - Privileged privileged; - Global global; - Type type; - Genode::Cache_attribute cacheable; + Writeable writeable; + Executeable executable; + Privileged privileged; + Global global; + Type type; + Genode::Cache cacheable; void print(Genode::Output & out) const { diff --git a/repos/base-hw/src/include/hw/spec/arm/lpae.h b/repos/base-hw/src/include/hw/spec/arm/lpae.h index 0e41b0eda4..a5d5ed90bb 100644 --- a/repos/base-hw/src/include/hw/spec/arm/lpae.h +++ b/repos/base-hw/src/include/hw/spec/arm/lpae.h @@ -199,8 +199,8 @@ class Hw::Long_translation_table struct Attribute_index : Base::template Bitfield<2, 3> { enum { - UNCACHED = Genode::Cache_attribute::UNCACHED, - CACHED = Genode::Cache_attribute::CACHED, + UNCACHED = Genode::Cache::UNCACHED, + CACHED = Genode::Cache::CACHED, DEVICE }; diff --git a/repos/base-hw/src/include/hw/spec/x86_64/page_table.h b/repos/base-hw/src/include/hw/spec/x86_64/page_table.h index 6094ee61dc..52f6b3b983 100644 --- a/repos/base-hw/src/include/hw/spec/x86_64/page_table.h +++ b/repos/base-hw/src/include/hw/spec/x86_64/page_table.h @@ -122,7 +122,7 @@ class Hw::Level_4_translation_table static access_t create(Page_flags const &flags, addr_t const pa) { - bool const wc = flags.cacheable == Genode::Cache_attribute::WRITE_COMBINED; + bool const wc = flags.cacheable == Genode::Cache::WRITE_COMBINED; return Common::create(flags) | G::bits(flags.global) @@ -303,7 +303,7 @@ class Hw::Page_directory static typename Base::access_t create(Page_flags const &flags, addr_t const pa) { - bool const wc = flags.cacheable == Genode::Cache_attribute::WRITE_COMBINED; + bool const wc = flags.cacheable == Genode::Cache::WRITE_COMBINED; return Base::create(flags) | Base::Ps::bits(1) diff --git a/repos/base-linux/src/core/include/dataspace_component.h b/repos/base-linux/src/core/include/dataspace_component.h index 7da61ae367..5b4395363c 100644 --- a/repos/base-linux/src/core/include/dataspace_component.h +++ b/repos/base-linux/src/core/include/dataspace_component.h @@ -74,8 +74,7 @@ class Genode::Dataspace_component : public Rpc_object /** * Constructor */ - Dataspace_component(size_t size, addr_t addr, - Cache_attribute, bool writable, + Dataspace_component(size_t size, addr_t addr, Cache, bool writable, Dataspace_owner * owner) : _size(size), _addr(addr), _cap(), _writable(writable), _owner(owner) @@ -94,7 +93,7 @@ class Genode::Dataspace_component : public Rpc_object * reasons and should not be used. */ Dataspace_component(size_t size, addr_t, addr_t phys_addr, - Cache_attribute, bool writable, Dataspace_owner *_owner); + Cache, bool writable, Dataspace_owner *_owner); /** * This constructor is especially used for ROM dataspaces diff --git a/repos/base-linux/src/core/include/io_mem_session_component.h b/repos/base-linux/src/core/include/io_mem_session_component.h index 9a37b70440..5c8c2bf2f2 100644 --- a/repos/base-linux/src/core/include/io_mem_session_component.h +++ b/repos/base-linux/src/core/include/io_mem_session_component.h @@ -34,9 +34,9 @@ class Genode::Io_mem_session_component : public Rpc_object Rpc_entrypoint &_ds_ep; Io_mem_dataspace_capability _ds_cap; - size_t get_arg_size(const char *); - addr_t get_arg_phys(const char *); - Cache_attribute get_arg_wc(const char *); + size_t get_arg_size(char const *); + addr_t get_arg_phys(char const *); + Cache get_arg_wc (char const *); public: diff --git a/repos/base-linux/src/core/spec/linux/dataspace_component.cc b/repos/base-linux/src/core/spec/linux/dataspace_component.cc index 72654cf02c..db49d21187 100644 --- a/repos/base-linux/src/core/spec/linux/dataspace_component.cc +++ b/repos/base-linux/src/core/spec/linux/dataspace_component.cc @@ -73,7 +73,7 @@ Dataspace_component::Dataspace_component(const char *args) Dataspace_component::Dataspace_component(size_t size, addr_t, addr_t phys_addr, - Cache_attribute, bool, Dataspace_owner *_owner) + Cache, bool, Dataspace_owner *_owner) : _size(size), _addr(phys_addr), _cap(), _writable(false), _owner(_owner) { diff --git a/repos/base-linux/src/core/spec/linux/io_mem_session_component.cc b/repos/base-linux/src/core/spec/linux/io_mem_session_component.cc index d871cc0db8..244ece4d86 100644 --- a/repos/base-linux/src/core/spec/linux/io_mem_session_component.cc +++ b/repos/base-linux/src/core/spec/linux/io_mem_session_component.cc @@ -53,7 +53,7 @@ Io_mem_session_component::Io_mem_session_component(Range_allocator &io_mem_alloc } -Cache_attribute Io_mem_session_component::get_arg_wc(const char *) +Cache Io_mem_session_component::get_arg_wc(const char *) { warning(__func__, " not implemented"); return UNCACHED; diff --git a/repos/base-linux/src/core/spec/pc/dataspace_component.cc b/repos/base-linux/src/core/spec/pc/dataspace_component.cc index 9a314a8966..18e810f90f 100644 --- a/repos/base-linux/src/core/spec/pc/dataspace_component.cc +++ b/repos/base-linux/src/core/spec/pc/dataspace_component.cc @@ -72,7 +72,7 @@ Dataspace_component::Dataspace_component(const char *args) Dataspace_component::Dataspace_component(size_t size, addr_t, addr_t phys_addr, - Cache_attribute, bool writable, Dataspace_owner *_owner) + Cache, bool writable, Dataspace_owner *_owner) : _size(size), _addr(phys_addr), _cap(), _writable(writable), _owner(_owner) { diff --git a/repos/base-linux/src/core/spec/pc/io_mem_session_component.cc b/repos/base-linux/src/core/spec/pc/io_mem_session_component.cc index 89b0346d33..3dcaeef938 100644 --- a/repos/base-linux/src/core/spec/pc/io_mem_session_component.cc +++ b/repos/base-linux/src/core/spec/pc/io_mem_session_component.cc @@ -40,7 +40,7 @@ addr_t Io_mem_session_component::get_arg_phys(const char *args) } -Cache_attribute Io_mem_session_component::get_arg_wc(const char *args) +Cache Io_mem_session_component::get_arg_wc(const char *args) { Arg const a = Arg_string::find_arg("wc", args); if (a.valid() && a.bool_value(0)) { diff --git a/repos/base-linux/src/core/stack_area.cc b/repos/base-linux/src/core/stack_area.cc index fc1d6cf1f1..261fd045d5 100644 --- a/repos/base-linux/src/core/stack_area.cc +++ b/repos/base-linux/src/core/stack_area.cc @@ -79,8 +79,7 @@ class Stack_area_region_map : public Genode::Region_map struct Stack_area_ram_allocator : Genode::Ram_allocator { - Genode::Ram_dataspace_capability alloc(Genode::size_t, - Genode::Cache_attribute) override { + Genode::Ram_dataspace_capability alloc(Genode::size_t, Genode::Cache) override { return Genode::Ram_dataspace_capability(); } void free(Genode::Ram_dataspace_capability) override { } diff --git a/repos/base-nova/src/core/include/ipc_pager.h b/repos/base-nova/src/core/include/ipc_pager.h index 9c113ec3ed..f8ce96d210 100644 --- a/repos/base-nova/src/core/include/ipc_pager.h +++ b/repos/base-nova/src/core/include/ipc_pager.h @@ -31,9 +31,9 @@ class Genode::Mapping { private: - addr_t const _dst_addr; - Cache_attribute const _attr; - Nova::Mem_crd const _mem_crd; + addr_t const _dst_addr; + Cache const _cache; + Nova::Mem_crd const _mem_crd; enum { PAGE_SIZE_LOG2 = 12 }; @@ -43,12 +43,12 @@ class Genode::Mapping * Constructor */ Mapping(addr_t dst_addr, addr_t source_addr, - Cache_attribute c, bool /* io_mem */, + Cache cache, bool /* io_mem */, unsigned size_log2, bool writeable, bool executable) : _dst_addr(dst_addr), - _attr(c), + _cache(cache), _mem_crd(source_addr >> PAGE_SIZE_LOG2, size_log2 - PAGE_SIZE_LOG2, Nova::Rights(true, writeable, executable)) @@ -56,12 +56,10 @@ class Genode::Mapping void prepare_map_operation() { } - Nova::Mem_crd mem_crd() const { return _mem_crd; } - - bool dma() { return _attr != CACHED; }; - bool write_combined() { return _attr == WRITE_COMBINED; }; - - addr_t dst_addr() { return _dst_addr; } + Nova::Mem_crd mem_crd() const { return _mem_crd; } + bool dma() const { return _cache != CACHED; }; + bool write_combined() const { return _cache == WRITE_COMBINED; }; + addr_t dst_addr() const { return _dst_addr; } }; diff --git a/repos/base-okl4/src/core/include/ipc_pager.h b/repos/base-okl4/src/core/include/ipc_pager.h index 8f58a682ad..0558e62cfd 100644 --- a/repos/base-okl4/src/core/include/ipc_pager.h +++ b/repos/base-okl4/src/core/include/ipc_pager.h @@ -41,8 +41,7 @@ class Genode::Mapping /** * Constructor */ - Mapping(addr_t dst_addr, addr_t src_addr, - Cache_attribute cacheability, bool io_mem, + Mapping(addr_t dst_addr, addr_t src_addr, Cache, bool io_mem, unsigned l2size, bool rw, bool executable); /** diff --git a/repos/base-okl4/src/core/pager.cc b/repos/base-okl4/src/core/pager.cc index bf63c1d9b2..fdcbd44429 100644 --- a/repos/base-okl4/src/core/pager.cc +++ b/repos/base-okl4/src/core/pager.cc @@ -65,7 +65,7 @@ static inline L4_ThreadId_t thread_get_my_global_id() ** Mapping ** *************/ -Mapping::Mapping(addr_t dst_addr, addr_t src_addr, Cache_attribute, bool, +Mapping::Mapping(addr_t dst_addr, addr_t src_addr, Cache, bool, unsigned l2size, bool rw, bool) : _fpage(L4_FpageLog2(dst_addr, l2size)), diff --git a/repos/base-pistachio/src/core/include/ipc_pager.h b/repos/base-pistachio/src/core/include/ipc_pager.h index 4b88daf3ee..cfa47b85d8 100644 --- a/repos/base-pistachio/src/core/include/ipc_pager.h +++ b/repos/base-pistachio/src/core/include/ipc_pager.h @@ -47,10 +47,8 @@ class Genode::Mapping /** * Constructor */ - Mapping(addr_t dst_addr, addr_t src_addr, - Cache_attribute, bool io_mem, - unsigned l2size, - bool rw, bool executable); + Mapping(addr_t dst_addr, addr_t src_addr, Cache, bool io_mem, + unsigned l2size, bool rw, bool executable); /** * Construct invalid mapping diff --git a/repos/base-pistachio/src/core/pager.cc b/repos/base-pistachio/src/core/pager.cc index 7da7790f57..4d2a150ca6 100644 --- a/repos/base-pistachio/src/core/pager.cc +++ b/repos/base-pistachio/src/core/pager.cc @@ -32,9 +32,8 @@ using namespace Pistachio; ** Mapping ** *************/ -Mapping::Mapping(addr_t dst_addr, addr_t src_addr, - Cache_attribute, bool, unsigned l2size, - bool rw, bool) +Mapping::Mapping(addr_t dst_addr, addr_t src_addr, Cache, bool, + unsigned l2size, bool rw, bool) { bool const grant = false; diff --git a/repos/base-sel4/src/core/include/ipc_pager.h b/repos/base-sel4/src/core/include/ipc_pager.h index ddfa5ffc5f..dafd608208 100644 --- a/repos/base-sel4/src/core/include/ipc_pager.h +++ b/repos/base-sel4/src/core/include/ipc_pager.h @@ -30,13 +30,13 @@ class Genode::Mapping private: - addr_t _from_phys_addr { 0 }; - addr_t _to_virt_addr { 0 }; - Cache_attribute _attr { CACHED }; - size_t _num_pages { 0 }; - addr_t _fault_type { 0 }; - bool _writeable { false }; - bool _executable { false }; + addr_t _from_phys_addr { 0 }; + addr_t _to_virt_addr { 0 }; + Cache _cache { CACHED }; + size_t _num_pages { 0 }; + addr_t _fault_type { 0 }; + bool _writeable { false }; + bool _executable { false }; enum { PAGE_SIZE_LOG2 = 12 }; @@ -45,13 +45,12 @@ class Genode::Mapping /** * Constructor */ - Mapping(addr_t dst_addr, addr_t src_addr, - Cache_attribute const cacheability, bool, + Mapping(addr_t dst_addr, addr_t src_addr, Cache const cache, bool, unsigned l2size, bool rw, bool executable) : _from_phys_addr(src_addr), _to_virt_addr(dst_addr), - _attr(cacheability), + _cache(cache), _num_pages(1 << (l2size - PAGE_SIZE_LOG2)), _writeable(rw), _executable(executable) { } @@ -69,13 +68,13 @@ class Genode::Mapping */ void prepare_map_operation() { } - addr_t from_phys() const { return _from_phys_addr; } - addr_t to_virt() const { return _to_virt_addr; } - size_t num_pages() const { return _num_pages; } - bool writeable() const { return _writeable; } - bool executable() const { return _executable; } - Cache_attribute cacheability() const { return _attr; } - addr_t fault_type() const { return _fault_type; } + addr_t from_phys() const { return _from_phys_addr; } + addr_t to_virt() const { return _to_virt_addr; } + size_t num_pages() const { return _num_pages; } + bool writeable() const { return _writeable; } + bool executable() const { return _executable; } + Cache cacheability() const { return _cache; } + addr_t fault_type() const { return _fault_type; } }; diff --git a/repos/base-sel4/src/core/include/map_local.h b/repos/base-sel4/src/core/include/map_local.h index ce43051b81..a7f993a9d3 100644 --- a/repos/base-sel4/src/core/include/map_local.h +++ b/repos/base-sel4/src/core/include/map_local.h @@ -40,7 +40,7 @@ namespace Genode { try { platform = platform ? platform : &platform_specific(); platform->core_vm_space().map(from_phys, to_virt, num_pages, - Cache_attribute::CACHED, + Cache::CACHED, WRITEABLE, NON_EXECUTABLE, DONT_FLUSH); } catch (Page_table_registry::Mapping_cache_full) { diff --git a/repos/base-sel4/src/core/include/vm_space.h b/repos/base-sel4/src/core/include/vm_space.h index 884ee6af95..08f59796bf 100644 --- a/repos/base-sel4/src/core/include/vm_space.h +++ b/repos/base-sel4/src/core/include/vm_space.h @@ -182,7 +182,7 @@ class Genode::Vm_space template bool _map_frame(addr_t const from_phys, addr_t const to_dest, - Cache_attribute const cacheability, + Cache const cacheability, bool const writable, bool const executable, bool const flush_support, bool guest, FN const &fn) { @@ -242,9 +242,9 @@ class Genode::Vm_space /** * Platform specific map/unmap of a page frame */ - long _map_page(Genode::Cap_sel const &idx, Genode::addr_t const virt, - Cache_attribute const cacheability, bool const write, - bool const writable, bool guest); + long _map_page(Genode::Cap_sel const &idx, addr_t virt, + Cache cacheability, bool const write, + bool writable, bool guest); long _unmap_page(Genode::Cap_sel const &idx); long _invalidate_page(Genode::Cap_sel const &, seL4_Word const, seL4_Word const); @@ -380,7 +380,7 @@ class Genode::Vm_space } bool map(addr_t const from_phys, addr_t const to_virt, - size_t const num_pages, Cache_attribute const cacheability, + size_t const num_pages, Cache const cacheability, bool const writable, bool const executable, bool flush_support) { auto fn_unmap = [&] (Cap_sel const &idx, addr_t const v_addr) @@ -430,7 +430,7 @@ class Genode::Vm_space } void map_guest(addr_t const from_phys, addr_t const guest_phys, - size_t const num_pages, Cache_attribute const cacheability, + size_t const num_pages, Cache const cacheability, bool const writable, bool const executable, bool flush_support) { auto fn_unmap = [&] (Cap_sel const &idx, addr_t const) { diff --git a/repos/base-sel4/src/core/platform_pd.cc b/repos/base-sel4/src/core/platform_pd.cc index 29fa7a3077..a0e39ab36a 100644 --- a/repos/base-sel4/src/core/platform_pd.cc +++ b/repos/base-sel4/src/core/platform_pd.cc @@ -101,7 +101,7 @@ bool Platform_pd::bind_thread(Platform_thread &thread) enum { WRITABLE = true, ONE_PAGE = 1, FLUSHABLE = true, NON_EXECUTABLE = false }; _vm_space.alloc_page_tables(utcb, get_page_size()); _vm_space.map(thread._info.ipc_buffer_phys, utcb, ONE_PAGE, - Cache_attribute::CACHED, WRITABLE, NON_EXECUTABLE, FLUSHABLE); + Cache::CACHED, WRITABLE, NON_EXECUTABLE, FLUSHABLE); return true; } diff --git a/repos/base-sel4/src/core/spec/arm/vm_space.cc b/repos/base-sel4/src/core/spec/arm/vm_space.cc index 8a25313b9e..3cf9835fa0 100644 --- a/repos/base-sel4/src/core/spec/arm/vm_space.cc +++ b/repos/base-sel4/src/core/spec/arm/vm_space.cc @@ -26,7 +26,7 @@ static long map_page_table(Genode::Cap_sel const pagetable, long Genode::Vm_space::_map_page(Genode::Cap_sel const &idx, Genode::addr_t const virt, - Cache_attribute const cacheability, + Cache const cacheability, bool const writable, bool const executable, bool) diff --git a/repos/base-sel4/src/core/spec/x86/vm_session_component.cc b/repos/base-sel4/src/core/spec/x86/vm_session_component.cc index 4498b71bdc..82e67af55b 100644 --- a/repos/base-sel4/src/core/spec/x86/vm_session_component.cc +++ b/repos/base-sel4/src/core/spec/x86/vm_session_component.cc @@ -54,7 +54,7 @@ Vm_session_component::Vcpu::Vcpu(Rpc_entrypoint &ep, _ep(ep), _ram_alloc(ram_alloc), _ds_cap (_ram_alloc.alloc(align_addr(sizeof(Genode::Vcpu_state), 12), - Cache_attribute::CACHED)) + Cache::CACHED)) { try { /* notification cap */ diff --git a/repos/base-sel4/src/core/spec/x86/vm_space.cc b/repos/base-sel4/src/core/spec/x86/vm_space.cc index 2d75d54174..0527e72a5a 100644 --- a/repos/base-sel4/src/core/spec/x86/vm_space.cc +++ b/repos/base-sel4/src/core/spec/x86/vm_space.cc @@ -15,8 +15,8 @@ #include long Genode::Vm_space::_map_page(Genode::Cap_sel const &idx, - Genode::addr_t const virt, - Cache_attribute const cacheability, + Genode::addr_t const virt, + Cache const cacheability, bool const writable, bool const, bool ept) { diff --git a/repos/base-sel4/src/core/stack_area.cc b/repos/base-sel4/src/core/stack_area.cc index 8ce9e45553..93bceb735c 100644 --- a/repos/base-sel4/src/core/stack_area.cc +++ b/repos/base-sel4/src/core/stack_area.cc @@ -114,7 +114,7 @@ class Stack_area_region_map : public Region_map struct Stack_area_ram_allocator : Ram_allocator { - Ram_dataspace_capability alloc(size_t, Cache_attribute) override { + Ram_dataspace_capability alloc(size_t, Cache) override { return reinterpret_cap_cast(Native_capability()); } void free(Ram_dataspace_capability) override { diff --git a/repos/base/include/base/attached_ram_dataspace.h b/repos/base/include/base/attached_ram_dataspace.h index ec3125d5e6..10f1026cc8 100644 --- a/repos/base/include/base/attached_ram_dataspace.h +++ b/repos/base/include/base/attached_ram_dataspace.h @@ -39,7 +39,7 @@ class Genode::Attached_ram_dataspace Region_map *_rm = nullptr; Ram_dataspace_capability _ds { }; void *_local_addr = nullptr; - Cache_attribute const _cached = CACHED; + Cache const _cache = CACHED; template static void _swap(T &v1, T &v2) { T tmp = v1; v1 = v2; v2 = tmp; } @@ -58,7 +58,7 @@ class Genode::Attached_ram_dataspace if (!_size) return; try { - _ds = _ram->alloc(_size, _cached); + _ds = _ram->alloc(_size, _cache); _local_addr = _rm->attach(_ds); } /* revert allocation if attaching the dataspace failed */ @@ -75,7 +75,7 @@ class Genode::Attached_ram_dataspace * work-around for this issues, we eagerly map the whole * dataspace before writing actual content to it. */ - if (_cached != CACHED) { + if (_cache != CACHED) { enum { PAGE_SIZE = 4096 }; unsigned char volatile *base = (unsigned char volatile *)_local_addr; for (size_t i = 0; i < _size; i += PAGE_SIZE) @@ -100,9 +100,9 @@ class Genode::Attached_ram_dataspace * \throw Region_map::Invalid_dataspace */ Attached_ram_dataspace(Ram_allocator &ram, Region_map &rm, - size_t size, Cache_attribute cached = CACHED) + size_t size, Cache cache = CACHED) : - _size(size), _ram(&ram), _rm(&rm), _cached(cached) + _size(size), _ram(&ram), _rm(&rm), _cache(cache) { _alloc_and_attach(); } diff --git a/repos/base/include/base/cache.h b/repos/base/include/base/cache.h index 1b8015f42c..721f723624 100644 --- a/repos/base/include/base/cache.h +++ b/repos/base/include/base/cache.h @@ -16,7 +16,7 @@ namespace Genode { - enum Cache_attribute { UNCACHED, WRITE_COMBINED, CACHED }; + enum Cache { UNCACHED, WRITE_COMBINED, CACHED }; } #endif /* _INCLUDE__BASE__CACHE_H_ */ diff --git a/repos/base/include/base/ram_allocator.h b/repos/base/include/base/ram_allocator.h index 03a6dc60b4..591434796f 100644 --- a/repos/base/include/base/ram_allocator.h +++ b/repos/base/include/base/ram_allocator.h @@ -36,17 +36,16 @@ struct Genode::Ram_allocator : Interface /** * Allocate RAM dataspace * - * \param size size of RAM dataspace - * \param cached selects cacheability attributes of the memory, - * uncached memory, i.e., for DMA buffers + * \param size size of RAM dataspace + * \param cache selects cacheability attributes of the memory, + * uncached memory, i.e., for DMA buffers * * \throw Out_of_ram * \throw Out_of_caps * * \return capability to new RAM dataspace */ - virtual Ram_dataspace_capability alloc(size_t size, - Cache_attribute cached = CACHED) = 0; + virtual Ram_dataspace_capability alloc(size_t size, Cache cache = CACHED) = 0; /** * Free RAM dataspace @@ -82,7 +81,7 @@ class Genode::Constrained_ram_allocator : public Ram_allocator _ram_alloc(ram_alloc), _ram_guard(ram_guard), _cap_guard(cap_guard) { } - Ram_dataspace_capability alloc(size_t size, Cache_attribute cached = CACHED) override + Ram_dataspace_capability alloc(size_t size, Cache cache = CACHED) override { size_t page_aligned_size = align_addr(size, 12); @@ -92,7 +91,7 @@ class Genode::Constrained_ram_allocator : public Ram_allocator /* * \throw Out_of_caps, Out_of_ram */ - Ram_dataspace_capability ds = _ram_alloc.alloc(page_aligned_size, cached); + Ram_dataspace_capability ds = _ram_alloc.alloc(page_aligned_size, cache); ram. acknowledge(); caps.acknowledge(); diff --git a/repos/base/include/pd_session/client.h b/repos/base/include/pd_session/client.h index da2bf03f35..393c7d80d7 100644 --- a/repos/base/include/pd_session/client.h +++ b/repos/base/include/pd_session/client.h @@ -73,10 +73,9 @@ struct Genode::Pd_session_client : Rpc_client Cap_quota cap_quota() const override { return call(); } Cap_quota used_caps() const override { return call(); } - Ram_dataspace_capability alloc(size_t size, - Cache_attribute cached = CACHED) override + Ram_dataspace_capability alloc(size_t size, Cache cache = CACHED) override { - return call(size, cached); + return call(size, cache); } void free(Ram_dataspace_capability ds) override { call(ds); } diff --git a/repos/base/include/pd_session/pd_session.h b/repos/base/include/pd_session/pd_session.h index a3e1da8bf9..0e4bb3fe7d 100644 --- a/repos/base/include/pd_session/pd_session.h +++ b/repos/base/include/pd_session/pd_session.h @@ -350,7 +350,7 @@ struct Genode::Pd_session : Session, Ram_allocator GENODE_RPC_THROW(Rpc_alloc, Ram_dataspace_capability, alloc, GENODE_TYPE_LIST(Out_of_ram, Out_of_caps, Undefined_ref_account), - size_t, Cache_attribute); + size_t, Cache); GENODE_RPC(Rpc_free, void, free, Ram_dataspace_capability); GENODE_RPC_THROW(Rpc_transfer_ram_quota, void, transfer_quota, GENODE_TYPE_LIST(Out_of_ram, Invalid_session, Undefined_ref_account), diff --git a/repos/base/src/core/include/dataspace_component.h b/repos/base/src/core/include/dataspace_component.h index f25e954e27..52f5e6ee41 100644 --- a/repos/base/src/core/include/dataspace_component.h +++ b/repos/base/src/core/include/dataspace_component.h @@ -45,7 +45,7 @@ namespace Genode { /* * Access memory cached, write-combined, or uncached respectively */ - Cache_attribute const _cache { CACHED }; + Cache const _cache { CACHED }; List _regions { }; /* regions this is attached to */ Mutex _mutex { }; @@ -79,7 +79,7 @@ namespace Genode { * This constructor is used by RAM and ROM dataspaces. */ Dataspace_component(size_t size, addr_t core_local_addr, - Cache_attribute cache, bool writable, + Cache cache, bool writable, Dataspace_owner *owner) : _phys_addr(core_local_addr), _core_local_addr(core_local_addr), @@ -98,7 +98,7 @@ namespace Genode { * space is needed to send a mapping to another address space. */ Dataspace_component(size_t size, addr_t core_local_addr, - addr_t phys_addr, Cache_attribute cache, + addr_t phys_addr, Cache cache, bool writable, Dataspace_owner *owner) : _phys_addr(phys_addr), _core_local_addr(core_local_addr), @@ -117,9 +117,9 @@ namespace Genode { */ virtual Native_capability sub_rm() { return Dataspace_capability(); } - addr_t core_local_addr() const { return _core_local_addr; } - bool io_mem() const { return _io_mem; } - Cache_attribute cacheability() const { return _cache; } + addr_t core_local_addr() const { return _core_local_addr; } + bool io_mem() const { return _io_mem; } + Cache cacheability() const { return _cache; } /** * Return dataspace base address to be used for map operations diff --git a/repos/base/src/core/include/io_mem_session_component.h b/repos/base/src/core/include/io_mem_session_component.h index 153d7e010d..77fb30eb9e 100644 --- a/repos/base/src/core/include/io_mem_session_component.h +++ b/repos/base/src/core/include/io_mem_session_component.h @@ -35,10 +35,10 @@ namespace Genode { */ struct Dataspace_attr { - size_t size { 0 }; - addr_t core_local_addr { 0 }; - addr_t phys_addr { 0 }; - Cache_attribute cacheable { UNCACHED }; + size_t size { 0 }; + addr_t core_local_addr { 0 }; + addr_t phys_addr { 0 }; + Cache cacheable { UNCACHED }; /** * Base address of request used for freeing mem-ranges @@ -59,7 +59,7 @@ namespace Genode { * An invalid dataspace is represented by setting all * arguments to zero. */ - Dataspace_attr(size_t s, addr_t cla, addr_t pa, Cache_attribute c, + Dataspace_attr(size_t s, addr_t cla, addr_t pa, Cache c, addr_t req_base) : size(s), core_local_addr(cla), phys_addr(pa), @@ -88,7 +88,7 @@ namespace Genode { Io_dataspace_component _ds; Rpc_entrypoint &_ds_ep; Io_mem_dataspace_capability _ds_cap { }; - Cache_attribute _cacheable { UNCACHED }; + Cache _cacheable { UNCACHED }; Dataspace_attr _prepare_io_mem(const char *args, Range_allocator &ram_alloc); diff --git a/repos/base/src/core/include/pd_session_component.h b/repos/base/src/core/include/pd_session_component.h index f72ad45a9f..2712e75947 100644 --- a/repos/base/src/core/include/pd_session_component.h +++ b/repos/base/src/core/include/pd_session_component.h @@ -315,7 +315,7 @@ class Genode::Pd_session_component : public Session_object ** RAM allocation and accounting ** ***********************************/ - Ram_dataspace_capability alloc(size_t, Cache_attribute) override; + Ram_dataspace_capability alloc(size_t, Cache) override; void free(Ram_dataspace_capability) override; diff --git a/repos/base/src/core/include/ram_dataspace_factory.h b/repos/base/src/core/include/ram_dataspace_factory.h index 5a56a92c43..9302b996d5 100644 --- a/repos/base/src/core/include/ram_dataspace_factory.h +++ b/repos/base/src/core/include/ram_dataspace_factory.h @@ -106,7 +106,7 @@ class Genode::Ram_dataspace_factory : public Ram_allocator, ** Ram_allocator interface ** *****************************/ - Ram_dataspace_capability alloc(size_t, Cache_attribute) override; + Ram_dataspace_capability alloc(size_t, Cache) override; void free(Ram_dataspace_capability) override; size_t dataspace_size(Ram_dataspace_capability ds) const override; }; diff --git a/repos/base/src/core/include/synced_ram_allocator.h b/repos/base/src/core/include/synced_ram_allocator.h index 67aa345d2e..1feb05ce5b 100644 --- a/repos/base/src/core/include/synced_ram_allocator.h +++ b/repos/base/src/core/include/synced_ram_allocator.h @@ -33,10 +33,10 @@ class Genode::Synced_ram_allocator : public Ram_allocator Synced_ram_allocator(Ram_allocator &alloc) : _alloc(alloc) { } - Ram_dataspace_capability alloc(size_t size, Cache_attribute cached) override + Ram_dataspace_capability alloc(size_t size, Cache cache) override { Mutex::Guard mutex_guard(_mutex); - return _alloc.alloc(size, cached); + return _alloc.alloc(size, cache); } void free(Ram_dataspace_capability ds) override diff --git a/repos/base/src/core/pd_session_component.cc b/repos/base/src/core/pd_session_component.cc index a22473aad3..a28eef4f0c 100644 --- a/repos/base/src/core/pd_session_component.cc +++ b/repos/base/src/core/pd_session_component.cc @@ -21,7 +21,7 @@ using namespace Genode; Ram_dataspace_capability -Pd_session_component::alloc(size_t ds_size, Cache_attribute cached) +Pd_session_component::alloc(size_t ds_size, Cache cache) { /* zero-sized dataspaces are not allowed */ if (!ds_size) return Ram_dataspace_capability(); @@ -62,7 +62,7 @@ Pd_session_component::alloc(size_t ds_size, Cache_attribute cached) * \throw Out_of_ram * \throw Out_of_caps */ - Ram_dataspace_capability ram_ds = _ram_ds_factory.alloc(ds_size, cached); + Ram_dataspace_capability ram_ds = _ram_ds_factory.alloc(ds_size, cache); /* * We returned from '_ram_ds_factory.alloc' with a valid dataspace. diff --git a/repos/base/src/core/ram_dataspace_factory.cc b/repos/base/src/core/ram_dataspace_factory.cc index a7d356e5ce..4091d6c3b7 100644 --- a/repos/base/src/core/ram_dataspace_factory.cc +++ b/repos/base/src/core/ram_dataspace_factory.cc @@ -21,7 +21,7 @@ using namespace Genode; Ram_dataspace_capability -Ram_dataspace_factory::alloc(size_t ds_size, Cache_attribute cached) +Ram_dataspace_factory::alloc(size_t ds_size, Cache cache) { /* zero-sized dataspaces are not allowed */ if (!ds_size) return Ram_dataspace_capability(); @@ -118,7 +118,7 @@ Ram_dataspace_factory::alloc(size_t ds_size, Cache_attribute cached) * \throw Out_of_caps */ Dataspace_component &ds = *new (_ds_slab) - Dataspace_component(ds_size, (addr_t)ds_addr, cached, true, this); + Dataspace_component(ds_size, (addr_t)ds_addr, cache, true, this); /* create native shared memory representation of dataspace */ try { _export_ram_ds(ds); } diff --git a/repos/base/src/core/stack_area.cc b/repos/base/src/core/stack_area.cc index 64bb18a718..c3a0912efb 100644 --- a/repos/base/src/core/stack_area.cc +++ b/repos/base/src/core/stack_area.cc @@ -121,7 +121,7 @@ class Stack_area_region_map : public Region_map struct Stack_area_ram_allocator : Ram_allocator { - Ram_dataspace_capability alloc(size_t, Cache_attribute) override { + Ram_dataspace_capability alloc(size_t, Cache) override { return reinterpret_cap_cast(Native_capability()); } void free(Ram_dataspace_capability) override { } diff --git a/repos/base/src/include/base/internal/expanding_pd_session_client.h b/repos/base/src/include/base/internal/expanding_pd_session_client.h index 0f79295dfa..9cb0986292 100644 --- a/repos/base/src/include/base/internal/expanding_pd_session_client.h +++ b/repos/base/src/include/base/internal/expanding_pd_session_client.h @@ -38,7 +38,7 @@ struct Genode::Expanding_pd_session_client : Pd_session_client Expanding_pd_session_client(Parent &parent, Pd_session_capability cap) : Pd_session_client(cap), _parent(parent) { } - Ram_dataspace_capability alloc(size_t size, Cache_attribute cached = UNCACHED) override + Ram_dataspace_capability alloc(size_t size, Cache cache = UNCACHED) override { /* * If the RAM session runs out of quota, issue a resource request @@ -49,7 +49,7 @@ struct Genode::Expanding_pd_session_client : Pd_session_client return retry( [&] () { return retry( - [&] () { return Pd_session_client::alloc(size, cached); }, + [&] () { return Pd_session_client::alloc(size, cache); }, [&] () { _request_caps_from_parent(UPGRADE_CAPS); }, NUM_ATTEMPTS); }, diff --git a/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc b/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc index 8f66acdfa4..1b91889734 100644 --- a/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc +++ b/repos/dde_linux/src/drivers/framebuffer/imx8/lx_emul.cc @@ -1198,7 +1198,7 @@ struct Dma_wc_dataspace : Genode::Attached_ram_dataspace, : Genode::Attached_ram_dataspace(Lx_kit::env().ram(), Lx_kit::env().rm(), size, - Genode::Cache_attribute::WRITE_COMBINED) { } + Genode::Cache::WRITE_COMBINED) { } }; static Genode::List &_dma_wc_ds_list() diff --git a/repos/dde_linux/src/drivers/framebuffer/imx8/platform.cc b/repos/dde_linux/src/drivers/framebuffer/imx8/platform.cc index e340212ba8..96978f778d 100644 --- a/repos/dde_linux/src/drivers/framebuffer/imx8/platform.cc +++ b/repos/dde_linux/src/drivers/framebuffer/imx8/platform.cc @@ -31,8 +31,8 @@ void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&, Genode::Ram_dataspace_capability -Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) { - return Lx_kit::env().env().ram().alloc(size, cached); } +Lx::backend_alloc(Genode::addr_t size, Genode::Cache cache) { + return Lx_kit::env().env().ram().alloc(size, cache); } void Lx::backend_free(Genode::Ram_dataspace_capability cap) { diff --git a/repos/dde_linux/src/drivers/nic/fec/platform.cc b/repos/dde_linux/src/drivers/nic/fec/platform.cc index e340212ba8..96978f778d 100644 --- a/repos/dde_linux/src/drivers/nic/fec/platform.cc +++ b/repos/dde_linux/src/drivers/nic/fec/platform.cc @@ -31,8 +31,8 @@ void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&, Genode::Ram_dataspace_capability -Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) { - return Lx_kit::env().env().ram().alloc(size, cached); } +Lx::backend_alloc(Genode::addr_t size, Genode::Cache cache) { + return Lx_kit::env().env().ram().alloc(size, cache); } void Lx::backend_free(Genode::Ram_dataspace_capability cap) { diff --git a/repos/dde_linux/src/drivers/usb/spec/arm/platform_generic.cc b/repos/dde_linux/src/drivers/usb/spec/arm/platform_generic.cc index d63fd8b0f4..13523702da 100644 --- a/repos/dde_linux/src/drivers/usb/spec/arm/platform_generic.cc +++ b/repos/dde_linux/src/drivers/usb/spec/arm/platform_generic.cc @@ -32,8 +32,8 @@ void backend_alloc_init(Genode::Env&, Genode::Ram_allocator&, Genode::Ram_dataspace_capability -Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) { - return Lx_kit::env().env().ram().alloc(size, cached); } +Lx::backend_alloc(Genode::addr_t size, Genode::Cache cache) { + return Lx_kit::env().env().ram().alloc(size, cache); } void Lx::backend_free(Genode::Ram_dataspace_capability cap) { diff --git a/repos/dde_linux/src/drivers/usb_hid/lx_emul.cc b/repos/dde_linux/src/drivers/usb_hid/lx_emul.cc index 2223e51251..a6f4a2d351 100644 --- a/repos/dde_linux/src/drivers/usb_hid/lx_emul.cc +++ b/repos/dde_linux/src/drivers/usb_hid/lx_emul.cc @@ -128,23 +128,32 @@ struct Lx_driver } }; + struct task_struct *current; struct workqueue_struct *system_wq; unsigned long jiffies; -Genode::Ram_dataspace_capability Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) { - return Lx_kit::env().env().ram().alloc(size, cached); } + +Genode::Ram_dataspace_capability Lx::backend_alloc(Genode::addr_t size, + Genode::Cache cache) +{ + return Lx_kit::env().env().ram().alloc(size, cache); +} + const char *dev_name(const struct device *dev) { return dev->name; } + size_t strlen(const char *s) { return Genode::strlen(s); } + int mutex_lock_interruptible(struct mutex *m) { mutex_lock(m); return 0; } + int driver_register(struct device_driver *drv) { if (!drv) diff --git a/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc b/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc index b8cb6455e2..6bd7c58563 100644 --- a/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc +++ b/repos/dde_linux/src/drivers/usb_host/spec/arm/platform.cc @@ -172,8 +172,7 @@ void backend_alloc_init(Env & env, Ram_allocator&, Allocator&) } -Ram_dataspace_capability -Lx::backend_alloc(addr_t size, Cache_attribute) +Ram_dataspace_capability Lx::backend_alloc(addr_t size, Cache) { return resource_env().platform.alloc_dma_buffer(size); } diff --git a/repos/dde_linux/src/drivers/usb_modem/lx_emul.cc b/repos/dde_linux/src/drivers/usb_modem/lx_emul.cc index 3988dedd23..3e93637a98 100644 --- a/repos/dde_linux/src/drivers/usb_modem/lx_emul.cc +++ b/repos/dde_linux/src/drivers/usb_modem/lx_emul.cc @@ -209,9 +209,12 @@ struct task_struct *current; struct workqueue_struct *system_wq; unsigned long jiffies; -Genode::Ram_dataspace_capability Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) { - return Lx_kit::env().env().ram().alloc(size, cached); } +Genode::Ram_dataspace_capability Lx::backend_alloc(Genode::addr_t size, + Genode::Cache cache) +{ + return Lx_kit::env().env().ram().alloc(size, cache); +} int usb_register_driver(struct usb_driver * driver, struct module *, const char *) diff --git a/repos/dde_linux/src/drivers/usb_net/lx_emul.cc b/repos/dde_linux/src/drivers/usb_net/lx_emul.cc index fe4513d113..7fecd4f739 100644 --- a/repos/dde_linux/src/drivers/usb_net/lx_emul.cc +++ b/repos/dde_linux/src/drivers/usb_net/lx_emul.cc @@ -195,9 +195,12 @@ struct task_struct *current; struct workqueue_struct *system_wq; unsigned long jiffies; -Genode::Ram_dataspace_capability Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) { - return Lx_kit::env().env().ram().alloc(size, cached); } +Genode::Ram_dataspace_capability Lx::backend_alloc(Genode::addr_t size, + Genode::Cache cache) +{ + return Lx_kit::env().env().ram().alloc(size, cache); +} int usb_register_driver(struct usb_driver * driver, struct module *, const char *) diff --git a/repos/dde_linux/src/include/lx_emul/impl/gfp.h b/repos/dde_linux/src/include/lx_emul/impl/gfp.h index 6597faf289..c418343022 100644 --- a/repos/dde_linux/src/include/lx_emul/impl/gfp.h +++ b/repos/dde_linux/src/include/lx_emul/impl/gfp.h @@ -20,16 +20,16 @@ struct page *alloc_pages(gfp_t const gfp_mask, unsigned int order) { - using Genode::Cache_attribute; + using Genode::Cache; struct page *page = (struct page *)kzalloc(sizeof(struct page), 0); size_t size = PAGE_SIZE << order; gfp_t const dma_mask = (GFP_DMA | GFP_LX_DMA | GFP_DMA32); - Cache_attribute const cached = (gfp_mask & dma_mask) ? Genode::UNCACHED - : Genode::CACHED; - Genode::Ram_dataspace_capability ds_cap = Lx::backend_alloc(size, cached); + Cache const cache = (gfp_mask & dma_mask) ? Genode::UNCACHED + : Genode::CACHED; + Genode::Ram_dataspace_capability ds_cap = Lx::backend_alloc(size, cache); page->addr = Lx_kit::env().rm().attach(ds_cap); page->paddr = Genode::Dataspace_client(ds_cap).phys_addr(); diff --git a/repos/dde_linux/src/include/lx_kit/backend_alloc.h b/repos/dde_linux/src/include/lx_kit/backend_alloc.h index d209071084..9e5dff8dd3 100644 --- a/repos/dde_linux/src/include/lx_kit/backend_alloc.h +++ b/repos/dde_linux/src/include/lx_kit/backend_alloc.h @@ -25,8 +25,7 @@ namespace Lx { using namespace Genode; - Ram_dataspace_capability backend_alloc(addr_t size, - Cache_attribute cached); + Ram_dataspace_capability backend_alloc(addr_t size, Cache); void backend_free(Ram_dataspace_capability cap); } diff --git a/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h b/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h index 9699cee43d..3efc49f03b 100644 --- a/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h +++ b/repos/dde_linux/src/include/lx_kit/internal/pci_dev.h @@ -198,15 +198,14 @@ class Lx::Pci_dev : public pci_dev, public Lx_kit::List::Element Io_port &io_port() { return _io_port; } - Genode::Io_mem_session_capability io_mem(unsigned bar, - Genode::Cache_attribute cache_attribute) + Genode::Io_mem_session_capability io_mem(unsigned bar, Genode::Cache cache) { if (bar >= DEVICE_COUNT_RESOURCE) return Genode::Io_mem_session_capability(); if (!_io_mem[bar].valid()) _io_mem[bar] = _client.io_mem(_client.phys_bar_to_virt(bar), - cache_attribute); + cache); return _io_mem[bar]; } diff --git a/repos/dde_linux/src/include/lx_kit/mapped_io_mem_range.h b/repos/dde_linux/src/include/lx_kit/mapped_io_mem_range.h index 5f945a45c6..e1d13d1fa2 100644 --- a/repos/dde_linux/src/include/lx_kit/mapped_io_mem_range.h +++ b/repos/dde_linux/src/include/lx_kit/mapped_io_mem_range.h @@ -24,7 +24,7 @@ namespace Lx { using namespace Genode; - void *ioremap(addr_t, unsigned long, Cache_attribute); + void *ioremap(addr_t, unsigned long, Cache); void iounmap(volatile void*); Dataspace_capability ioremap_lookup(addr_t, Genode::size_t); } diff --git a/repos/dde_linux/src/include/lx_kit/pci_dev_registry.h b/repos/dde_linux/src/include/lx_kit/pci_dev_registry.h index 5dec03b893..43a2f0eb38 100644 --- a/repos/dde_linux/src/include/lx_kit/pci_dev_registry.h +++ b/repos/dde_linux/src/include/lx_kit/pci_dev_registry.h @@ -62,10 +62,10 @@ class Lx::Pci_dev_registry Pci_dev* first() { return _devs.first(); } - Genode::Io_mem_dataspace_capability io_mem(Genode::addr_t phys, - Genode::Cache_attribute cache_attribute, - Genode::size_t size, - Genode::addr_t &offset) + Genode::Io_mem_dataspace_capability io_mem(Genode::addr_t phys, + Genode::Cache cache, + Genode::size_t size, + Genode::addr_t &offset) { enum { PCI_ROM_RESOURCE = 6 }; @@ -85,7 +85,7 @@ class Lx::Pci_dev_registry offset = phys - pci_resource_start(d, bar); Genode::Io_mem_session_capability io_mem_cap = - d->io_mem(bar, cache_attribute); + d->io_mem(bar, cache); return Genode::Io_mem_session_client(io_mem_cap).dataspace(); } diff --git a/repos/dde_linux/src/lib/lxip/lxcc_emul.cc b/repos/dde_linux/src/lib/lxip/lxcc_emul.cc index bfd3bda456..4ed2b0859f 100644 --- a/repos/dde_linux/src/lib/lxip/lxcc_emul.cc +++ b/repos/dde_linux/src/lib/lxip/lxcc_emul.cc @@ -73,7 +73,7 @@ struct Memory_object_base : Genode::Object_pool::Entry Genode::Ram_dataspace_capability -Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) +Lx::backend_alloc(Genode::addr_t size, Genode::Cache) { using namespace Genode; diff --git a/repos/dde_linux/src/lib/wifi/lx.h b/repos/dde_linux/src/lib/wifi/lx.h index 7430558a70..64706dfbd8 100644 --- a/repos/dde_linux/src/lib/wifi/lx.h +++ b/repos/dde_linux/src/lib/wifi/lx.h @@ -40,7 +40,7 @@ namespace Lx Genode::Allocator&, Genode::Nic_driver_mode); - Genode::Ram_dataspace_capability backend_alloc(Genode::addr_t, Genode::Cache_attribute); + Genode::Ram_dataspace_capability backend_alloc(Genode::addr_t, Genode::Cache); void backend_free(Genode::Ram_dataspace_capability); void get_mac_address(unsigned char *); diff --git a/repos/dde_linux/src/lx_kit/malloc.cc b/repos/dde_linux/src/lx_kit/malloc.cc index fa0dd8f275..eab6aa91b8 100644 --- a/repos/dde_linux/src/lx_kit/malloc.cc +++ b/repos/dde_linux/src/lx_kit/malloc.cc @@ -48,7 +48,7 @@ class Lx_kit::Slab_backend_alloc : public Lx::Slab_backend_alloc, }; addr_t _base; /* virt. base address */ - Genode::Cache_attribute _cached; /* non-/cached RAM */ + Genode::Cache _cache; /* non-/cached RAM */ Genode::Ram_dataspace_capability _ds_cap[ELEMENTS]; /* dataspaces to put in VM */ addr_t _ds_phys[ELEMENTS]; /* physical bases of dataspaces */ int _index; /* current index in ds_cap */ @@ -62,7 +62,7 @@ class Lx_kit::Slab_backend_alloc : public Lx::Slab_backend_alloc, } try { - _ds_cap[_index] = Lx::backend_alloc(P_BLOCK_SIZE, _cached); + _ds_cap[_index] = Lx::backend_alloc(P_BLOCK_SIZE, _cache); /* attach at index * V_BLOCK_SIZE */ Region_map_client::attach_at(_ds_cap[_index], _index * V_BLOCK_SIZE, P_BLOCK_SIZE, 0); @@ -81,11 +81,11 @@ class Lx_kit::Slab_backend_alloc : public Lx::Slab_backend_alloc, public: Slab_backend_alloc(Genode::Env &env, Genode::Allocator &md_alloc, - Genode::Cache_attribute cached) + Genode::Cache cache) : Rm_connection(env), Region_map_client(Rm_connection::create(VM_SIZE)), - _cached(cached), _index(0), _range(&md_alloc) + _cache(cache), _index(0), _range(&md_alloc) { /* reserver attach us, anywere */ _base = env.rm().attach(dataspace()); @@ -170,7 +170,7 @@ class Lx_kit::Malloc : public Lx::Malloc Slab_backend_alloc &_back_allocator; Genode::Constructible _allocator[NUM_SLABS]; - Genode::Cache_attribute _cached; /* cached or un-cached memory */ + Genode::Cache _cache; /* cached or un-cached memory */ addr_t _start; /* VM region of this allocator */ addr_t _end; @@ -217,9 +217,9 @@ class Lx_kit::Malloc : public Lx::Malloc public: - Malloc(Slab_backend_alloc &alloc, Genode::Cache_attribute cached) + Malloc(Slab_backend_alloc &alloc, Genode::Cache cache) : - _back_allocator(alloc), _cached(cached), _start(alloc.start()), + _back_allocator(alloc), _cache(cache), _start(alloc.start()), _end(alloc.end()) { /* init slab allocators */ @@ -253,7 +253,7 @@ class Lx_kit::Malloc : public Lx::Malloc if (msb > SLAB_STOP_LOG2) { Genode::error("slab too large ", - 1UL << msb, " requested ", size, " cached ", (int)_cached); + 1UL << msb, " requested ", size, " cached ", (int)_cache); return 0; } diff --git a/repos/dde_linux/src/lx_kit/mapped_io_mem_range.cc b/repos/dde_linux/src/lx_kit/mapped_io_mem_range.cc index 78f9c24e72..aab90ad1a6 100644 --- a/repos/dde_linux/src/lx_kit/mapped_io_mem_range.cc +++ b/repos/dde_linux/src/lx_kit/mapped_io_mem_range.cc @@ -94,8 +94,7 @@ static Lx_kit::List ranges; static Genode::Constructible _global_rm; -void *Lx::ioremap(addr_t phys_addr, unsigned long size, - Genode::Cache_attribute cache_attribute) +void *Lx::ioremap(addr_t phys_addr, unsigned long size, Genode::Cache cache) { using namespace Genode; @@ -112,8 +111,7 @@ void *Lx::ioremap(addr_t phys_addr, unsigned long size, addr_t offset = 0; Io_mem_dataspace_capability ds_cap = - Lx::pci_dev_registry()->io_mem(phys_addr, cache_attribute, - size, offset); + Lx::pci_dev_registry()->io_mem(phys_addr, cache, size, offset); if (!ds_cap.valid()) { error("failed to request I/O memory: ", diff --git a/repos/dde_linux/src/lx_kit/pci.cc b/repos/dde_linux/src/lx_kit/pci.cc index 6d308f8df6..f3174fcec6 100644 --- a/repos/dde_linux/src/lx_kit/pci.cc +++ b/repos/dde_linux/src/lx_kit/pci.cc @@ -113,14 +113,14 @@ Lx::Pci_dev_registry *Lx::pci_dev_registry(Genode::Env *env) *********************************/ Genode::Ram_dataspace_capability -Lx::backend_alloc(Genode::addr_t size, Genode::Cache_attribute cached) +Lx::backend_alloc(Genode::addr_t size, Genode::Cache cache) { using namespace Genode; using namespace Lx_kit; Memory_object_base *obj; Genode::Ram_dataspace_capability cap; - if (cached == CACHED) { + if (cache == CACHED) { cap = _global_ram->alloc(size); obj = new (_global_md_alloc) Ram_object(*_global_ram, cap); } else { diff --git a/repos/dde_rump/src/include/util/allocator_fap.h b/repos/dde_rump/src/include/util/allocator_fap.h index e1c6adf5d8..34313922ee 100644 --- a/repos/dde_rump/src/include/util/allocator_fap.h +++ b/repos/dde_rump/src/include/util/allocator_fap.h @@ -65,7 +65,7 @@ namespace Allocator { typedef Genode::Allocator_avl Allocator_avl; addr_t _base; /* virt. base address */ - Cache_attribute _cached; /* non-/cached RAM */ + Cache _cache; /* non-/cached RAM */ Ram_dataspace_capability _ds_cap[ELEMENTS]; /* dataspaces to put in VM */ addr_t _ds_phys[ELEMENTS]; /* physical bases of dataspaces */ int _index = 0; /* current index in ds_cap */ @@ -85,7 +85,7 @@ namespace Allocator { Policy_guard guard; try { - _ds_cap[_index] = Rump::env().env().ram().alloc(BLOCK_SIZE, _cached); + _ds_cap[_index] = Rump::env().env().ram().alloc(BLOCK_SIZE, _cache); /* attach at index * BLOCK_SIZE */ Region_map_client::attach_at(_ds_cap[_index], _index * BLOCK_SIZE, BLOCK_SIZE, 0); /* lookup phys. address */ @@ -114,11 +114,11 @@ namespace Allocator { public: - Backend_alloc(Cache_attribute cached) + Backend_alloc(Cache cache) : Rm_connection(Rump::env().env()), Region_map_client(Rm_connection::create(VM_SIZE)), - _cached(cached), + _cache(cache), _range(&Rump::env().heap()) { /* reserver attach us, anywere */ @@ -204,8 +204,7 @@ namespace Allocator { public: - Fap(bool cached) - : _back_allocator(cached ? CACHED : UNCACHED) { } + Fap(bool cache) : _back_allocator(cache ? CACHED : UNCACHED) { } void *alloc(size_t size, unsigned align = 0) { diff --git a/repos/libports/src/lib/libc/internal/malloc_ram_allocator.h b/repos/libports/src/lib/libc/internal/malloc_ram_allocator.h index e69059d877..5b6d7bc2bb 100644 --- a/repos/libports/src/lib/libc/internal/malloc_ram_allocator.h +++ b/repos/libports/src/lib/libc/internal/malloc_ram_allocator.h @@ -53,9 +53,9 @@ struct Libc::Malloc_ram_allocator : Ram_allocator _release(ds); }); } - Ram_dataspace_capability alloc(size_t size, Cache_attribute cached) override + Ram_dataspace_capability alloc(size_t size, Cache cache) override { - Ram_dataspace_capability cap = _ram.alloc(size, cached); + Ram_dataspace_capability cap = _ram.alloc(size, cache); new (_md_alloc) Registered(_dataspaces, cap); return cap; } diff --git a/repos/os/include/nic/component.h b/repos/os/include/nic/component.h index d034d88dc5..3e3fd75307 100644 --- a/repos/os/include/nic/component.h +++ b/repos/os/include/nic/component.h @@ -34,12 +34,12 @@ class Nic::Communication_buffers Nic::Packet_allocator _rx_packet_alloc; Genode::Attached_ram_dataspace _tx_ds, _rx_ds; - Communication_buffers(Genode::Allocator &rx_block_md_alloc, - Genode::Ram_allocator &ram, - Genode::Region_map ®ion_map, - Genode::size_t tx_size, - Genode::size_t rx_size, - Genode::Cache_attribute cache_policy) + Communication_buffers(Genode::Allocator &rx_block_md_alloc, + Genode::Ram_allocator &ram, + Genode::Region_map ®ion_map, + Genode::size_t tx_size, + Genode::size_t rx_size, + Genode::Cache cache_policy) : _rx_packet_alloc(&rx_block_md_alloc), _tx_ds(ram, region_map, tx_size, cache_policy), @@ -92,11 +92,11 @@ class Nic::Session_component : Communication_buffers, public Session_rpc_object * resources and open connections from * within the Session_component */ - Session_component(Genode::size_t const tx_buf_size, - Genode::size_t const rx_buf_size, - Genode::Cache_attribute cache_policy, - Genode::Allocator &rx_block_md_alloc, - Genode::Env &env) + Session_component(Genode::size_t const tx_buf_size, + Genode::size_t const rx_buf_size, + Genode::Cache cache_policy, + Genode::Allocator &rx_block_md_alloc, + Genode::Env &env) : Communication_buffers(rx_block_md_alloc, env.ram(), env.rm(), tx_buf_size, rx_buf_size, cache_policy), @@ -125,12 +125,12 @@ class Nic::Session_component : Communication_buffers, public Session_rpc_object * within the Session_component * \param ep entrypoint for RPC */ - Session_component(Genode::size_t const tx_buf_size, - Genode::size_t const rx_buf_size, - Genode::Cache_attribute cache_policy, - Genode::Allocator &rx_block_md_alloc, - Genode::Env &env, - Genode::Entrypoint &ep) + Session_component(Genode::size_t const tx_buf_size, + Genode::size_t const rx_buf_size, + Genode::Cache cache_policy, + Genode::Allocator &rx_block_md_alloc, + Genode::Env &env, + Genode::Entrypoint &ep) : Communication_buffers(rx_block_md_alloc, env.ram(), env.rm(), tx_buf_size, rx_buf_size, cache_policy), diff --git a/repos/os/include/platform_device/device.h b/repos/os/include/platform_device/device.h index 98c55466b7..d89eb5ffd0 100644 --- a/repos/os/include/platform_device/device.h +++ b/repos/os/include/platform_device/device.h @@ -31,8 +31,7 @@ struct Platform::Abstract_device : Genode::Interface /** * Get IO mem session capability of specified resource id */ - virtual Genode::Io_mem_session_capability io_mem(Genode::uint8_t, - Genode::Cache_attribute, + virtual Genode::Io_mem_session_capability io_mem(Genode::uint8_t, Genode::Cache, Genode::addr_t, Genode::size_t) = 0; }; diff --git a/repos/os/include/spec/arm/platform_device/client.h b/repos/os/include/spec/arm/platform_device/client.h index 2e8d0fa4ff..7ec7225e4c 100644 --- a/repos/os/include/spec/arm/platform_device/client.h +++ b/repos/os/include/spec/arm/platform_device/client.h @@ -33,9 +33,7 @@ struct Platform::Device_client : Genode::Rpc_client } Genode::Io_mem_session_capability - io_mem(unsigned id = 0, - Genode::Cache_attribute caching = - Genode::Cache_attribute::UNCACHED) override + io_mem(unsigned id = 0, Genode::Cache caching = Genode::Cache::UNCACHED) override { return call(id, caching); } @@ -46,11 +44,9 @@ struct Platform::Device_client : Genode::Rpc_client ***************************/ Genode::Io_mem_dataspace_capability - io_mem_dataspace(unsigned id = 0, - Genode::Cache_attribute caching = - Genode::Cache_attribute::UNCACHED) + io_mem_dataspace(unsigned id = 0, Genode::Cache cache = Genode::Cache::UNCACHED) { - Genode::Io_mem_session_client session(io_mem(id, caching)); + Genode::Io_mem_session_client session(io_mem(id, cache)); return session.dataspace(); } }; diff --git a/repos/os/include/spec/arm/platform_device/platform_device.h b/repos/os/include/spec/arm/platform_device/platform_device.h index a736166347..274cee0402 100644 --- a/repos/os/include/spec/arm/platform_device/platform_device.h +++ b/repos/os/include/spec/arm/platform_device/platform_device.h @@ -38,8 +38,7 @@ struct Platform::Device : Genode::Session /** * Get IO mem session capability of specified resource id */ - virtual Genode::Io_mem_session_capability - io_mem(unsigned id, Genode::Cache_attribute attr) = 0; + virtual Genode::Io_mem_session_capability io_mem(unsigned id, Genode::Cache) = 0; /********************* @@ -48,7 +47,7 @@ struct Platform::Device : Genode::Session GENODE_RPC(Rpc_irq, Genode::Irq_session_capability, irq, unsigned); GENODE_RPC(Rpc_io_mem, Genode::Io_mem_session_capability, io_mem, - unsigned, Genode::Cache_attribute); + unsigned, Genode::Cache); GENODE_RPC_INTERFACE(Rpc_irq, Rpc_io_mem); }; diff --git a/repos/os/include/spec/x86/platform_device/client.h b/repos/os/include/spec/x86/platform_device/client.h index bcf93cdcbe..4d27ec42f9 100644 --- a/repos/os/include/spec/x86/platform_device/client.h +++ b/repos/os/include/spec/x86/platform_device/client.h @@ -55,10 +55,10 @@ struct Platform::Device_client : public Genode::Rpc_client return call(id); } Genode::Io_mem_session_capability io_mem(Genode::uint8_t id, - Genode::Cache_attribute caching = Genode::Cache_attribute::UNCACHED, + Genode::Cache cache = Genode::Cache::UNCACHED, Genode::addr_t offset = 0, Genode::size_t size = ~0UL) override { - return call(id, caching, offset, size); } + return call(id, cache, offset, size); } }; #endif /* _INCLUDE__SPEC__X86__PLATFORM_DEVICE__CLIENT_H_ */ diff --git a/repos/os/include/spec/x86/platform_device/platform_device.h b/repos/os/include/spec/x86/platform_device/platform_device.h index 7c96ed16ae..6644d8d13c 100644 --- a/repos/os/include/spec/x86/platform_device/platform_device.h +++ b/repos/os/include/spec/x86/platform_device/platform_device.h @@ -251,7 +251,7 @@ struct Platform::Device : Platform::Abstract_device Genode::uint8_t); GENODE_RPC_THROW(Rpc_io_mem, Genode::Io_mem_session_capability, io_mem, GENODE_TYPE_LIST(Out_of_ram, Out_of_caps), - Genode::uint8_t, Genode::Cache_attribute, + Genode::uint8_t, Genode::Cache, Genode::addr_t, Genode::size_t); GENODE_RPC_INTERFACE(Rpc_bus_address, Rpc_vendor_id, Rpc_device_id, diff --git a/repos/os/src/drivers/platform/spec/arm/device.cc b/repos/os/src/drivers/platform/spec/arm/device.cc index d3d9d08beb..d9199ef05f 100644 --- a/repos/os/src/drivers/platform/spec/arm/device.cc +++ b/repos/os/src/drivers/platform/spec/arm/device.cc @@ -93,8 +93,7 @@ Genode::Irq_session_capability Driver::Device::irq(unsigned idx, Genode::Io_mem_session_capability -Driver::Device::io_mem(unsigned idx, Cache_attribute attr, - Session_component & sc) +Driver::Device::io_mem(unsigned idx, Cache cache, Session_component & sc) { Io_mem_session_capability cap; @@ -108,7 +107,7 @@ Driver::Device::io_mem(unsigned idx, Cache_attribute attr, if (!io_mem.io_mem) { io_mem.io_mem = new (sc.heap()) Io_mem_connection(sc.env().env, io_mem.base, io_mem.size, - (attr == WRITE_COMBINED)); + (cache == WRITE_COMBINED)); } cap = io_mem.io_mem->cap(); }); diff --git a/repos/os/src/drivers/platform/spec/arm/device.h b/repos/os/src/drivers/platform/spec/arm/device.h index 1cf5a633f7..8722eaf31d 100644 --- a/repos/os/src/drivers/platform/spec/arm/device.h +++ b/repos/os/src/drivers/platform/spec/arm/device.h @@ -82,7 +82,7 @@ class Driver::Device : private List_model::Element Irq_session_capability irq(unsigned idx, Session_component & session); - Io_mem_session_capability io_mem(unsigned idx, Cache_attribute, + Io_mem_session_capability io_mem(unsigned idx, Cache, Session_component & session); void report(Xml_generator &, Session_component &); diff --git a/repos/os/src/drivers/platform/spec/arm/device_component.cc b/repos/os/src/drivers/platform/spec/arm/device_component.cc index d626b96332..1cc9858735 100644 --- a/repos/os/src/drivers/platform/spec/arm/device_component.cc +++ b/repos/os/src/drivers/platform/spec/arm/device_component.cc @@ -41,12 +41,12 @@ void Driver::Device_component::release() Genode::Io_mem_session_capability -Device_component::io_mem(unsigned idx, Cache_attribute attr) +Device_component::io_mem(unsigned idx, Cache cache) { Io_mem_session_capability cap; _session.env().devices.for_each([&] (Driver::Device & device) { if (device.name() == _device) { - cap = device.io_mem(idx, attr, _session); }}); + cap = device.io_mem(idx, cache, _session); }}); return cap; } diff --git a/repos/os/src/drivers/platform/spec/arm/device_component.h b/repos/os/src/drivers/platform/spec/arm/device_component.h index 11fb980d9f..a2d19794b8 100644 --- a/repos/os/src/drivers/platform/spec/arm/device_component.h +++ b/repos/os/src/drivers/platform/spec/arm/device_component.h @@ -49,7 +49,7 @@ class Driver::Device_component : public Rpc_object **************************/ Irq_session_capability irq(unsigned) override; - Io_mem_session_capability io_mem(unsigned, Cache_attribute) override; + Io_mem_session_capability io_mem(unsigned, Cache) override; private: diff --git a/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc b/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc index 16cd8493be..8472725e5f 100644 --- a/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc +++ b/repos/os/src/drivers/platform/spec/x86/nonpci_devices.cc @@ -80,7 +80,7 @@ class Nonpci::Ps2 : public Platform::Device_component } Genode::Io_mem_session_capability io_mem(Genode::uint8_t, - Genode::Cache_attribute, + Genode::Cache, Genode::addr_t, Genode::size_t) override { diff --git a/repos/os/src/drivers/platform/spec/x86/pci_device.cc b/repos/os/src/drivers/platform/spec/x86/pci_device.cc index 9ebb0d39ae..2fc7131b00 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_device.cc +++ b/repos/os/src/drivers/platform/spec/x86/pci_device.cc @@ -44,9 +44,9 @@ Genode::Io_port_session_capability Platform::Device_component::io_port(Genode::u } Genode::Io_mem_session_capability Platform::Device_component::io_mem(Genode::uint8_t const v_id, - Genode::Cache_attribute const caching, - Genode::addr_t const offset, - Genode::size_t const size) + Genode::Cache const caching, + Genode::addr_t const offset, + Genode::size_t const size) { Genode::uint8_t max = sizeof(_io_mem) / sizeof(_io_mem[0]); Genode::uint8_t r_id = 0; @@ -77,7 +77,7 @@ Genode::Io_mem_session_capability Platform::Device_component::io_mem(Genode::uin } try { - bool const wc = caching == Genode::Cache_attribute::WRITE_COMBINED; + bool const wc = caching == Genode::Cache::WRITE_COMBINED; Io_mem * io_mem = new (_slab_iomem) Io_mem(_env, res.base() + offset, res_size, wc); diff --git a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h index cf56b68593..78e25ce38a 100644 --- a/repos/os/src/drivers/platform/spec/x86/pci_device_component.h +++ b/repos/os/src/drivers/platform/spec/x86/pci_device_component.h @@ -603,7 +603,7 @@ class Platform::Device_component : public Genode::Rpc_object, Genode::Io_port_session_capability io_port(Genode::uint8_t) override; Genode::Io_mem_session_capability io_mem(Genode::uint8_t, - Genode::Cache_attribute, + Genode::Cache, Genode::addr_t, Genode::size_t) override; }; diff --git a/repos/os/src/server/nic_router/session_env.h b/repos/os/src/server/nic_router/session_env.h index f399494b60..a23692e10b 100644 --- a/repos/os/src/server/nic_router/session_env.h +++ b/repos/os/src/server/nic_router/session_env.h @@ -113,7 +113,7 @@ class Genode::Session_env : public Ram_allocator, ** Ram_allocator ** *******************/ - Ram_dataspace_capability alloc(size_t size, Cache_attribute cached) override + Ram_dataspace_capability alloc(size_t size, Cache cache) override { enum { MAX_SHARED_CAP = 1 }; enum { MAX_SHARED_RAM = 4096 }; @@ -122,7 +122,7 @@ class Genode::Session_env : public Ram_allocator, size_t const ds_size = align_addr(size, DS_SIZE_GRANULARITY_LOG2); Ram_dataspace_capability ds; _consume(ds_size, MAX_SHARED_RAM, 1, MAX_SHARED_CAP, [&] () { - ds = _env.pd().alloc(ds_size, cached); + ds = _env.pd().alloc(ds_size, cache); }); return ds; } diff --git a/repos/ports/src/app/gdb_monitor/pd_session_component.h b/repos/ports/src/app/gdb_monitor/pd_session_component.h index e560277cdf..37c1680bc4 100644 --- a/repos/ports/src/app/gdb_monitor/pd_session_component.h +++ b/repos/ports/src/app/gdb_monitor/pd_session_component.h @@ -128,8 +128,8 @@ class Gdb_monitor::Pd_session_component : public Rpc_object Cap_quota cap_quota() const override { return _pd.cap_quota(); } Cap_quota used_caps() const override { return _pd.used_caps(); } - Ram_dataspace_capability alloc(size_t amount, Cache_attribute cached) override { - return _pd.alloc(amount, cached); } + Ram_dataspace_capability alloc(size_t amount, Cache cache) override { + return _pd.alloc(amount, cache); } void free(Ram_dataspace_capability ds) override { _pd.free(ds); }