@@ -117,12 +117,12 @@ void perfc_port_insert_to_system_timer_insert_ovf_handler(void)
117
117
/* prevent high priority exceptions from preempting the system timer OVF
118
118
* exception handling
119
119
*/
120
- __IRQ_SAFE {
120
+ __PERFC_SAFE {
121
121
s_lSystemClockCounts += lLoad ;
122
122
}
123
123
124
124
// update system ms counter
125
- __IRQ_SAFE {
125
+ __PERFC_SAFE {
126
126
int64_t lTemp = s_wMSResidule + lLoad ;
127
127
128
128
int64_t lMS = lTemp / s_wMSUnit ;
@@ -132,7 +132,7 @@ void perfc_port_insert_to_system_timer_insert_ovf_handler(void)
132
132
}
133
133
134
134
// update system us counter
135
- __IRQ_SAFE {
135
+ __PERFC_SAFE {
136
136
int64_t lTemp = s_wUSResidule + lLoad ;
137
137
138
138
int64_t lUS = lTemp / s_wUSUnit ;
@@ -160,7 +160,7 @@ void update_perf_counter(void)
160
160
s_wUSUnit = wSystemFrequency / 1000000ul ;
161
161
s_wMSUnit = wSystemFrequency / 1000ul ;
162
162
163
- __IRQ_SAFE {
163
+ __PERFC_SAFE {
164
164
g_lLastTimeStamp = get_system_ticks ();
165
165
__perfc_sync_barrier__ ();
166
166
g_nOffset = get_system_ticks () - g_lLastTimeStamp ;
@@ -170,7 +170,7 @@ void update_perf_counter(void)
170
170
bool perfc_init (bool bIsSysTimerOccupied )
171
171
{
172
172
bool bResult = false;
173
- __IRQ_SAFE {
173
+ __PERFC_SAFE {
174
174
s_bIsSysTimerOccupied = bIsSysTimerOccupied ;
175
175
bResult = perfc_port_init_system_timer (bIsSysTimerOccupied ); // use the longest period
176
176
perfc_port_clear_system_timer_ovf_pending ();
@@ -238,7 +238,7 @@ __STATIC_INLINE int64_t check_systick(void)
238
238
239
239
void before_cycle_counter_reconfiguration (void )
240
240
{
241
- __IRQ_SAFE {
241
+ __PERFC_SAFE {
242
242
perfc_port_stop_system_timer_counting ();
243
243
244
244
if (perfc_port_is_system_timer_ovf_pending ()) {
@@ -339,7 +339,7 @@ int64_t get_system_ticks(void)
339
339
{
340
340
int64_t lTemp = 0 ;
341
341
342
- __IRQ_SAFE {
342
+ __PERFC_SAFE {
343
343
lTemp = check_systick () + s_lSystemClockCounts ;
344
344
345
345
/* When calling get_system_ticks() in an exception handler that has a
@@ -395,7 +395,7 @@ int64_t get_system_ms(void)
395
395
{
396
396
int64_t lTemp = 0 ;
397
397
398
- __IRQ_SAFE {
398
+ __PERFC_SAFE {
399
399
lTemp = s_lSystemMS
400
400
+ ( (check_systick ()
401
401
+ (int64_t )s_wMSResidule ) / s_wMSUnit );
@@ -414,7 +414,7 @@ int64_t get_system_us(void)
414
414
{
415
415
int64_t lTemp = 0 ;
416
416
417
- __IRQ_SAFE {
417
+ __PERFC_SAFE {
418
418
lTemp = s_lSystemUS
419
419
+ ( (check_systick ()
420
420
+ (int64_t )s_wUSResidule ) / s_wUSUnit );
@@ -656,7 +656,7 @@ bool enable_task_cycle_info(task_cycle_info_t *ptInfo)
656
656
return false;
657
657
}
658
658
bool bOrig ;
659
- __IRQ_SAFE {
659
+ __PERFC_SAFE {
660
660
bOrig = ptInfo -> bEnabled ;
661
661
ptInfo -> bEnabled = true;
662
662
}
@@ -669,7 +669,7 @@ bool disable_task_cycle_info(task_cycle_info_t *ptInfo)
669
669
return false;
670
670
}
671
671
bool bOrig ;
672
- __IRQ_SAFE {
672
+ __PERFC_SAFE {
673
673
bOrig = ptInfo -> bEnabled ;
674
674
ptInfo -> bEnabled = false;
675
675
}
@@ -689,7 +689,7 @@ void resume_task_cycle_info(task_cycle_info_t *ptInfo, bool bEnabledStatus)
689
689
task_cycle_info_agent_t * register_task_cycle_agent (task_cycle_info_t * ptInfo ,
690
690
task_cycle_info_agent_t * ptAgent )
691
691
{
692
- __IRQ_SAFE {
692
+ __PERFC_SAFE {
693
693
do {
694
694
if (NULL == ptAgent || NULL == ptInfo ) {
695
695
break ;
@@ -727,7 +727,7 @@ task_cycle_info_agent_t *register_task_cycle_agent(task_cycle_info_t *ptInfo,
727
727
task_cycle_info_agent_t *
728
728
unregister_task_cycle_agent (task_cycle_info_agent_t * ptAgent )
729
729
{
730
- __IRQ_SAFE {
730
+ __PERFC_SAFE {
731
731
do {
732
732
if (NULL == ptAgent ) {
733
733
break ;
@@ -814,7 +814,7 @@ void __start_task_cycle_counter(task_cycle_info_t *ptInfo)
814
814
return ;
815
815
}
816
816
817
- __IRQ_SAFE {
817
+ __PERFC_SAFE {
818
818
ptRootAgent -> lLastTimeStamp = get_system_ticks ();
819
819
ptRootAgent -> tInfo .lUsedTotal = 0 ;
820
820
@@ -836,7 +836,7 @@ int64_t __stop_task_cycle_counter(task_cycle_info_t *ptInfo)
836
836
837
837
int64_t lCycles = 0 ;
838
838
839
- __IRQ_SAFE {
839
+ __PERFC_SAFE {
840
840
int64_t lCycleUsed = get_system_ticks () - ptRootAgent -> lLastTimeStamp - g_nOffset ;
841
841
ptRootAgent -> tInfo .lUsedTotal += lCycleUsed ;
842
842
0 commit comments