git://scm.lunaixsky.com
/
lunaix-os.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix: the correct way to detect ahci LBA48 support
[lunaix-os.git]
/
lunaix-os
/
hal
/
cpu.c
diff --git
a/lunaix-os/hal/cpu.c
b/lunaix-os/hal/cpu.c
index 9517445e1e2b31938391c86254f3ffffd9fb4452..b8a5e9b422f510dda9e226de403616606b6f7ccf 100644
(file)
--- a/
lunaix-os/hal/cpu.c
+++ b/
lunaix-os/hal/cpu.c
@@
-1,5
+1,6
@@
#include <cpuid.h>
#include <hal/cpu.h>
#include <cpuid.h>
#include <hal/cpu.h>
+#include <hal/rnd.h>
#include <stdint.h>
void
#include <stdint.h>
void
@@
-69,4
+70,12
@@
void
cpu_wrmsr(u32_t msr_idx, u32_t reg_high, u32_t reg_low)
{
asm volatile("wrmsr" : : "d"(reg_high), "a"(reg_low), "c"(msr_idx));
cpu_wrmsr(u32_t msr_idx, u32_t reg_high, u32_t reg_low)
{
asm volatile("wrmsr" : : "d"(reg_high), "a"(reg_low), "c"(msr_idx));
+}
+
+int
+rnd_is_supported()
+{
+ reg32 eax, ebx, ecx, edx;
+ __get_cpuid(0x01, &eax, &ebx, &ecx, &edx);
+ return (ecx & (1 << 30));
}
\ No newline at end of file
}
\ No newline at end of file