Changeset 6d7ffa65 in mainline for generic/include/mm/page.h


Ignore:
Timestamp:
2006-01-08T15:03:41Z (19 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
1a67595
Parents:
566ba81
Message:

Memory management work.
Move generic 4-level page table interface to genarch
and enable architectures to use different virtual memory
mechanisms (e.g. page hash tables).
Start page hash table support.
Switch ia64 and sparc64 to page hash tables.
Other architectures keep on using 4-level page table interface.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • generic/include/mm/page.h

    r566ba81 r6d7ffa65  
    5656#define PAGE_EXEC               (1<<PAGE_EXEC_SHIFT)
    5757
    58 /*
    59  * This is the generic 4-level page table interface.
    60  * Architectures are supposed to implement *_ARCH macros.
    61  */
     58struct page_operations {
     59        void (* mapping_insert)(__address page, __address frame, int flags, __address root);
     60        pte_t *(* mapping_find)(__address page, __address root);
     61};
     62typedef struct page_operations page_operations_t;
    6263
    63 /*
    64  * These macros process vaddr and extract those portions
    65  * of it that function as indices to respective page tables.
    66  */
    67 #define PTL0_INDEX(vaddr)               PTL0_INDEX_ARCH(vaddr)
    68 #define PTL1_INDEX(vaddr)               PTL1_INDEX_ARCH(vaddr)
    69 #define PTL2_INDEX(vaddr)               PTL2_INDEX_ARCH(vaddr)
    70 #define PTL3_INDEX(vaddr)               PTL3_INDEX_ARCH(vaddr)
    71 
    72 #define GET_PTL0_ADDRESS()              GET_PTL0_ADDRESS_ARCH()
    73 #define SET_PTL0_ADDRESS(ptl0)          SET_PTL0_ADDRESS_ARCH(ptl0)
    74 
    75 /*
    76  * These macros traverse the 4-level tree of page tables,
    77  * each descending by one level.
    78  */
    79 #define GET_PTL1_ADDRESS(ptl0, i)       GET_PTL1_ADDRESS_ARCH(ptl0, i)
    80 #define GET_PTL2_ADDRESS(ptl1, i)       GET_PTL2_ADDRESS_ARCH(ptl1, i)
    81 #define GET_PTL3_ADDRESS(ptl2, i)       GET_PTL3_ADDRESS_ARCH(ptl2, i)
    82 #define GET_FRAME_ADDRESS(ptl3, i)      GET_FRAME_ADDRESS_ARCH(ptl3, i)
    83 
    84 /*
    85  * These macros are provided to change shape of the 4-level
    86  * tree of page tables on respective level.
    87  */
    88 #define SET_PTL1_ADDRESS(ptl0, i, a)    SET_PTL1_ADDRESS_ARCH(ptl0, i, a)
    89 #define SET_PTL2_ADDRESS(ptl1, i, a)    SET_PTL2_ADDRESS_ARCH(ptl1, i, a)
    90 #define SET_PTL3_ADDRESS(ptl2, i, a)    SET_PTL3_ADDRESS_ARCH(ptl2, i, a)
    91 #define SET_FRAME_ADDRESS(ptl3, i, a)   SET_FRAME_ADDRESS_ARCH(ptl3, i, a)
    92 
    93 /*
    94  * These macros are provided to query various flags within the page tables.
    95  */
    96 #define GET_PTL1_FLAGS(ptl0, i)         GET_PTL1_FLAGS_ARCH(ptl0, i)
    97 #define GET_PTL2_FLAGS(ptl1, i)         GET_PTL2_FLAGS_ARCH(ptl1, i)
    98 #define GET_PTL3_FLAGS(ptl2, i)         GET_PTL3_FLAGS_ARCH(ptl2, i)
    99 #define GET_FRAME_FLAGS(ptl3, i)        GET_FRAME_FLAGS_ARCH(ptl3, i)
    100 
    101 /*
    102  * These macros are provided to set/clear various flags within the page tables.
    103  */
    104 #define SET_PTL1_FLAGS(ptl0, i, x)      SET_PTL1_FLAGS_ARCH(ptl0, i, x)
    105 #define SET_PTL2_FLAGS(ptl1, i, x)      SET_PTL2_FLAGS_ARCH(ptl1, i, x)
    106 #define SET_PTL3_FLAGS(ptl2, i, x)      SET_PTL3_FLAGS_ARCH(ptl2, i, x)
    107 #define SET_FRAME_FLAGS(ptl3, i, x)     SET_FRAME_FLAGS_ARCH(ptl3, i, x)
     64extern page_operations_t *page_operations;
    10865
    10966extern void page_init(void);
Note: See TracChangeset for help on using the changeset viewer.