5export module arch.s390x.cpu.aste;
6export import arch.s390x.cpu.aste.consts;
8import zxfoundation.base.types;
14namespace arch::s390x::cpu::aste {
17 struct [[gnu::packed]]
alignas(64) aste {
21 [[nodiscard]]
auto is_invalid()
const noexcept ->
bool;
24 auto set_invalid(
bool inv)
noexcept ->
void;
27 [[nodiscard]]
auto asce()
const noexcept -> u64;
30 auto set_asce(u64 val)
noexcept ->
void;
33 [[nodiscard]]
auto ald()
const noexcept -> u64;
36 auto set_ald(u64 val)
noexcept ->
void;
39 [[nodiscard]]
auto authorization_index()
const noexcept -> u16;
42 auto set_authorization_index(u16 ax)
noexcept ->
void;
45 [[nodiscard]]
auto ltd_raw()
const noexcept -> u32;
48 auto set_ltd_raw(u32 ltd)
noexcept ->
void;
52 [[nodiscard]]
auto ltd_valid()
const noexcept ->
bool;
55 auto set_ltd_valid(
bool v)
noexcept ->
void;
59 [[nodiscard]]
auto ltd_origin()
const noexcept -> u64;
63 auto set_ltd_origin(u64 addr)
noexcept ->
void;
67 [[nodiscard]]
auto ltd_length()
const noexcept -> u8;
70 auto set_ltd_length(u8 ltl)
noexcept ->
void;
73 auto clear()
noexcept ->
void;
76 static_assert(
sizeof(aste) == 64,
"ASTE must be exactly 64 bytes (PoP §3.8.4)");
77 static_assert(
alignof(aste) == 64,
"ASTE must be 64-byte aligned");
80 struct [[gnu::packed]] ale {
84 [[nodiscard]]
auto is_invalid()
const noexcept ->
bool;
87 auto set_invalid(
bool inv)
noexcept ->
void;
90 [[nodiscard]]
auto aste_origin()
const noexcept -> u64;
93 auto set_aste_origin(u64 addr)
noexcept ->
void;
96 [[nodiscard]]
auto sequence()
const noexcept -> u8;
99 auto set_sequence(u8 val)
noexcept ->
void;
102 auto set_fetch_only(
bool fetch_only)
noexcept ->
void;
105 auto set_aste_sequence(u32 val)
noexcept ->
void;
108 auto clear()
noexcept ->
void;
111 static_assert(
sizeof(ale) == 16,
"ALE must be exactly 16 bytes (PoP §3.8.3)");
114 auto aste_subsystem_init()
noexcept ->
void;
118 [[nodiscard]]
auto art_context_init(art_context& context)
noexcept
119 -> ::std::expected<
void, ::lib::kernel_error>;
123 auto art_context_destroy(art_context& context)
noexcept ->
void;
126 auto art_context_load(
const art_context& context)
noexcept ->
void;
132 [[nodiscard]]
auto aste_alloc(
135 )
noexcept -> ::std::expected<u32, ::lib::kernel_error>;
141 [[nodiscard]]
auto aste_free(
143 )
noexcept -> ::std::expected<
void, ::lib::kernel_error>;
148 [[nodiscard]]
auto ale_create(
149 art_context& context,
151 )
noexcept -> ::std::expected<u32, ::lib::kernel_error>;
156 [[nodiscard]]
auto ale_destroy(
157 art_context& context,
159 )
noexcept -> ::std::expected<
void, ::lib::kernel_error>;
165 [[nodiscard]]
auto aste_find(u32 index)
noexcept -> aste*;