Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 0747468 in mainline for kernel/arch/arm32/include/mm/page.h


Ignore:
Timestamp:
2012-07-14T09:27:31Z (10 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial
Children:
97c7682
Parents:
ee685630
Message:

arm32: Move common definitions to common header.

Restrict including of arch specific headers.

File:
1 edited

Legend:

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

    ree685630 r0747468  
    3737#define KERN_arm32_PAGE_H_
    3838
     39#include <arch/mm/frame.h>
     40#include <mm/mm.h>
     41#include <arch/exception.h>
     42#include <trace.h>
     43
     44#define PAGE_WIDTH      FRAME_WIDTH
     45#define PAGE_SIZE       FRAME_SIZE
     46
    3947#ifdef MACHINE_beagleboardxm
    4048#ifndef __ASM__
     
    5563#endif
    5664
     65/* Number of entries in each level. */
     66#define PTL0_ENTRIES_ARCH       (1 << 12)       /* 4096 */
     67#define PTL1_ENTRIES_ARCH       0
     68#define PTL2_ENTRIES_ARCH       0
     69/* coarse page tables used (256 * 4 = 1KB per page) */
     70#define PTL3_ENTRIES_ARCH       (1 << 8)        /* 256 */
     71
     72/* Page table sizes for each level. */
     73#define PTL0_SIZE_ARCH          FOUR_FRAMES
     74#define PTL1_SIZE_ARCH          0
     75#define PTL2_SIZE_ARCH          0
     76#define PTL3_SIZE_ARCH          ONE_FRAME
     77
     78/* Macros calculating indices into page tables for each level. */
     79#define PTL0_INDEX_ARCH(vaddr)  (((vaddr) >> 20) & 0xfff)
     80#define PTL1_INDEX_ARCH(vaddr)  0
     81#define PTL2_INDEX_ARCH(vaddr)  0
     82#define PTL3_INDEX_ARCH(vaddr)  (((vaddr) >> 12) & 0x0ff)
     83
     84/* Get PTE address accessors for each level. */
     85#define GET_PTL1_ADDRESS_ARCH(ptl0, i) \
     86        ((pte_t *) ((((pte_t *)(ptl0))[(i)].l0).coarse_table_addr << 10))
     87#define GET_PTL2_ADDRESS_ARCH(ptl1, i) \
     88        (ptl1)
     89#define GET_PTL3_ADDRESS_ARCH(ptl2, i) \
     90        (ptl2)
     91#define GET_FRAME_ADDRESS_ARCH(ptl3, i) \
     92        ((uintptr_t) ((((pte_t *)(ptl3))[(i)].l1).frame_base_addr << 12))
     93
     94/* Set PTE address accessors for each level. */
     95#define SET_PTL0_ADDRESS_ARCH(ptl0) \
     96        (set_ptl0_addr((pte_t *) (ptl0)))
     97#define SET_PTL1_ADDRESS_ARCH(ptl0, i, a) \
     98        (((pte_t *) (ptl0))[(i)].l0.coarse_table_addr = (a) >> 10)
     99#define SET_PTL2_ADDRESS_ARCH(ptl1, i, a)
     100#define SET_PTL3_ADDRESS_ARCH(ptl2, i, a)
     101#define SET_FRAME_ADDRESS_ARCH(ptl3, i, a) \
     102        (((pte_t *) (ptl3))[(i)].l1.frame_base_addr = (a) >> 12)
     103
     104/* Get PTE flags accessors for each level. */
     105#define GET_PTL1_FLAGS_ARCH(ptl0, i) \
     106        get_pt_level0_flags((pte_t *) (ptl0), (size_t) (i))
     107#define GET_PTL2_FLAGS_ARCH(ptl1, i) \
     108        PAGE_PRESENT
     109#define GET_PTL3_FLAGS_ARCH(ptl2, i) \
     110        PAGE_PRESENT
     111#define GET_FRAME_FLAGS_ARCH(ptl3, i) \
     112        get_pt_level1_flags((pte_t *) (ptl3), (size_t) (i))
     113
     114/* Set PTE flags accessors for each level. */
     115#define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \
     116        set_pt_level0_flags((pte_t *) (ptl0), (size_t) (i), (x))
     117#define SET_PTL2_FLAGS_ARCH(ptl1, i, x)
     118#define SET_PTL3_FLAGS_ARCH(ptl2, i, x)
     119#define SET_FRAME_FLAGS_ARCH(ptl3, i, x) \
     120        set_pt_level1_flags((pte_t *) (ptl3), (size_t) (i), (x))
     121
    57122#if defined(PROCESSOR_armv7_a)
    58123#include "page_armv7.h"
Note: See TracChangeset for help on using the changeset viewer.