arm64: Fix physical page memcpy operations.
Change-Id: Ie1a0fafad2b71f964292c14b1934d9406b3c015c Reviewed-on: https://review.haiku-os.org/c/haiku/+/8101 Reviewed-by: waddlesplash <[email protected]> Tested-by: Commit checker robot <[email protected]> Haiku-Format: Haiku-format Bot <[email protected]>
This commit is contained in:
committed by
waddlesplash
parent
9d4d102df2
commit
81af091961
@@ -9,6 +9,7 @@
|
|||||||
#define CPU_MAX_CACHE_LEVEL 8
|
#define CPU_MAX_CACHE_LEVEL 8
|
||||||
#define CACHE_LINE_SIZE 64
|
#define CACHE_LINE_SIZE 64
|
||||||
|
|
||||||
|
// TODO: These will require a real implementation when PAN is enabled
|
||||||
#define set_ac()
|
#define set_ac()
|
||||||
#define clear_ac()
|
#define clear_ac()
|
||||||
|
|
||||||
|
|||||||
@@ -34,28 +34,31 @@ PMAPPhysicalPageMapper::MemsetPhysical(phys_addr_t address, int value, phys_size
|
|||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
PMAPPhysicalPageMapper::MemcpyFromPhysical(void* to, phys_addr_t from, size_t length, bool user)
|
PMAPPhysicalPageMapper::MemcpyFromPhysical(void* to, phys_addr_t from, size_t length, bool user)
|
||||||
{
|
{
|
||||||
if (user)
|
|
||||||
panic("MemcpyFromPhysical user not impl");
|
|
||||||
|
|
||||||
ASSERT(from < KERNEL_PMAP_SIZE);
|
ASSERT(from < KERNEL_PMAP_SIZE);
|
||||||
memcpy(to, reinterpret_cast<void*>(KERNEL_PMAP_BASE + from), length);
|
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
|
memcpy(to, reinterpret_cast<void*>(KERNEL_PMAP_BASE + from), length);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
} else {
|
||||||
|
return user_memcpy(to, reinterpret_cast<void*>(KERNEL_PMAP_BASE + from), length);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
PMAPPhysicalPageMapper::MemcpyToPhysical(phys_addr_t to, const void* from, size_t length, bool user)
|
PMAPPhysicalPageMapper::MemcpyToPhysical(phys_addr_t to, const void* from, size_t length, bool user)
|
||||||
{
|
{
|
||||||
if (user)
|
|
||||||
panic("MemcpyToPhysical user not impl");
|
|
||||||
|
|
||||||
ASSERT(to < KERNEL_PMAP_SIZE);
|
ASSERT(to < KERNEL_PMAP_SIZE);
|
||||||
|
|
||||||
|
if (!user) {
|
||||||
memcpy(reinterpret_cast<void*>(KERNEL_PMAP_BASE + to), from, length);
|
memcpy(reinterpret_cast<void*>(KERNEL_PMAP_BASE + to), from, length);
|
||||||
|
return B_OK;
|
||||||
|
} else {
|
||||||
|
return user_memcpy(reinterpret_cast<void*>(KERNEL_PMAP_BASE + to), from, length);
|
||||||
|
}
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user