]> git.corax.cc Git - corax/commitdiff
Make sure PAGE_ATTR_USER is set on page tables when we're mapping something with...
authorMatthias Kruk <m@m10k.eu>
Wed, 25 Sep 2019 10:03:51 +0000 (19:03 +0900)
committerMatthias Kruk <m@m10k.eu>
Wed, 25 Sep 2019 10:03:51 +0000 (19:03 +0900)
kernel/arch/paging.c

index 7f5a6242c48c1c604b83ee16bcb042cf562cab26..222df81d3f8f375af40468c595c578aa48e8715e 100644 (file)
@@ -723,6 +723,11 @@ static int _pg_dir_map_legacy(page_table_t *pd, u32_t paddr, u32_t vaddr,
 
                pt = (page_table_t*)(pd->pt_entries[pde] & 0xfffff000);
 
+               /* make sure PAGE_ATTR_USER is set on the page table, if necessary */
+               if(flags & PAGE_ATTR_USER) {
+                       pd->pt_entries[pde] |= PAGE_ATTR_USER;
+               }
+
                if(pt->pt_entries[pte] & PAGE_ATTR_PRESENT) {
                        ret_val = -EALREADY;
                        break;