mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-05 17:16:04 +00:00
Kernel: Add PMCCNTR_EL0, Performance Monitors Cycle Count Register
This commit is contained in:
parent
e1c3bf0ec0
commit
88d0d0d90d
Notes:
sideshowbarker
2024-07-19 17:00:35 +09:00
Author: https://github.com/konradekk
Commit: 88d0d0d90d
Pull-request: https://github.com/SerenityOS/serenity/pull/16647
Reviewed-by: https://github.com/nico ✅
1 changed files with 15 additions and 0 deletions
|
@ -762,4 +762,19 @@ struct alignas(u64) NZCV {
|
||||||
};
|
};
|
||||||
static_assert(sizeof(NZCV) == 8);
|
static_assert(sizeof(NZCV) == 8);
|
||||||
|
|
||||||
|
// https://developer.arm.com/documentation/ddi0595/2021-03/AArch64-Registers/PMCCNTR-EL0--Performance-Monitors-Cycle-Count-Register
|
||||||
|
// PMCCNTR_EL0, Performance Monitors Cycle Count Register
|
||||||
|
struct alignas(u64) PMCCNTR_EL0 {
|
||||||
|
u64 CCNT : 64;
|
||||||
|
|
||||||
|
static inline PMCCNTR_EL0 read()
|
||||||
|
{
|
||||||
|
PMCCNTR_EL0 pmccntr_el0;
|
||||||
|
asm volatile("mrs %[value], pmccntr_el0"
|
||||||
|
: [value] "=r"(pmccntr_el0));
|
||||||
|
return pmccntr_el0;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
static_assert(sizeof(PMCCNTR_EL0) == 8);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue