firewire: fw-ohci: extend logging of bus generations and node ID
[safe/jmp/linux-2.6] / include / asm-powerpc / processor.h
index 415fa39..fd98ca9 100644 (file)
  * -- BenH.
  */
 
-/* Platforms codes (to be obsoleted) */
-#define PLATFORM_PSERIES       0x0100
-#define PLATFORM_PSERIES_LPAR  0x0101
-#define PLATFORM_ISERIES_LPAR  0x0201
-#define PLATFORM_LPAR          0x0001
-#define PLATFORM_POWERMAC      0x0400
-#define PLATFORM_MAPLE         0x0500
-#define PLATFORM_PREP          0x0600
-#define PLATFORM_CHRP          0x0700
-#define PLATFORM_CELL          0x1000
-
-/* Compat platform codes for 32 bits */
-#define _MACH_prep     PLATFORM_PREP
-#define _MACH_Pmac     PLATFORM_POWERMAC
-#define _MACH_chrp     PLATFORM_CHRP
-
 /* PREP sub-platform types see residual.h for these */
 #define _PREP_Motorola 0x01    /* motorola prep */
 #define _PREP_Firm     0x02    /* firmworks prep */
 #define _CHRP_Motorola 0x04    /* motorola chrp, the cobra */
 #define _CHRP_IBM      0x05    /* IBM chrp, the longtrail and longtrail 2 */
 #define _CHRP_Pegasos  0x06    /* Genesi/bplan's Pegasos and Pegasos2 */
+#define _CHRP_briq     0x07    /* TotalImpact's briQ */
 
-#ifdef __KERNEL__
-#define platform_is_pseries()  (_machine == PLATFORM_PSERIES || \
-                                _machine == PLATFORM_PSERIES_LPAR)
-#define platform_is_lpar()     (!!(_machine & PLATFORM_LPAR))
+#if defined(__KERNEL__) && defined(CONFIG_PPC32)
 
-#if defined(CONFIG_PPC_MULTIPLATFORM)
-extern int _machine;
+extern int _chrp_type;
 
-#ifdef CONFIG_PPC32
+#ifdef CONFIG_PPC_PREP
 
 /* what kind of prep workstation we are */
 extern int _prep_type;
-extern int _chrp_type;
 
-/*
- * This is used to identify the board type from a given PReP board
- * vendor. Board revision is also made available. This will be moved
- * elsewhere soon
- */
-extern unsigned char ucBoardRev;
-extern unsigned char ucBoardRevMaj, ucBoardRevMin;
+#endif /* CONFIG_PPC_PREP */
 
-#endif /* CONFIG_PPC32 */
+#endif /* defined(__KERNEL__) && defined(CONFIG_PPC32) */
 
-#elif defined(CONFIG_PPC_ISERIES)
-/*
- * iSeries is soon to become MULTIPLATFORM hopefully ...
- */
-#define _machine PLATFORM_ISERIES_LPAR
-#else
-#define _machine 0
-#endif /* CONFIG_PPC_MULTIPLATFORM */
-#endif /* __KERNEL__ */
 /*
  * Default implementation of macro that returns current
  * instruction pointer ("program counter").
@@ -134,8 +99,9 @@ extern struct task_struct *last_task_used_spe;
  */
 #define TASK_SIZE_USER32 (0x0000000100000000UL - (1*PAGE_SIZE))
 
-#define TASK_SIZE (test_thread_flag(TIF_32BIT) ? \
+#define TASK_SIZE_OF(tsk) (test_tsk_thread_flag(tsk, TIF_32BIT) ? \
                TASK_SIZE_USER32 : TASK_SIZE_USER64)
