mirror of
https://github.com/genodelabs/genode.git
synced 2024-12-23 15:32:25 +00:00
Align after template expansion
Clang Cannot align template structs. Also, cannot cast void* to addr_t in constexpr function. Issue #3564
This commit is contained in:
parent
2c510bb7f9
commit
648382db74
@ -57,13 +57,6 @@ namespace Hw
|
||||
template <typename ENTRY, unsigned PAGE_SIZE_LOG2, unsigned SIZE_LOG2>
|
||||
class Page_directory;
|
||||
|
||||
using Level_3_translation_table =
|
||||
Page_directory<Level_4_translation_table,
|
||||
SIZE_LOG2_2MB, SIZE_LOG2_1GB>;
|
||||
using Level_2_translation_table =
|
||||
Page_directory<Level_3_translation_table,
|
||||
SIZE_LOG2_1GB, SIZE_LOG2_512GB>;
|
||||
|
||||
/**
|
||||
* IA-32e common descriptor.
|
||||
*
|
||||
@ -489,7 +482,24 @@ class Hw::Page_directory
|
||||
*/
|
||||
void remove_translation(addr_t vo, size_t size, Allocator & alloc) {
|
||||
_range_op(vo, 0, size, Remove_func(alloc)); }
|
||||
} __attribute__((aligned(1 << ALIGNM_LOG2)));
|
||||
};
|
||||
|
||||
|
||||
namespace Hw {
|
||||
|
||||
struct Level_3_translation_table :
|
||||
Page_directory<
|
||||
Level_4_translation_table,
|
||||
SIZE_LOG2_2MB, SIZE_LOG2_1GB>
|
||||
{ } __attribute__((aligned(1 << ALIGNM_LOG2)));
|
||||
|
||||
struct Level_2_translation_table :
|
||||
Page_directory<
|
||||
Level_3_translation_table,
|
||||
SIZE_LOG2_1GB, SIZE_LOG2_512GB>
|
||||
{ } __attribute__((aligned(1 << ALIGNM_LOG2)));
|
||||
|
||||
}
|
||||
|
||||
|
||||
class Hw::Pml4_table
|
||||
|
@ -56,7 +56,7 @@ namespace Hw
|
||||
* \param p pointer
|
||||
* \param alignm_log2 log2 of the required alignment
|
||||
*/
|
||||
constexpr bool aligned(void * const p, addr_t alignm_log2) {
|
||||
inline bool aligned(void * const p, addr_t alignm_log2) {
|
||||
return (addr_t)p == trunc((addr_t)p, alignm_log2); }
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user