source: svn/newcon3bcm2_21bu/BSEAV/lib/bprofile/bprofile_tick_mips.h

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 2.0 KB
Line 
1/***************************************************************************
2 *     Copyright (c) 2006-2007, Broadcom Corporation
3 *     All Rights Reserved
4 *     Confidential Property of Broadcom Corporation
5 *
6 *  THIS SOFTWARE MAY ONLY BE USED SUBJECT TO AN EXECUTED SOFTWARE LICENSE
7 *  AGREEMENT  BETWEEN THE USER AND BROADCOM.  YOU HAVE NO RIGHT TO USE OR
8 *  EXPLOIT THIS MATERIAL EXCEPT SUBJECT TO THE TERMS OF SUCH AN AGREEMENT.
9 *
10 * $brcm_Workfile: bprofile_tick_mips.h $
11 * $brcm_Revision: 2 $
12 * $brcm_Date: 1/15/07 10:50a $
13 *
14 * Module Description:
15 *
16 * Embeddeble profiler library
17 *              MIPS Data acquisition module
18 *
19 * Revision History:
20 *
21 * $brcm_Log: /BSEAV/lib/bprofile/bprofile_tick_mips.h $
22 *
23 * 2   1/15/07 10:50a vsilyaev
24 * PR 25997: Added 7038 performance counters
25 *
26 * 1   12/13/06 7:48p vsilyaev
27 * PR 25997: Generic MIPS profile sampler
28 *
29 *******************************************************************************/
30/* MIPS32 performance sampling routine */
31
32#include "bperf_counter.h"
33
34#ifndef b_gettick
35BSTD_INLINE unsigned __attribute__((no_instrument_function))
36b_gettick(void)
37{ 
38        unsigned b_mips_tick;
39        __asm__ __volatile__(
40                        ".set\tmips32\n\t"
41                        "mfc0\t%0, $9, 0\n\t"
42                        ".set\tmips0\n\t"
43                        : "=r" (b_mips_tick));
44        return b_mips_tick;                             
45}
46#endif
47
48BSTD_INLINE void __attribute__((no_instrument_function))
49b_sample(bprofile_sample *sample)
50{
51                sample->time = b_gettick();
52
53#if BPROFILE_CFG_PERF_COUNTER
54#if B_PERF_BMIPS3300
55                sample->counters[0] = b_perf_read_one(0);
56#if BPROFILE_CFG_PERF_COUNTER > 1
57                sample->counters[1] = b_perf_read_one(1);
58#endif
59#if BPROFILE_CFG_PERF_COUNTER > 2
60                sample->counters[2] = b_perf_read_one(2);
61#endif
62#if BPROFILE_CFG_PERF_COUNTER > 3
63                sample->counters[3] = b_perf_read_one(3);
64#endif
65#elif B_PERF_MIPSR5K
66                sample->counters[0] = b_perf_read_one(1);
67#if BPROFILE_CFG_PERF_COUNTER > 1
68                sample->counters[1] = b_perf_read_one(3);
69#endif
70#if BPROFILE_CFG_PERF_COUNTER > 2
71#error "Not supported"
72#endif
73#endif /* B_PERF_MIPSR5K */
74#endif
75                return;
76}
77
Note: See TracBrowser for help on using the repository browser.