ppc fix
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 2 Jun 2006 12:08:03 +0000 (12:08 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Fri, 2 Jun 2006 12:08:03 +0000 (12:08 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1876 04897980-b3bd-0310-b5e0-8ef037075253

ltt-usertrace/ltt/atomic-ppc.h
ltt-usertrace/ltt/ltt-usertrace-fast.h
ltt-usertrace/ltt/ltt-usertrace-ppc.h
ltt-usertrace/ltt/ltt-usertrace.h
ltt-usertrace/ltt/ppc_asm-ppc.h
ltt-usertrace/ltt/system-ppc.h
ltt-usertrace/ltt/system-ppc64.h

index eeafd505836ec339b0e28af79e8b5de4fc2313ba..ecd1f7571226054c8f0aec7638d49902e9b55fa1 100644 (file)
@@ -7,8 +7,6 @@
 
 typedef struct { volatile int counter; } atomic_t;
 
-#ifdef __KERNEL__
-
 #define ATOMIC_INIT(i) { (i) }
 
 #define atomic_read(v)         ((v)->counter)
@@ -16,7 +14,7 @@ typedef struct { volatile int counter; } atomic_t;
 
 extern void atomic_clear_mask(unsigned long mask, unsigned long *addr);
 
-#ifdef CONFIG_SMP
+#if 0 // We only do operation on one CPU at a time (LTT)
 #define SMP_SYNC       "sync"
 #define SMP_ISYNC      "\n\tisync"
 #else
@@ -210,5 +208,4 @@ static __inline__ int atomic_dec_if_positive(atomic_t *v)
 #define smp_mb__before_atomic_inc()    __MB
 #define smp_mb__after_atomic_inc()     __MB
 
-#endif /* __KERNEL__ */
 #endif /* _ASM_PPC_ATOMIC_H_ */
index b71585a077487b1243b8fc61e8017ac8ffb86075..b0b0ea5cdceaaa1562ed29df1b9b73efd4036254 100644 (file)
 #include <asm/timex.h>
 #include <semaphore.h>
 #include <signal.h>
-#ifdef powerpc
-#define __KERNEL__     /* Ugly hack : atomic.h is broken */
-#endif
-#include <asm/atomic.h>
-#ifdef powerpc
-#include "ltt/ltt-usertrace-ppc.h"
-#undef __KERNEL__      /* Ugly hack : atomic.h is broken */
-#endif
 
 #include <ltt/ltt-facility-id-user_generic.h>
 
index 417eca016fdaf698897ebfd69a3f0061e9c709d5..002142e40a47d912363964094234ea89d106fe58 100644 (file)
 
 #ifdef __powerpc64__
 #include "ltt/atomic-ppc64.h"
+#include "ltt/system-ppc64.h"
 #else
+#include "ltt/ppc_asm-ppc.h"
 #include "ltt/atomic-ppc.h"
+#include "ltt/system-ppc.h"
 #endif
 
-static __inline__ unsigned long
-xchg_u32(volatile void *p, unsigned long val)
-{
-       unsigned long prev;
-
-       __asm__ __volatile__ ("\n\
-1:     lwarx   %0,0,%2 \n"
-"      stwcx.  %3,0,%2 \n\
-       bne-    1b"
-       : "=&r" (prev), "=m" (*(volatile unsigned long *)p)
-       : "r" (p), "r" (val), "m" (*(volatile unsigned long *)p)
-       : "cc", "memory");
-
-       return prev;
-}
-
-/*
- * This function doesn't exist, so you'll get a linker error
- * if something tries to do an invalid xchg().
- */
-extern void __xchg_called_with_bad_pointer(void);
-
-#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
-#define tas(ptr) (xchg((ptr),1))
-
-static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
-{
-       switch (size) {
-       case 4:
-               return (unsigned long) xchg_u32(ptr, x);
-#if 0  /* xchg_u64 doesn't exist on 32-bit PPC */
-       case 8:
-               return (unsigned long) xchg_u64(ptr, x);
-#endif /* 0 */
-       }
-       __xchg_called_with_bad_pointer();
-       return x;
-
-
-}
-
-extern inline void * xchg_ptr(void * m, void * val)
-{
-       return (void *) xchg_u32(m, (unsigned long) val);
-}
-
-
-#define __HAVE_ARCH_CMPXCHG    1
-
-static __inline__ unsigned long
-__cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
-{
-       unsigned int prev;
-
-       __asm__ __volatile__ ("\n\
-1:     lwarx   %0,0,%2 \n\
-       cmpw    0,%0,%3 \n\
-       bne     2f \n"
-"      stwcx.  %4,0,%2 \n\
-       bne-    1b\n"
-#ifdef CONFIG_SMP
-"      sync\n"
-#endif /* CONFIG_SMP */
-"2:"
-       : "=&r" (prev), "=m" (*p)
-       : "r" (p), "r" (old), "r" (new), "m" (*p)
-       : "cc", "memory");
-
-       return prev;
-}
-
-/* This function doesn't exist, so you'll get a linker error
-   if something tries to do an invalid cmpxchg().  */
-extern void __cmpxchg_called_with_bad_pointer(void);
-
-static __inline__ unsigned long
-__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
-{
-       switch (size) {
-       case 4:
-               return __cmpxchg_u32(ptr, old, new);
-#if 0  /* we don't have __cmpxchg_u64 on 32-bit PPC */
-       case 8:
-               return __cmpxchg_u64(ptr, old, new);
-#endif /* 0 */
-       }
-       __cmpxchg_called_with_bad_pointer();
-       return old;
-}
-
-#define cmpxchg(ptr,o,n)                                                \
-  ({                                                                    \
-     __typeof__(*(ptr)) _o_ = (o);                                      \
-     __typeof__(*(ptr)) _n_ = (n);                                      \
-     (__typeof__(*(ptr))) __cmpxchg((ptr), (unsigned long)_o_,          \
-                                   (unsigned long)_n_, sizeof(*(ptr))); \
-  })
-
-
 #define CPU_FTR_601                    0x00000100
 
 #define CLOCK_TICK_RATE        1193180 /* Underlying HZ */
index eb8f9c85b31b911f84f157b2eae0d7da4ec7534a..90729c679f6e964fc2f1208d18e9046b14b0bfc4 100644 (file)
 #include <stdint.h>
 #include <sys/types.h>
 #include <linux/unistd.h>
+#if defined(__powerpc__) || defined(__powerpc64__)
+#include "ltt/ltt-usertrace-ppc.h"
+#else
+#include <asm/atomic.h>
+#endif
 
 #ifndef min
 #define min(a,b) ((a)<(b)?(a):(b))
index f76221def484d3f8bffa45b0f9a71f9ee88a9cd4..e625aed0a3f2b45deb03d415d57cd7d38a8ded30 100644 (file)
@@ -11,8 +11,6 @@
  *  2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
-
 /*
  * Macros for storing registers into and loading registers from
  * exception frames.
index 82395f30004b7ba30cdec4d4e82c05c8ab9272a9..0f13837c8f70ffa1df7c5980a118e366d1e4f4e8 100644 (file)
@@ -4,9 +4,6 @@
 #ifndef __PPC_SYSTEM_H
 #define __PPC_SYSTEM_H
 
-#include <linux/config.h>
-#include <linux/kernel.h>
-
 #include <asm/atomic.h>
 #include <asm/hw_irq.h>
 
 #define smp_read_barrier_depends()     do { } while(0)
 #endif /* CONFIG_SMP */
 
-#ifdef __KERNEL__
-struct task_struct;
-struct pt_regs;
-
-extern void print_backtrace(unsigned long *);
-extern void show_regs(struct pt_regs * regs);
-extern void flush_instruction_cache(void);
-extern void hard_reset_now(void);
-extern void poweroff_now(void);
-#ifdef CONFIG_6xx
-extern long _get_L2CR(void);
-extern long _get_L3CR(void);
-extern void _set_L2CR(unsigned long);
-extern void _set_L3CR(unsigned long);
-#else
-#define _get_L2CR()    0L
-#define _get_L3CR()    0L
-#define _set_L2CR(val) do { } while(0)
-#define _set_L3CR(val) do { } while(0)
-#endif
-extern void via_cuda_init(void);
-extern void pmac_nvram_init(void);
-extern void read_rtc_time(void);
-extern void pmac_find_display(void);
-extern void giveup_fpu(struct task_struct *);
-extern void enable_kernel_fp(void);
-extern void enable_kernel_altivec(void);
-extern void giveup_altivec(struct task_struct *);
-extern void load_up_altivec(struct task_struct *);
-extern void giveup_spe(struct task_struct *);
-extern void load_up_spe(struct task_struct *);
-extern int fix_alignment(struct pt_regs *);
-extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
-extern void cvt_df(double *from, float *to, unsigned long *fpscr);
-extern int call_rtas(const char *, int, int, unsigned long *, ...);
-extern void cacheable_memzero(void *p, unsigned int nb);
-extern int do_page_fault(struct pt_regs *, unsigned long, unsigned long);
-extern void bad_page_fault(struct pt_regs *, unsigned long, int);
-extern void die(const char *, struct pt_regs *, long);
-
-struct device_node;
-extern void note_scsi_host(struct device_node *, void *);
-
-extern struct task_struct *__switch_to(struct task_struct *,
-       struct task_struct *);
-#define switch_to(prev, next, last)    ((last) = __switch_to((prev), (next)))
-
-struct thread_struct;
-extern struct task_struct *_switch(struct thread_struct *prev,
-                                  struct thread_struct *next);
-
-extern unsigned int rtas_data;
-
 static __inline__ unsigned long
 xchg_u32(volatile void *p, unsigned long val)
 {
@@ -163,7 +107,7 @@ __cmpxchg_u32(volatile unsigned int *p, unsigned int old, unsigned int new)
        PPC405_ERR77(0,%2)
 "      stwcx.  %4,0,%2 \n\
        bne-    1b\n"
-#ifdef CONFIG_SMP
+#if 0 //only using one CPU at a time (LTT) // def CONFIG_SMP
 "      sync\n"
 #endif /* CONFIG_SMP */
 "2:"
@@ -203,5 +147,4 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 
 #define arch_align_stack(x) (x)
 
-#endif /* __KERNEL__ */
 #endif /* __PPC_SYSTEM_H */
index 98d120ca8a91dc0be5043d2eedc7f8be082bd826..5fe605372a5000292374f956d6e7918c28b87091 100644 (file)
@@ -8,8 +8,8 @@
  * 2 of the License, or (at your option) any later version.
  */
 
-#include <linux/config.h>
-#include <linux/compiler.h>
+//#include <linux/config.h>
+//#include <linux/compiler.h>
 #include <asm/page.h>
 #include <asm/processor.h>
 #include <asm/hw_irq.h>
 #define smp_read_barrier_depends()  do { } while(0)
 #endif /* CONFIG_SMP */
 
-#ifdef __KERNEL__
-struct task_struct;
-struct pt_regs;
-
-#ifdef CONFIG_DEBUGGER
-
-extern int (*__debugger)(struct pt_regs *regs);
-extern int (*__debugger_ipi)(struct pt_regs *regs);
-extern int (*__debugger_bpt)(struct pt_regs *regs);
-extern int (*__debugger_sstep)(struct pt_regs *regs);
-extern int (*__debugger_iabr_match)(struct pt_regs *regs);
-extern int (*__debugger_dabr_match)(struct pt_regs *regs);
-extern int (*__debugger_fault_handler)(struct pt_regs *regs);
-
-#define DEBUGGER_BOILERPLATE(__NAME) \
-static inline int __NAME(struct pt_regs *regs) \
-{ \
-       if (unlikely(__ ## __NAME)) \
-               return __ ## __NAME(regs); \
-       return 0; \
-}
-
-DEBUGGER_BOILERPLATE(debugger)
-DEBUGGER_BOILERPLATE(debugger_ipi)
-DEBUGGER_BOILERPLATE(debugger_bpt)
-DEBUGGER_BOILERPLATE(debugger_sstep)
-DEBUGGER_BOILERPLATE(debugger_iabr_match)
-DEBUGGER_BOILERPLATE(debugger_dabr_match)
-DEBUGGER_BOILERPLATE(debugger_fault_handler)
-
-#ifdef CONFIG_XMON
-extern void xmon_init(void);
-#endif
-
-#else
-static inline int debugger(struct pt_regs *regs) { return 0; }
-static inline int debugger_ipi(struct pt_regs *regs) { return 0; }
-static inline int debugger_bpt(struct pt_regs *regs) { return 0; }
-static inline int debugger_sstep(struct pt_regs *regs) { return 0; }
-static inline int debugger_iabr_match(struct pt_regs *regs) { return 0; }
-static inline int debugger_dabr_match(struct pt_regs *regs) { return 0; }
-static inline int debugger_fault_handler(struct pt_regs *regs) { return 0; }
-#endif
-
-extern int fix_alignment(struct pt_regs *regs);
-extern void bad_page_fault(struct pt_regs *regs, unsigned long address,
-                          int sig);
-extern void show_regs(struct pt_regs * regs);
-extern void low_hash_fault(struct pt_regs *regs, unsigned long address);
-extern int die(const char *str, struct pt_regs *regs, long err);
-
-extern int _get_PVR(void);
-extern void giveup_fpu(struct task_struct *);
-extern void disable_kernel_fp(void);
-extern void flush_fp_to_thread(struct task_struct *);
-extern void enable_kernel_fp(void);
-extern void giveup_altivec(struct task_struct *);
-extern void disable_kernel_altivec(void);
-extern void enable_kernel_altivec(void);
-extern int emulate_altivec(struct pt_regs *);
-extern void cvt_fd(float *from, double *to, unsigned long *fpscr);
-extern void cvt_df(double *from, float *to, unsigned long *fpscr);
-
-#ifdef CONFIG_ALTIVEC
-extern void flush_altivec_to_thread(struct task_struct *);
-#else
-static inline void flush_altivec_to_thread(struct task_struct *t)
-{
-}
-#endif
-
-extern int mem_init_done;      /* set on boot once kmalloc can be called */
-
-/* EBCDIC -> ASCII conversion for [0-9A-Z] on iSeries */
-extern unsigned char e2a(unsigned char);
-
-extern struct task_struct *__switch_to(struct task_struct *,
-                                      struct task_struct *);
-#define switch_to(prev, next, last)    ((last) = __switch_to((prev), (next)))
-
-struct thread_struct;
-extern struct task_struct * _switch(struct thread_struct *prev,
-                                   struct thread_struct *next);
-
-static inline int __is_processor(unsigned long pv)
-{
-       unsigned long pvr;
-       asm("mfspr %0, 0x11F" : "=r" (pvr)); 
-       return(PVR_VER(pvr) == pv);
-}
-
 /*
  * Atomic exchange
  *
@@ -302,5 +211,4 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
 
 #define arch_align_stack(x) (x)
 
-#endif /* __KERNEL__ */
 #endif
This page took 0.029259 seconds and 4 git commands to generate.