mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
fb: do WC in shared mappings instead of private
This commit is contained in:
+2
-2
@@ -144,7 +144,7 @@ static int mmap(int minor, void *addr, uintmax_t offset, int flags) {
|
|||||||
if (flags & V_FFLAGS_SHARED) {
|
if (flags & V_FFLAGS_SHARED) {
|
||||||
// make sure offset is ALWAYS page aligned when doing a shared mapping
|
// make sure offset is ALWAYS page aligned when doing a shared mapping
|
||||||
__assert((offset % PAGE_SIZE) == 0);
|
__assert((offset % PAGE_SIZE) == 0);
|
||||||
return arch_mmu_map(current_mm_context()->pagetable, FROM_HHDM((void *)((uintptr_t)fbs[minor]->address + offset)), addr, mm_vnode_flags_to_mmu_flags(flags)) ? 0 : ENOMEM;
|
return arch_mmu_map(current_mm_context()->pagetable, FROM_HHDM((void *)((uintptr_t)fbs[minor]->address + offset)), addr, mm_vnode_flags_to_mmu_flags(flags) | ARCH_MMU_FLAGS_WC) ? 0 : ENOMEM;
|
||||||
} else {
|
} else {
|
||||||
size_t size = offset + PAGE_SIZE < end ? PAGE_SIZE : end - offset;
|
size_t size = offset + PAGE_SIZE < end ? PAGE_SIZE : end - offset;
|
||||||
paddr = mm_alloc_page(MEMORY_SECTION_DEFAULT);
|
paddr = mm_alloc_page(MEMORY_SECTION_DEFAULT);
|
||||||
@@ -153,7 +153,7 @@ static int mmap(int minor, void *addr, uintmax_t offset, int flags) {
|
|||||||
|
|
||||||
memcpy(MAKE_HHDM(paddr), (void *)((uintptr_t)fbs[minor]->address + offset), size);
|
memcpy(MAKE_HHDM(paddr), (void *)((uintptr_t)fbs[minor]->address + offset), size);
|
||||||
|
|
||||||
if (arch_mmu_map(current_mm_context()->pagetable, paddr, addr, mm_vnode_flags_to_mmu_flags(flags) | ARCH_MMU_FLAGS_WC) == false) {
|
if (arch_mmu_map(current_mm_context()->pagetable, paddr, addr, mm_vnode_flags_to_mmu_flags(flags)) == false) {
|
||||||
mm_release_page(paddr);
|
mm_release_page(paddr);
|
||||||
return ENOMEM;
|
return ENOMEM;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user