Changeset 89c57b6 in mainline for kernel/arch/ia32/include/mm/page.h


Ignore:
Timestamp:
2011-04-13T14:45:41Z (14 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
88634420
Parents:
cefb126 (diff), 17279ead (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes.

File:
1 edited

Legend:

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

    rcefb126 r89c57b6  
    2727 */
    2828
    29 /** @addtogroup ia32mm 
     29/** @addtogroup ia32mm
    3030 * @{
    3131 */
     
    3737
    3838#include <arch/mm/frame.h>
    39 
    40 #define PAGE_WIDTH      FRAME_WIDTH
    41 #define PAGE_SIZE       FRAME_SIZE
     39#include <trace.h>
     40
     41#define PAGE_WIDTH  FRAME_WIDTH
     42#define PAGE_SIZE   FRAME_SIZE
    4243
    4344#ifdef KERNEL
    4445
    4546#ifndef __ASM__
    46 #       define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
    47 #       define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
    48 #else
    49 #       define KA2PA(x) ((x) - 0x80000000)
    50 #       define PA2KA(x) ((x) + 0x80000000)
    51 #endif
     47
     48#define KA2PA(x)  (((uintptr_t) (x)) - UINT32_C(0x80000000))
     49#define PA2KA(x)  (((uintptr_t) (x)) + UINT32_C(0x80000000))
     50
     51#else /* __ASM__ */
     52
     53#define KA2PA(x)  ((x) - 0x80000000)
     54#define PA2KA(x)  ((x) + 0x80000000)
     55
     56#endif /* __ASM__ */
    5257
    5358/*
     
    5762
    5863/* Number of entries in each level. */
    59 #define PTL0_ENTRIES_ARCH       1024
    60 #define PTL1_ENTRIES_ARCH       0
    61 #define PTL2_ENTRIES_ARCH       0
    62 #define PTL3_ENTRIES_ARCH       1024
     64#define PTL0_ENTRIES_ARCH  1024
     65#define PTL1_ENTRIES_ARCH  0
     66#define PTL2_ENTRIES_ARCH  0
     67#define PTL3_ENTRIES_ARCH  1024
    6368
    6469/* Page table sizes for each level. */
    65 #define PTL0_SIZE_ARCH          ONE_FRAME
    66 #define PTL1_SIZE_ARCH          0
    67 #define PTL2_SIZE_ARCH          0
    68 #define PTL3_SIZE_ARCH          ONE_FRAME
     70#define PTL0_SIZE_ARCH  ONE_FRAME
     71#define PTL1_SIZE_ARCH  0
     72#define PTL2_SIZE_ARCH  0
     73#define PTL3_SIZE_ARCH  ONE_FRAME
    6974
    7075/* Macros calculating indices for each level. */
    71 #define PTL0_INDEX_ARCH(vaddr)  (((vaddr) >> 22) & 0x3ff)
    72 #define PTL1_INDEX_ARCH(vaddr)  0
    73 #define PTL2_INDEX_ARCH(vaddr)  0
    74 #define PTL3_INDEX_ARCH(vaddr)  (((vaddr) >> 12) & 0x3ff)
     76#define PTL0_INDEX_ARCH(vaddr)  (((vaddr) >> 22) & 0x3ffU)
     77#define PTL1_INDEX_ARCH(vaddr)  0
     78#define PTL2_INDEX_ARCH(vaddr)  0
     79#define PTL3_INDEX_ARCH(vaddr)  (((vaddr) >> 12) & 0x3ffU)
    7580
    7681/* Get PTE address accessors for each level. */
     
    105110
    106111/* Set PTE flags accessors for each level. */
    107 #define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \
     112#define SET_PTL1_FLAGS_ARCH(ptl0, i, x) \
    108113        set_pt_flags((pte_t *) (ptl0), (size_t) (i), (x))
    109114#define SET_PTL2_FLAGS_ARCH(ptl1, i, x)
     
    121126#define PTE_WRITABLE_ARCH(p) \
    122127        ((p)->writeable != 0)
    123 #define PTE_EXECUTABLE_ARCH(p)                  1
     128#define PTE_EXECUTABLE_ARCH(p)  1
    124129
    125130#ifndef __ASM__
     
    143148
    144149/** When bit on this position is 1, a reserved bit was set in page directory. */
    145 #define PFERR_CODE_RSVD         (1 << 3)       
     150#define PFERR_CODE_RSVD         (1 << 3)
    146151
    147152/** Page Table Entry. */
     
    161166} __attribute__ ((packed)) pte_t;
    162167
    163 static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
     168NO_TRACE static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
    164169{
    165170        pte_t *p = &pt[i];
     
    174179}
    175180
    176 static inline void set_pt_flags(pte_t *pt, size_t i, int flags)
     181NO_TRACE static inline void set_pt_flags(pte_t *pt, size_t i, int flags)
    177182{
    178183        pte_t *p = &pt[i];
Note: See TracChangeset for help on using the changeset viewer.