[SPARC64]: Define TASK_SIZE_OF()
[sfrench/cifs-2.6.git] / include / asm-sparc64 / processor.h
index cd8d9b4c86587073821ab5144cec09803a5fcaa5..885b6a1dcae4d0b75df49cdc82df8e2035aa45a0 100644 (file)
@@ -13,9 +13,7 @@
  */
 #define current_text_addr() ({ void *pc; __asm__("rd %%pc, %0" : "=r" (pc)); pc; })
 
-#include <linux/config.h>
 #include <asm/asi.h>
-#include <asm/a.out.h>
 #include <asm/pstate.h>
 #include <asm/ptrace.h>
 #include <asm/page.h>
@@ -28,6 +26,8 @@
  * User lives in his very own context, and cannot reference us. Note
  * that TASK_SIZE is a misnomer, it really gives maximum user virtual 
  * address that the kernel will allocate out.
+ *
+ * XXX No longer using virtual page tables, kill this upper limit...
  */
 #define VA_BITS                44
 #ifndef __ASSEMBLY__
 #else
 #define VPTE_SIZE      (1 << (VA_BITS - PAGE_SHIFT + 3))
 #endif
+
 #define TASK_SIZE      ((unsigned long)-VPTE_SIZE)
+#define TASK_SIZE_OF(tsk) \
+       (test_tsk_thread_flag(tsk,TIF_32BIT) ? \
+        (1UL << 32UL) : TASK_SIZE)
+#ifdef __KERNEL__
+
+#define STACK_TOP32    ((1UL << 32UL) - PAGE_SIZE)
+#define STACK_TOP64    (0x0000080000000000UL - (1UL << 32UL))
+
+#define STACK_TOP      (test_thread_flag(TIF_32BIT) ? \
+                        STACK_TOP32 : STACK_TOP64)
+
+#define STACK_TOP_MAX  STACK_TOP64
 
-/*
- * The vpte base must be able to hold the entire vpte, half
- * of which lives above, and half below, the base. And it
- * is placed as close to the highest address range as possible.
- */
-#define VPTE_BASE_SPITFIRE     (-(VPTE_SIZE/2))
-#if 1
-#define VPTE_BASE_CHEETAH      VPTE_BASE_SPITFIRE
-#else
-#define VPTE_BASE_CHEETAH      0xffe0000000000000
 #endif
 
 #ifndef __ASSEMBLY__
@@ -101,7 +104,8 @@ extern unsigned long thread_saved_pc(struct task_struct *);
 /* Do necessary setup to start up a newly executed thread. */
 #define start_thread(regs, pc, sp) \
 do { \
-       regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_INITIAL_MM|TSTATE_IE) | (ASI_PNF << 24); \
+       unsigned long __asi = ASI_PNF; \
+       regs->tstate = (regs->tstate & (TSTATE_CWP)) | (TSTATE_INITIAL_MM|TSTATE_IE) | (__asi << 24UL); \
        regs->tpc = ((pc & (~3)) - 4); \
        regs->tnpc = regs->tpc + 4; \
        regs->y = 0; \
@@ -138,10 +142,10 @@ do { \
 
 #define start_thread32(regs, pc, sp) \
 do { \
+       unsigned long __asi = ASI_PNF; \
        pc &= 0x00000000ffffffffUL; \
        sp &= 0x00000000ffffffffUL; \
-\
-       regs->tstate = (regs->tstate & (TSTATE_CWP))|(TSTATE_INITIAL_MM|TSTATE_IE|TSTATE_AM); \
+       regs->tstate = (regs->tstate & (TSTATE_CWP))|(TSTATE_INITIAL_MM|TSTATE_IE|TSTATE_AM) | (__asi << 24UL); \
        regs->tpc = ((pc & (~3)) - 4); \
        regs->tnpc = regs->tpc + 4; \
        regs->y = 0; \
@@ -226,6 +230,8 @@ static inline void prefetchw(const void *x)
 
 #define spin_lock_prefetch(x)  prefetchw(x)
 
+#define HAVE_ARCH_PICK_MMAP_LAYOUT
+
 #endif /* !(__ASSEMBLY__) */
 
 #endif /* !(__ASM_SPARC64_PROCESSOR_H) */