]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/MicroBlaze_Kintex7_EthernetLite/BSP/microblaze_0/libsrc/standalone_v4_2/src/profile/_profile_init.c
809f3468b36885d4063416a8c79246fea6de56b7
[freertos] / FreeRTOS / Demo / MicroBlaze_Kintex7_EthernetLite / BSP / microblaze_0 / libsrc / standalone_v4_2 / src / profile / _profile_init.c
1 // $Id: _profile_init.c,v 1.1.2.1 2011/05/17 04:37:56 sadanan Exp $
2 /******************************************************************************
3 *
4 * Copyright (C) 2002 - 2014 Xilinx, Inc.  All rights reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
15 *
16 * Use of the Software is limited solely to applications:
17 * (a) running on a Xilinx device, or
18 * (b) that interact with a Xilinx device through a bus or interconnect.
19 *
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
21 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * XILINX  BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
25 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
26 * SOFTWARE.
27 *
28 * Except as contained in this notice, the name of the Xilinx shall not be used
29 * in advertising or otherwise to promote the sale, use or other dealings in
30 * this Software without prior written authorization from Xilinx.
31 *
32 ******************************************************************************
33 *
34 * _program_init.c:
35 *       Initialize the Profiling Structures.
36 *
37 ******************************************************************************/
38
39 #include "profile.h"
40
41 // XMD Initializes the following Global Variables Value during Program
42 // Download with appropriate values.
43
44 #ifdef PROC_MICROBLAZE
45
46 extern int microblaze_init(void);
47
48 #elif defined PROC_PPC
49
50 extern int powerpc405_init(void);
51
52 #else
53
54 extern int cortexa9_init(void);
55
56 #endif
57
58
59
60 int profile_version = 1;        // Version of S/W Intrusive Profiling library
61
62 int binsize = BINSIZE;                          // Histogram Bin Size
63 unsigned int cpu_clk_freq = CPU_FREQ_HZ ;       // CPU Clock Frequency
64 unsigned int sample_freq_hz = SAMPLE_FREQ_HZ ;  // Histogram Sampling Frequency
65 unsigned int timer_clk_ticks = TIMER_CLK_TICKS ;// Timer Clock Ticks for the Timer
66
67 // Structure for Storing the Profiling Data
68 struct gmonparam *_gmonparam = (struct gmonparam *)0xffffffff;
69 int n_gmon_sections = 1;
70
71 // This is the initialization code, which is called from the crtinit.
72 //
73 void _profile_init( void )
74 {
75 /*      print("Gmon Init called....\r\n") ; */
76 /*      putnum(n_gmon_sections) ; print("\r\n") ; */
77 /*      if( _gmonparam == 0xffffffff ) */
78 /*              printf("Gmonparam is NULL !!\r\n"); */
79 /*      for( i = 0; i < n_gmon_sections; i++ ){ */
80 /*              putnum(_gmonparam[i].lowpc) ; print("\t") ; */
81 /*              putnum(_gmonparam[i].highpc) ; print("\r\n") ; */
82 /*              putnum( _gmonparam[i].textsize ); print("\r\n") ; */
83 /*              putnum( _gmonparam[i].kcountsize * sizeof(unsigned short));print("\r\n"); */
84 /*      } */
85
86 #ifdef PROC_MICROBLAZE
87         microblaze_init();
88 #elif defined PROC_PPC
89         powerpc405_init();
90 #else
91         cortexa9_init ();
92 #endif
93 }
94