+#define TASK_SIZE        TASK_SIZE_OF(current)
 
 /* This decides where the kernel will search for a free chunk of vm
  * space during mmap's.
@@ -147,6 +113,25 @@ extern struct task_struct *last_task_used_spe;
                TASK_UNMAPPED_BASE_USER32 : TASK_UNMAPPED_BASE_USER64 )
 #endif
 
+#ifdef __KERNEL__
+#ifdef __powerpc64__
+
+#define STACK_TOP_USER64 TASK_SIZE_USER64
+#define STACK_TOP_USER32 TASK_SIZE_USER32
+
+#define STACK_TOP (test_thread_flag(TIF_32BIT) ? \
+                  STACK_TOP_USER32 : STACK_TOP_USER64)
+
+#define STACK_TOP_MAX STACK_TOP_USER64
+
+#else /* __powerpc64__ */
+
+#define STACK_TOP TASK_SIZE
+#define STACK_TOP_MAX  STACK_TOP
+
+#endif /* __powerpc64__ */
+#endif /* __KERNEL__ */
+
 typedef struct {
        unsigned long seg;
 } mm_segment_t;
@@ -160,7 +145,6 @@ struct thread_struct {
        mm_segment_t    fs;             /* for get_fs() validation */
 #ifdef CONFIG_PPC32
        void            *pgdir;         /* root of page-table tree */
-       signed long     last_syscall;
 #endif
 #if defined(CONFIG_4xx) || defined (CONFIG_BOOKE)
        unsigned long   dbcr0;          /* debug control register values */
@@ -173,17 +157,17 @@ struct thread_struct {
                unsigned int val;       /* Floating point status */
        } fpscr;
        int             fpexc_mode;     /* floating-point exception mode */
+       unsigned int    align_ctl;      /* alignment handling control */
 #ifdef CONFIG_PPC64
        unsigned long   start_tb;       /* Start purr when proc switched in */
        unsigned long   accum_tb;       /* Total accumilated purr for process */
 #endif
-       unsigned long   vdso_base;      /* base of the vDSO library */
        unsigned long   dabr;           /* Data address breakpoint register */
 #ifdef CONFIG_ALTIVEC
        /* Complete AltiVec register set */
-       vector128       vr[32] __attribute((aligned(16)));
+       vector128       vr[32] __attribute__((aligned(16)));
        /* AltiVec status */
-       vector128       vscr __attribute((aligned(16)));
+       vector128       vscr __attribute__((aligned(16)));
        unsigned long   vrsave;
        int             used_vr;        /* set if process has used altivec */
 #endif /* CONFIG_ALTIVEC */
@@ -214,7 +198,7 @@ struct thread_struct {
        .fs = KERNEL_DS, \
        .fpr = {0}, \
        .fpscr = { .val = 0, }, \
-       .fpexc_mode = MSR_FE0|MSR_FE1, \
+       .fpexc_mode = 0, \
 }
 #endif
 
@@ -236,6 +220,18 @@ unsigned long get_wchan(struct task_struct *p);
 extern int get_fpexc_mode(struct task_struct *tsk, unsigned long adr);
 extern int set_fpexc_mode(struct task_struct *tsk, unsigned int val);
 
+#define GET_ENDIAN(tsk, adr) get_endian((tsk), (adr))
+#define SET_ENDIAN(tsk, val) set_endian((tsk), (val))
+
+extern int get_endian(struct task_struct *tsk, unsigned long adr);
+extern int set_endian(struct task_struct *tsk, unsigned int val);
+
+#define GET_UNALIGN_CTL(tsk, adr)      get_unalign_ctl((tsk), (adr))
+#define SET_UNALIGN_CTL(tsk, val)      set_unalign_ctl((tsk), (val))
+
+extern int get_unalign_ctl(struct task_struct *tsk, unsigned long adr);
+extern int set_unalign_ctl(struct task_struct *tsk, unsigned int val);
+
 static inline unsigned int __unpack_fe01(unsigned long msr_bits)
 {
        return ((msr_bits & MSR_FE0) >> 10) | ((msr_bits & MSR_FE1) >> 8);
@@ -252,6 +248,10 @@ static inline unsigned long __pack_fe01(unsigned int fpmode)
 #define cpu_relax()    barrier()
 #endif
 
+/* Check that a certain kernel stack pointer is valid in task_struct p */
+int validate_sp(unsigned long sp, struct task_struct *p,
+                       unsigned long nbytes);
+
 /*
  * Prefetch macros.
  */