1 /* $Id: page.h,v 1.24 1998/10/20 03:09:16 jj Exp $ */
3 #ifndef _SPARC64_PAGE_H
4 #define _SPARC64_PAGE_H
8 /* I have my suspicions... -DaveM */
9 #define PAGE_SIZE (1UL << PAGE_SHIFT)
11 #define PAGE_SIZE (1 << PAGE_SHIFT)
14 #define PAGE_MASK (~(PAGE_SIZE-1))
21 extern void clear_page(unsigned long page
);
22 extern void copy_page(unsigned long to
, unsigned long from
);
24 /* GROSS, defining this makes gcc pass these types as aggregates,
25 * and thus on the stack, turn this crap off... -DaveM
28 /* #define STRICT_MM_TYPECHECKS */
30 #ifdef STRICT_MM_TYPECHECKS
31 /* These are used to make use of C type-checking.. */
32 typedef struct { unsigned long pte
; } pte_t
;
33 typedef struct { unsigned long iopte
; } iopte_t
;
34 typedef struct { unsigned int pmd
; } pmd_t
;
35 typedef struct { unsigned int pgd
; } pgd_t
;
36 typedef struct { unsigned long ctxd
; } ctxd_t
;
37 typedef struct { unsigned long pgprot
; } pgprot_t
;
38 typedef struct { unsigned long iopgprot
; } iopgprot_t
;
40 #define pte_val(x) ((x).pte)
41 #define iopte_val(x) ((x).iopte)
42 #define pmd_val(x) ((unsigned long)(x).pmd)
43 #define pgd_val(x) ((unsigned long)(x).pgd)
44 #define ctxd_val(x) ((x).ctxd)
45 #define pgprot_val(x) ((x).pgprot)
46 #define iopgprot_val(x) ((x).iopgprot)
48 #define __pte(x) ((pte_t) { (x) } )
49 #define __iopte(x) ((iopte_t) { (x) } )
50 #define __pmd(x) ((pmd_t) { (x) } )
51 #define __pgd(x) ((pgd_t) { (x) } )
52 #define __ctxd(x) ((ctxd_t) { (x) } )
53 #define __pgprot(x) ((pgprot_t) { (x) } )
54 #define __iopgprot(x) ((iopgprot_t) { (x) } )
57 /* .. while these make it easier on the compiler */
58 typedef unsigned long pte_t
;
59 typedef unsigned long iopte_t
;
60 typedef unsigned int pmd_t
;
61 typedef unsigned int pgd_t
;
62 typedef unsigned long ctxd_t
;
63 typedef unsigned long pgprot_t
;
64 typedef unsigned long iopgprot_t
;
66 #define pte_val(x) (x)
67 #define iopte_val(x) (x)
68 #define pmd_val(x) ((unsigned long)(x))
69 #define pgd_val(x) ((unsigned long)(x))
70 #define ctxd_val(x) (x)
71 #define pgprot_val(x) (x)
72 #define iopgprot_val(x) (x)
75 #define __iopte(x) (x)
79 #define __pgprot(x) (x)
80 #define __iopgprot(x) (x)
82 #endif /* (STRICT_MM_TYPECHECKS) */
84 #define TASK_UNMAPPED_BASE ((current->tss.flags & SPARC_FLAG_32BIT) ? \
85 (0x0000000070000000UL) : (PAGE_OFFSET))
87 #endif /* !(__ASSEMBLY__) */
89 /* to align the pointer to the (next) page boundary */
90 #define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)
93 /* Do prdele, look what happens to be in %g4... */
94 register unsigned long page_offset
asm("g4");
95 #define PAGE_OFFSET page_offset
97 #define PAGE_OFFSET 0xFFFFF80000000000
100 #define __pa(x) ((unsigned long)(x) - PAGE_OFFSET)
101 #define __va(x) ((void *)((unsigned long) (x) + PAGE_OFFSET))
102 #define MAP_NR(addr) (__pa(addr) >> PAGE_SHIFT)
106 /* The following structure is used to hold the physical
107 * memory configuration of the machine. This is filled in
108 * probe_memory() and is later used by mem_init() to set up
109 * mem_map[]. We statically allocate SPARC_PHYS_BANKS of
110 * these structs, this is arbitrary. The entry after the
111 * last valid one has num_bytes==0.
114 struct sparc_phys_banks
{
115 unsigned long base_addr
;
116 unsigned long num_bytes
;
119 #define SPARC_PHYS_BANKS 32
121 extern struct sparc_phys_banks sp_banks
[SPARC_PHYS_BANKS
];
123 #endif /* !(__ASSEMBLY__) */
125 #endif /* !(__KERNEL__) */
127 #endif /* !(_SPARC64_PAGE_H) */