From cec050983abc6ea7609f47d3b27558670e648b94 Mon Sep 17 00:00:00 2001 From: Sebastian Sumpf Date: Mon, 27 May 2019 13:45:01 +0200 Subject: [PATCH] hw: [[fallthrough]] annotations for ARM/RISC-V * double checked issue #3377 --- repos/base-hw/src/include/hw/spec/arm/lpae.h | 8 ++++---- repos/base-hw/src/include/hw/spec/arm/page_table.h | 3 ++- repos/base-hw/src/include/hw/spec/riscv/page_table.h | 4 +++- 3 files changed, 9 insertions(+), 6 deletions(-) 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 acd255cde..481098c93 100644 --- a/repos/base-hw/src/include/hw/spec/arm/lpae.h +++ b/repos/base-hw/src/include/hw/spec/arm/lpae.h @@ -210,7 +210,7 @@ class Hw::Long_translation_table switch (f.cacheable) { case Genode::CACHED: return Attribute_index::bits(CACHED); - case Genode::WRITE_COMBINED: + case Genode::WRITE_COMBINED: [[fallthrough]]; case Genode::UNCACHED: return Attribute_index::bits(UNCACHED); } return 0; @@ -434,7 +434,7 @@ class Hw::Level_x_translation_table : E & table = alloc.construct(); desc = Table_descriptor::create((void*)alloc.phys_addr(table)); } - + [[fallthrough]]; case Descriptor::TABLE: /* table already available */ { /* use allocator to retrieve virt address of table */ @@ -476,8 +476,8 @@ class Hw::Level_x_translation_table : size, alloc); if (!table.empty()) break; alloc.destruct(table); - } - case Descriptor::BLOCK: + } [[fallthrough]]; + case Descriptor::BLOCK: [[fallthrough]]; case Descriptor::INVALID: desc = 0; } diff --git a/repos/base-hw/src/include/hw/spec/arm/page_table.h b/repos/base-hw/src/include/hw/spec/arm/page_table.h index d9d8249d9..1c9a91df9 100644 --- a/repos/base-hw/src/include/hw/spec/arm/page_table.h +++ b/repos/base-hw/src/include/hw/spec/arm/page_table.h @@ -64,7 +64,7 @@ class Hw::Page_table T::Tex::set(v, _device_tex()); } else { switch (f.cacheable) { - case CACHED: T::Tex::set(v, 5); + case CACHED: T::Tex::set(v, 5); [[fallthrough]]; case WRITE_COMBINED: T::B::set(v, 1); break; case UNCACHED: T::Tex::set(v, 1); break; } @@ -434,6 +434,7 @@ class Hw::Page_table _entries[i] = Ptd::create(alloc.phys_addr(pt)); _translation_added((addr_t)&_entries[i], sizeof(Ptd)); } + [[fallthrough]]; case Descriptor::PAGE_TABLE: { diff --git a/repos/base-hw/src/include/hw/spec/riscv/page_table.h b/repos/base-hw/src/include/hw/spec/riscv/page_table.h index 5044a40a9..6e60acb98 100644 --- a/repos/base-hw/src/include/hw/spec/riscv/page_table.h +++ b/repos/base-hw/src/include/hw/spec/riscv/page_table.h @@ -238,6 +238,7 @@ class Sv39::Level_x_translation_table E & table = alloc.construct(); desc = Td::create((void*)alloc.phys_addr(table)); } + [[fallthrough]]; case Descriptor::TABLE: /* table already available */ { @@ -277,7 +278,8 @@ class Sv39::Level_x_translation_table if (!table.empty()) break; alloc.destruct(table); } - case Descriptor::BLOCK: + [[fallthrough]]; + case Descriptor::BLOCK: [[fallthrough]]; case Descriptor::INVALID: desc = 0; }