[PARISC] Add STRICT_MM_TYPECHECKS

Add STRICT_MM_TYPECHECKS to page.h as other architectures do.

Signed-off-by: Helge Deller <deller@parisc-linux.org>
Signed-off-by: Kyle McMartin <kyle@parisc-linux.org>
This commit is contained in:
Helge Deller 2006-03-23 15:48:15 -07:00 committed by Kyle McMartin
parent b9e71ac13a
commit b31059f763

View file

@ -40,14 +40,19 @@ clear_user_page(void *page, unsigned long vaddr, struct page *pg)
/* /*
* These are used to make use of C type-checking.. * These are used to make use of C type-checking..
*/ */
#ifdef __LP64__ #define STRICT_MM_TYPECHECKS
typedef struct { unsigned long pte; } pte_t; #ifdef STRICT_MM_TYPECHECKS
#else typedef struct { unsigned long pte;
typedef struct { #if !defined(CONFIG_64BIT)
unsigned long pte; unsigned long future_flags;
unsigned long flags; /* XXX: it's possible to remove future_flags and change BITS_PER_PTE_ENTRY
} pte_t; to 2, but then strangely the identical 32bit kernel boots on a
c3000(pa20), but not any longer on a 715(pa11).
Still investigating... HelgeD.
*/
#endif #endif
} pte_t; /* either 32 or 64bit */
/* NOTE: even on 64 bits, these entries are __u32 because we allocate /* NOTE: even on 64 bits, these entries are __u32 because we allocate
* the pmd and pgd in ZONE_DMA (i.e. under 4GB) */ * the pmd and pgd in ZONE_DMA (i.e. under 4GB) */
typedef struct { __u32 pmd; } pmd_t; typedef struct { __u32 pmd; } pmd_t;
@ -55,25 +60,44 @@ typedef struct { __u32 pgd; } pgd_t;
typedef struct { unsigned long pgprot; } pgprot_t; typedef struct { unsigned long pgprot; } pgprot_t;
#define pte_val(x) ((x).pte) #define pte_val(x) ((x).pte)
#ifdef __LP64__
#define pte_flags(x) (*(__u32 *)&((x).pte))
#else
#define pte_flags(x) ((x).flags)
#endif
/* These do not work lvalues, so make sure we don't use them as such. */ /* These do not work lvalues, so make sure we don't use them as such. */
#define pmd_val(x) ((x).pmd + 0) #define pmd_val(x) ((x).pmd + 0)
#define pgd_val(x) ((x).pgd + 0) #define pgd_val(x) ((x).pgd + 0)
#define pgprot_val(x) ((x).pgprot) #define pgprot_val(x) ((x).pgprot)
#define __pmd_val_set(x,n) (x).pmd = (n)
#define __pgd_val_set(x,n) (x).pgd = (n)
#define __pte(x) ((pte_t) { (x) } ) #define __pte(x) ((pte_t) { (x) } )
#define __pmd(x) ((pmd_t) { (x) } ) #define __pmd(x) ((pmd_t) { (x) } )
#define __pgd(x) ((pgd_t) { (x) } ) #define __pgd(x) ((pgd_t) { (x) } )
#define __pgprot(x) ((pgprot_t) { (x) } ) #define __pgprot(x) ((pgprot_t) { (x) } )
#define __pmd_val_set(x,n) (x).pmd = (n)
#define __pgd_val_set(x,n) (x).pgd = (n)
#else
/*
* .. while these make it easier on the compiler
*/
typedef unsigned long pte_t;
typedef __u32 pmd_t;
typedef __u32 pgd_t;
typedef unsigned long pgprot_t;
#define pte_val(x) (x)
#define pmd_val(x) (x)
#define pgd_val(x) (x)
#define pgprot_val(x) (x)
#define __pte(x) (x)
#define __pmd(x) (x)
#define __pgd(x) (x)
#define __pgprot(x) (x)
#define __pmd_val_set(x,n) (x) = (n)
#define __pgd_val_set(x,n) (x) = (n)
#endif /* STRICT_MM_TYPECHECKS */
typedef struct __physmem_range { typedef struct __physmem_range {
unsigned long start_pfn; unsigned long start_pfn;
unsigned long pages; /* PAGE_SIZE pages */ unsigned long pages; /* PAGE_SIZE pages */