mirror of
https://github.com/ps5-linux/ps5-linux-loader.git
synced 2026-10-21 10:40:53 -05:00
some more tyding
This commit is contained in:
1 parent
e439d8d36a
commit
9d58e22a77
10 files changed
+168
-196
No files matched your search
@@ -16,20 +16,18 @@ void memcpy(void *dest, void *src, uint64_t len) {
|
||||
uint64_t read_cr3(void) {
|
||||
uint64_t cr3;
|
||||
__asm__ volatile("mov %%cr3, %0"
|
||||
: "=r"(cr3) // Output: move CR3 into the variable 'cr3'
|
||||
: // No inputs
|
||||
: // No clobbered registers
|
||||
: "=r"(cr3)
|
||||
:
|
||||
:
|
||||
);
|
||||
return cr3;
|
||||
}
|
||||
|
||||
// for ring0
|
||||
uint64_t va_to_pa_kernel(uint64_t va) {
|
||||
uint64_t cr3 = read_cr3();
|
||||
return va_to_pa_custom(va, cr3);
|
||||
}
|
||||
|
||||
// Source: PS5_kldload
|
||||
uint64_t va_to_pa_custom(uint64_t va, uint64_t cr3_custom) {
|
||||
uint64_t table_phys = cr3_custom & 0xFFFFFFFF;
|
||||
|
||||
|
||||
Reference in new issue
Block a user