mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 20:25:07 +00:00
Kernel: Consolidate features into CPUFeature enum
This allows us to consolidate printing out all the CPU features into one log statement. Also expose them in /proc/cpuinfo
This commit is contained in:
parent
e373e5f007
commit
9b4e6f6a23
9 changed files with 197 additions and 145 deletions
|
@ -44,10 +44,12 @@ KernelRng& KernelRng::the()
|
|||
|
||||
KernelRng::KernelRng()
|
||||
{
|
||||
if (g_cpu_supports_rdseed || g_cpu_supports_rdrand) {
|
||||
bool supports_rdseed = Processor::current().has_feature(CPUFeature::RDSEED);
|
||||
bool supports_rdrand = Processor::current().has_feature(CPUFeature::RDRAND);
|
||||
if (supports_rdseed || supports_rdrand) {
|
||||
for (size_t i = 0; i < resource().pool_count * resource().reseed_threshold; ++i) {
|
||||
u32 value = 0;
|
||||
if (g_cpu_supports_rdseed) {
|
||||
if (supports_rdseed) {
|
||||
asm volatile(
|
||||
"1:\n"
|
||||
"rdseed %0\n"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue