Ignore:
Timestamp:
2018-03-16T20:57:16Z (6 years ago)
Author:
Jiří Zárevúcky <zarevucky.jiri@…>
Children:
6be2c13
Parents:
973be387
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-16 20:51:59)
git-committer:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-16 20:57:16)
Message:

Clean up PAGE_* flags.

Remove "nop flags", they are confusing for readers and any benefit they would
gain in self-documentation they lose in being used inconsistently.

Remove "PAGE_READ", the only place it's used meaningfully is the incomplete
RISC-V implementation, and most call sites assume read is implied.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/riscv64/include/arch/mm/page.h

    r973be387 r4b1c7c6f  
    8282
    8383/* Flags mask for non-leaf page table entries */
    84 #define NON_LEAF_MASK  (~(PAGE_READ | PAGE_WRITE | PAGE_EXEC))
     84#define NON_LEAF_MASK  (~(PAGE_WRITE | PAGE_EXEC))
    8585
    8686/* Get PTE address accessors for each level. */
     
    183183        pte_t *entry = &pt[i];
    184184
    185         return (((!entry->valid) << PAGE_PRESENT_SHIFT) |
     185        return (((!entry->valid) << PAGE_NOT_PRESENT_SHIFT) |
    186186            (entry->user << PAGE_USER_SHIFT) |
    187             (entry->readable << PAGE_READ_SHIFT) |
    188187            (entry->writable << PAGE_WRITE_SHIFT) |
    189188            (entry->executable << PAGE_EXEC_SHIFT) |
     
    196195
    197196        entry->valid = !(flags & PAGE_NOT_PRESENT);
    198         entry->readable = (flags & PAGE_READ) != 0;
     197        entry->readable = 1;
    199198        entry->writable = (flags & PAGE_WRITE) != 0;
    200199        entry->executable = (flags & PAGE_EXEC) != 0;
Note: See TracChangeset for help on using the changeset viewer.