/*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ #ifndef __arch_profile_h__ #define __arch_profile_h__ #if defined(CONFIG_SOC_GRX500) /*--- GRX ---*/ #include "arch_profile_grx.h" #elif defined(CONFIG_VR9) /*--- VR9 ---*/ #include "arch_profile_vr9.h" #elif defined(CONFIG_AR10) /*--- AR10 ---*/ #include "arch_profile_ar10.h" #elif defined(CONFIG_MIPS) /*--- AR9/Atheros ---*/ #if defined(ARCH_MIPS_PROFILE_C) static const struct _cpucore_profile mips_cpu_config[1] = { { cpu_nr_offset: 0, vpe_nr: 1, linux_os_mask: 0x1, next_core: NULL }, }; #endif/*--- #if defined(ARCH_MIPS_PROFILE_C) ---*/ #endif #if defined(CONFIG_MIPS) #include /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_sdramacess(void) { return read_c0_perfcntr0(); } /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_sdramactivate(void) { return read_c0_perfcntr1(); } /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_cpu_status(unsigned int restore_flags) { #ifdef PROFILING_IN_YIELD if(is_yield_context()) { return read_vpe_c0_status(); } #endif return read_c0_status() | (restore_flags & 0x1); /*--- Bit 0 ist IE ---*/ } #elif defined(CONFIG_ARCH_PUMA5) || defined(CONFIG_MACH_PUMA6) #include /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_sdramacess(void) { return read_p15_performance_counter_0(); } /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_sdramactivate(void) { return read_p15_performance_counter_1(); } /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_cpu_status(unsigned int restore_flags __maybe_unused) { /*--- todo ---*/ return restore_flags; } #else /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_sdramacess(void) { return 0; } /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_sdramactivate(void) { return 0; } /*--------------------------------------------------------------------------------*\ \*--------------------------------------------------------------------------------*/ static inline unsigned int avm_profile_cpu_status(unsigned int restore_flags __maybe_unused) { /*--- todo ---*/ return restore_flags; } #endif #if defined(CONFIG_MIPS) #define KSTK_RA(tsk) (task_pt_regs(tsk)->regs[31]) #elif defined(CONFIG_ARM) #define KSTK_RA(tsk) (task_pt_regs(tsk)->ARM_lr) #elif defined(CONFIG_X86) #define KSTK_RA(tsk) (task_pt_regs(tsk)->bp) #else #define KSTK_RA(tsk) NULL #endif #endif/*--- #ifndef __arch_profile_h__ ---*/