]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - include/asm-powerpc/mmu-hash32.h
uninline arch_pick_mmap_layout()
[linux-2.6-omap-h63xx.git] / include / asm-powerpc / mmu-hash32.h
index 2d3e183cfeb56f33efd99f73f75d50c8305216cc..16b1a1e77e64e5b5adeaba606db3aee1047f29c1 100644 (file)
 #define BPP_RW 0x02            /* Read/write */
 
 #ifndef __ASSEMBLY__
-typedef struct _BAT {
-       struct {
-               unsigned long bepi:15;  /* Effective page index (virtual address) */
-               unsigned long :4;       /* Unused */
-               unsigned long bl:11;    /* Block size mask */
-               unsigned long vs:1;     /* Supervisor valid */
-               unsigned long vp:1;     /* User valid */
-       } batu;                 /* Upper register */
-       struct {
-               unsigned long brpn:15;  /* Real page index (physical address) */
-               unsigned long :10;      /* Unused */
-               unsigned long w:1;      /* Write-thru cache */
-               unsigned long i:1;      /* Cache inhibit */
-               unsigned long m:1;      /* Memory coherence */
-               unsigned long g:1;      /* Guarded (MBZ in IBAT) */
-               unsigned long :1;       /* Unused */
-               unsigned long pp:2;     /* Page access protections */
-       } batl;                 /* Lower register */
-} BAT;
+/* Contort a phys_addr_t into the right format/bits for a BAT */
+#ifdef CONFIG_PHYS_64BIT
+#define BAT_PHYS_ADDR(x) ((u32)((x & 0x00000000fffe0000ULL) | \
+                               ((x & 0x0000000e00000000ULL) >> 24) | \
+                               ((x & 0x0000000100000000ULL) >> 30)))
+#else
+#define BAT_PHYS_ADDR(x) (x)
+#endif
+
+struct ppc_bat {
+       u32 batu;
+       u32 batl;
+};
 #endif /* !__ASSEMBLY__ */
 
 /*
@@ -62,7 +56,7 @@ typedef struct _BAT {
 #ifndef __ASSEMBLY__
 
 /* Hardware Page Table Entry */
-typedef struct _PTE {
+struct hash_pte {
        unsigned long v:1;      /* Entry is valid */
        unsigned long vsid:24;  /* Virtual segment identifier */
        unsigned long h:1;      /* Hash algorithm indicator */
@@ -77,15 +71,13 @@ typedef struct _PTE {
        unsigned long g:1;      /* Guarded */
        unsigned long  :1;      /* Unused */
        unsigned long pp:2;     /* Page protection */
-} PTE;
+};
 
 typedef struct {
        unsigned long id;
        unsigned long vdso_base;
 } mm_context_t;
 
-typedef unsigned long phys_addr_t;
-
 #endif /* !__ASSEMBLY__ */
 
 #endif /* _ASM_POWERPC_MMU_HASH32_H_ */