Changeset dc05a9a in mainline


Ignore:
Timestamp:
2016-08-31T14:12:45Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
38dc82d
Parents:
7a67416
Message:

Fix PTE_VALID_ARCH macros

The PTE_VALID_ARCH macros are rewritten so that they don't break the
anti-aliasing rules. The page_ht PTE_VALID_ARCH is modified not to
trigger always-true warnings.

Location:
kernel
Files:
9 edited

Legend:

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

    r7a67416 rdc05a9a  
    115115/* Macros for querying the last level entries. */
    116116#define PTE_VALID_ARCH(p) \
    117         (*((uint32_t *) (p)) != 0)
     117        ((p)->soft_valid != 0)
    118118#define PTE_PRESENT_ARCH(p) \
    119119        ((p)->present != 0)
  • kernel/arch/amd64/include/arch/mm/page.h

    r7a67416 rdc05a9a  
    131131/* Macros for querying the last-level PTE entries. */
    132132#define PTE_VALID_ARCH(p) \
    133         (*((uint64_t *) (p)) != 0)
     133        ((p)->soft_valid != 0)
    134134#define PTE_PRESENT_ARCH(p) \
    135135        ((p)->present != 0)
  • kernel/arch/arm32/include/arch/mm/page_armv4.h

    r7a67416 rdc05a9a  
    4444/* Macros for querying the last-level PTE entries. */
    4545#define PTE_VALID_ARCH(pte) \
    46         (*((uint32_t *) (pte)) != 0)
     46        (((pte_t *) (pte))->l0.should_be_zero != 0 || PTE_PRESENT_ARCH(pte))
    4747#define PTE_PRESENT_ARCH(pte) \
    4848        (((pte_t *) (pte))->l0.descriptor_type != 0)
  • kernel/arch/arm32/include/arch/mm/page_armv6.h

    r7a67416 rdc05a9a  
    4444/* Macros for querying the last-level PTE entries. */
    4545#define PTE_VALID_ARCH(pte) \
    46         (*((uint32_t *) (pte)) != 0)
     46        (((pte_t *) (pte))->l0.should_be_zero_0 != 0 || PTE_PRESENT_ARCH(pte))
    4747#define PTE_PRESENT_ARCH(pte) \
    4848        (((pte_t *) (pte))->l0.descriptor_type != 0)
  • kernel/arch/ia32/include/arch/mm/page.h

    r7a67416 rdc05a9a  
    132132/* Macros for querying the last level entries. */
    133133#define PTE_VALID_ARCH(p) \
    134         (*((uint32_t *) (p)) != 0)
     134        ((p)->soft_valid != 0)
    135135#define PTE_PRESENT_ARCH(p) \
    136136        ((p)->present != 0)
  • kernel/arch/mips32/include/arch/mm/page.h

    r7a67416 rdc05a9a  
    137137
    138138/* Last-level info macros. */
    139 #define PTE_VALID_ARCH(pte)                     (*((uint32_t *) (pte)) != 0)
    140 #define PTE_PRESENT_ARCH(pte)                   ((pte)->p != 0)
    141 #define PTE_GET_FRAME_ARCH(pte)                 ((pte)->pfn << 12)
    142 #define PTE_WRITABLE_ARCH(pte)                  ((pte)->w != 0)
    143 #define PTE_EXECUTABLE_ARCH(pte)                1
     139#define PTE_VALID_ARCH(pte)             ((pte)->soft_valid != 0)
     140#define PTE_PRESENT_ARCH(pte)           ((pte)->p != 0)
     141#define PTE_GET_FRAME_ARCH(pte)         ((pte)->pfn << 12)
     142#define PTE_WRITABLE_ARCH(pte)          ((pte)->w != 0)
     143#define PTE_EXECUTABLE_ARCH(pte)        1
    144144
    145145#ifndef __ASM__
  • kernel/arch/ppc32/include/arch/mm/page.h

    r7a67416 rdc05a9a  
    140140
    141141/* Macros for querying the last-level PTEs. */
    142 #define PTE_VALID_ARCH(pte)       (*((uint32_t *) (pte)) != 0)
     142#define PTE_VALID_ARCH(pte)       ((pte)->valid != 0)
    143143#define PTE_PRESENT_ARCH(pte)     ((pte)->present != 0)
    144144#define PTE_GET_FRAME_ARCH(pte)   ((pte)->pfn << 12)
  • kernel/arch/sparc32/include/arch/mm/page.h

    r7a67416 rdc05a9a  
    129129/* Macros for querying the last level entries. */
    130130#define PTE_VALID_ARCH(p) \
    131         (*((uint32_t *) (p)) != 0)
     131        ((p)->et != PTE_ET_INVALID)
    132132#define PTE_PRESENT_ARCH(p) \
    133133        ((p)->et != 0)
  • kernel/genarch/include/genarch/mm/page_ht.h

    r7a67416 rdc05a9a  
    5555
    5656/* Macros for querying page hash table PTEs. */
    57 #define PTE_VALID(pte)       ((pte) != NULL)
     57#define PTE_VALID(pte)       ((void *) (pte) != NULL)
    5858#define PTE_PRESENT(pte)     ((pte)->p != 0)
    5959#define PTE_GET_FRAME(pte)   ((pte)->frame)
Note: See TracChangeset for help on using the changeset viewer.