2 // Copyright (c) 2002-2010 Xilinx, Inc. All rights reserved.
5 // XILINX IS PROVIDING THIS DESIGN, CODE, OR INFORMATION "AS IS" AS A
6 // COURTESY TO YOU. BY PROVIDING THIS DESIGN, CODE, OR INFORMATION AS
7 // ONE POSSIBLE IMPLEMENTATION OF THIS FEATURE, APPLICATION OR
8 // STANDARD, XILINX IS MAKING NO REPRESENTATION THAT THIS IMPLEMENTATION
9 // IS FREE FROM ANY CLAIMS OF INFRINGEMENT, AND YOU ARE RESPONSIBLE
10 // FOR OBTAINING ANY RIGHTS YOU MAY REQUIRE FOR YOUR IMPLEMENTATION.
11 // XILINX EXPRESSLY DISCLAIMS ANY WARRANTY WHATSOEVER WITH RESPECT TO
12 // THE ADEQUACY OF THE IMPLEMENTATION, INCLUDING BUT NOT LIMITED TO
13 // ANY WARRANTIES OR REPRESENTATIONS THAT THIS IMPLEMENTATION IS FREE
14 // FROM CLAIMS OF INFRINGEMENT, IMPLIED WARRANTIES OF MERCHANTABILITY
15 // AND FITNESS FOR A PARTICULAR PURPOSE.
17 // $Id: profile_hist.c,v 1.1.2.1 2011/05/17 04:37:57 sadanan Exp $
20 #include "_profile_timer_hw.h"
22 #ifdef PROC_MICROBLAZE
23 #include "mblaze_nt_types.h"
27 #include "xpseudo_asm.h"
28 #define SPR_SRR0 0x01A
31 #include "xil_types.h"
36 void profile_intr_handler( void )
41 #ifdef PROC_MICROBLAZE
42 asm( "swi r14, r0, prof_pc" ) ;
43 #elif defined PROC_PPC
44 prof_pc = mfspr(SPR_SRR0);
46 // for cortexa9, lr is saved in asm interrupt handler
48 //print("PC: "); putnum(prof_pc); print("\r\n");
49 for(j = 0; j < n_gmon_sections; j++ ){
50 if((prof_pc >= _gmonparam[j].lowpc) && (prof_pc < _gmonparam[j].highpc)) {
51 _gmonparam[j].kcount[(prof_pc-_gmonparam[j].lowpc)/(4 * binsize)]++;
55 // Ack the Timer Interrupt