X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=include%2Fasm-ppc64%2Fmmu.h;h=616389dc82661f2b225f40c038fbd7e84183f60d;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=3b66f32b6cc8c0e6cebe1399ce002465a94494d0;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/include/asm-ppc64/mmu.h b/include/asm-ppc64/mmu.h index 3b66f32b6..616389dc8 100644 --- a/include/asm-ppc64/mmu.h +++ b/include/asm-ppc64/mmu.h @@ -15,6 +15,7 @@ #include #include +#include #ifndef __ASSEMBLY__ @@ -27,43 +28,17 @@ typedef struct { #endif } mm_context_t; -#ifdef CONFIG_HUGETLB_PAGE -#define KERNEL_LOW_HPAGES .htlb_segs = 0, -#else -#define KERNEL_LOW_HPAGES -#endif +#define STE_ESID_V 0x80 +#define STE_ESID_KS 0x20 +#define STE_ESID_KP 0x10 +#define STE_ESID_N 0x08 -#define KERNEL_CONTEXT(ea) ({ \ - mm_context_t ctx = { .id = REGION_ID(ea), KERNEL_LOW_HPAGES}; \ - ctx; }) - -typedef struct { - unsigned long esid: 36; /* Effective segment ID */ - unsigned long resv0:20; /* Reserved */ - unsigned long v: 1; /* Entry valid (v=1) or invalid */ - unsigned long resv1: 1; /* Reserved */ - unsigned long ks: 1; /* Supervisor (privileged) state storage key */ - unsigned long kp: 1; /* Problem state storage key */ - unsigned long n: 1; /* No-execute if n=1 */ - unsigned long resv2: 3; /* padding to a 64b boundary */ -} ste_dword0; - -typedef struct { - unsigned long vsid: 52; /* Virtual segment ID */ - unsigned long resv0:12; /* Padding to a 64b boundary */ -} ste_dword1; - -typedef struct _STE { - union { - unsigned long dword0; - ste_dword0 dw0; - } dw0; +#define STE_VSID_SHIFT 12 - union { - unsigned long dword1; - ste_dword1 dw1; - } dw1; -} STE; +struct stab_entry { + unsigned long esid_data; + unsigned long vsid_data; +}; /* Hardware Page Table Entry */ @@ -132,20 +107,6 @@ typedef struct { extern HTAB htab_data; -void invalidate_hpte( unsigned long slot ); -long select_hpte_slot( unsigned long vpn ); -void create_valid_hpte( unsigned long slot, unsigned long vpn, - unsigned long prpn, unsigned hash, - void * ptep, unsigned hpteflags, - unsigned bolted ); - -#define PD_SHIFT (10+12) /* Page directory */ -#define PD_MASK 0x02FF -#define PT_SHIFT (12) /* Page Table */ -#define PT_MASK 0x02FF - -#define LARGE_PAGE_SHIFT 24 - static inline unsigned long hpt_hash(unsigned long vpn, int large) { unsigned long vsid; @@ -224,7 +185,7 @@ extern void htab_finish_init(void); #define STAB0_PHYS_ADDR (STAB0_PAGE<= \ + * 2^36-1, then r3+1 has the 2^36 bit set. So, if r3+1 has \ + * the bit clear, r3 already has the answer we want, if it \ + * doesn't, the answer is the low 36 bits of r3+1. So in all \ + * cases the answer is the low 36 bits of (r3 + ((r3+1) >> 36))*/\ + addi rx,rt,1; \ + srdi rx,rx,VSID_BITS; /* extract 2^36 bit */ \ + add rt,rt,rx #endif /* _PPC64_MMU_H_ */