Module: xenomai-gch
Branch: fpu-tracer
Commit: 3999caa293ba47594c349890d33dbcb4d6f78db3
URL:    
http://git.xenomai.org/?p=xenomai-gch.git;a=commit;h=3999caa293ba47594c349890d33dbcb4d6f78db3

Author: Gilles Chanteperdrix <gilles.chanteperd...@xenomai.org>
Date:   Wed Aug 12 00:05:47 2009 +0200

Add kernel patch to get the trace points

---

 .../patches/powerpc-fpu-tracer-2.4.25.patch        |  145 ++++++++++++++++++++
 1 files changed, 145 insertions(+), 0 deletions(-)

diff --git a/ksrc/arch/powerpc/patches/powerpc-fpu-tracer-2.4.25.patch 
b/ksrc/arch/powerpc/patches/powerpc-fpu-tracer-2.4.25.patch
new file mode 100644
index 0000000..efc9523
--- /dev/null
+++ b/ksrc/arch/powerpc/patches/powerpc-fpu-tracer-2.4.25.patch
@@ -0,0 +1,145 @@
+diff --git a/arch/ppc/kernel/head.S b/arch/ppc/kernel/head.S
+index befb024..b6e25ee 100644
+--- a/arch/ppc/kernel/head.S
++++ b/arch/ppc/kernel/head.S
+@@ -940,6 +940,16 @@ load_up_fpu:
+       sub     r4,r4,r6
+       stw     r4,last_task_used_m...@l(r3)
+ #endif /* CONFIG_SMP */
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++      li      r20,MSR_KERNEL
++      bl      transfer_to_handler
++      .long   trace_loadup_fpu
++      .long   ret_from_except
++
++trace_loadup_fpu:
++      bl      trace_fpu_restore
++      b       ret_from_except
++#else 
+       /* restore registers and return */
+       lwz     r3,_CCR(r21)
+       lwz     r4,_LINK(r21)
+@@ -955,6 +965,7 @@ load_up_fpu:
+       lwz     r21,GPR21(r21)
+       SYNC
+       RFI
++#endif        
+ 
+ /*
+  * FP unavailable trap from kernel - print a message, but let
+@@ -1109,8 +1120,13 @@ giveup_altivec:
+  * and save the floating-point registers in its thread_struct.
+  * Enables the FPU for use in the kernel on return.
+  */
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++      .globl  __giveup_fpu
++__giveup_fpu:
++#else 
+       .globl  giveup_fpu
+ giveup_fpu:
++#endif
+ #ifdef CONFIG_IPIPE   
+       mfmsr   r6
+       rlwinm  r5,r6,0,17,15           /* clear MSR_EE */
+diff --git a/arch/ppc/kernel/ppc_ksyms.c b/arch/ppc/kernel/ppc_ksyms.c
+index 513c65d..8223533 100644
+--- a/arch/ppc/kernel/ppc_ksyms.c
++++ b/arch/ppc/kernel/ppc_ksyms.c
+@@ -210,7 +210,11 @@ EXPORT_SYMBOL(_tlbia);
+ EXPORT_SYMBOL(set_pte);
+ EXPORT_SYMBOL(pte_alloc);
+ EXPORT_SYMBOL(flush_instruction_cache);
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++EXPORT_SYMBOL(__giveup_fpu);
++#else
+ EXPORT_SYMBOL(giveup_fpu);
++#endif
+ EXPORT_SYMBOL(enable_kernel_fp);
+ EXPORT_SYMBOL(flush_icache_range);
+ EXPORT_SYMBOL(flush_dcache_range);
+diff --git a/arch/ppc/kernel/process.c b/arch/ppc/kernel/process.c
+index 5534dc2..f0d187b 100644
+--- a/arch/ppc/kernel/process.c
++++ b/arch/ppc/kernel/process.c
+@@ -187,6 +187,9 @@ enable_kernel_spe(void)
+ void
+ enable_kernel_fp(void)
+ {
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++      fp_trace_kernel_start();
++#endif
+ #ifdef CONFIG_SMP
+       if (current->thread.regs && (current->thread.regs->msr & MSR_FP))
+               giveup_fpu(current);
+diff --git a/arch/ppc/kernel/traps.c b/arch/ppc/kernel/traps.c
+index 6f37807..a4c2c0f 100644
+--- a/arch/ppc/kernel/traps.c
++++ b/arch/ppc/kernel/traps.c
+@@ -661,6 +661,13 @@ SPEFloatingPointException(struct pt_regs *regs)
+ }
+ #endif
+ 
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++void trace_fpu_restore(void)
++{
++      fp_trace_restore(current);
++}
++#endif
++
+ void __init trap_init(void)
+ {
+ }
+diff --git a/drivers/pci/gen-devlist b/drivers/pci/gen-devlist
+deleted file mode 100755
+index fcf2757..0000000
+Binary files a/drivers/pci/gen-devlist and /dev/null differ
+diff --git a/include/asm-ppc/system.h b/include/asm-ppc/system.h
+index b507256..92418c4 100644
+--- a/include/asm-ppc/system.h
++++ b/include/asm-ppc/system.h
+@@ -10,6 +10,9 @@
+ #include <asm/processor.h>
+ #include <asm/atomic.h>
+ #include <asm/hw_irq.h>
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++#include <xenomai/nucleus/fpu_trace.h>
++#endif
+ 
+ /*
+  * Memory barrier.
+@@ -67,7 +70,16 @@ extern void via_cuda_init(void);
+ extern void pmac_nvram_init(void);
+ extern void read_rtc_time(void);
+ extern void pmac_find_display(void);
++#ifdef CONFIG_XENO_HW_FPU_TRACER
++extern void __giveup_fpu(struct task_struct *p);
++#define giveup_fpu(p)                         \
++      do {                                    \
++              fp_trace_save(p);               \
++              __giveup_fpu(p);                \
++      } while (0)
++#else
+ extern void giveup_fpu(struct task_struct *);
++#endif
+ extern void enable_kernel_fp(void);
+ extern void giveup_altivec(struct task_struct *);
+ extern void load_up_altivec(struct task_struct *);
+@@ -80,9 +92,17 @@ extern void cacheable_memzero(void *p, unsigned int nb);
+ struct device_node;
+ extern void note_scsi_host(struct device_node *, void *);
+ 
++#ifndef CONFIG_XENO_HW_FPU_TRACER
++#define fp_trace_switch(prev, next) do { } while (0)
++#endif
++
+ struct task_struct;
+ #define prepare_to_switch()   do { } while(0)
+-#define switch_to(prev,next,last) _switch_to((prev),(next),&(last))
++#define switch_to(prev,next,last)                     \
++      do {                                            \
++              fp_trace_switch((prev), (next));        \
++              _switch_to((prev),(next),&(last));      \
++      } while (0)
+ extern void _switch_to(struct task_struct *, struct task_struct *,
+                      struct task_struct **);
+ 


_______________________________________________
Xenomai-git mailing list
Xenomai-git@gna.org
https://mail.gna.org/listinfo/xenomai-git

Reply via email to