mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-26 19:22:30 -05:00
Kernel: Add NZCV, Condition Flags
This commit is contained in:
parent
e7d4bbcde8
commit
e1c3bf0ec0
Notes:
sideshowbarker
2024-07-19 17:00:43 +09:00
Author: https://github.com/konradekk Commit: https://github.com/SerenityOS/serenity/commit/e1c3bf0ec03 Pull-request: https://github.com/SerenityOS/serenity/pull/16647 Reviewed-by: https://github.com/nico ✅
1 changed files with 21 additions and 0 deletions
|
@ -741,4 +741,25 @@ struct DAIF {
|
|||
}
|
||||
};
|
||||
static_assert(sizeof(DAIF) == 8);
|
||||
|
||||
// https://developer.arm.com/documentation/ddi0595/2021-03/AArch64-Registers/NZCV--Condition-Flags
|
||||
// NZCV, Condition Flags
|
||||
struct alignas(u64) NZCV {
|
||||
u64 : 28;
|
||||
u64 V : 1;
|
||||
u64 C : 1;
|
||||
u64 Z : 1;
|
||||
u64 N : 1;
|
||||
u64 : 32;
|
||||
|
||||
static inline NZCV read()
|
||||
{
|
||||
NZCV nzcv;
|
||||
asm volatile("mrs %[value], nzcv"
|
||||
: [value] "=r"(nzcv));
|
||||
return nzcv;
|
||||
}
|
||||
};
|
||||
static_assert(sizeof(NZCV) == 8);
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue