mirror of
https://github.com/ps5-linux/ps5-linux-loader.git
synced 2026-07-15 21:42:27 +00:00
some more tyding
This commit is contained in:
@@ -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