@@ -137,7 +137,7 @@ LOG_MODULE_DECLARE(os);
137
137
*/
138
138
139
139
#if (CONFIG_FAULT_DUMP == 1 )
140
- static void FaultShow (const z_arch_esf_t * esf , int fault )
140
+ static void fault_show (const z_arch_esf_t * esf , int fault )
141
141
{
142
142
PR_EXC ("Fault! EXC #%d" , fault );
143
143
@@ -156,7 +156,7 @@ static void FaultShow(const z_arch_esf_t *esf, int fault)
156
156
*
157
157
* For Dump level 0, no information needs to be generated.
158
158
*/
159
- static void FaultShow (const z_arch_esf_t * esf , int fault )
159
+ static void fault_show (const z_arch_esf_t * esf , int fault )
160
160
{
161
161
(void )esf ;
162
162
(void )fault ;
@@ -205,13 +205,14 @@ u32_t z_check_thread_stack_fail(const u32_t fault_addr,
205
205
206
206
/**
207
207
*
208
- * @brief Dump MPU fault information
208
+ * @brief Dump MemManage fault information
209
209
*
210
- * See _FaultDump () for example.
210
+ * See z_arm_fault_dump () for example.
211
211
*
212
212
* @return error code to identify the fatal error reason
213
213
*/
214
- static u32_t MpuFault (z_arch_esf_t * esf , int fromHardFault , bool * recoverable )
214
+ static u32_t mem_manage_fault (z_arch_esf_t * esf , int from_hard_fault ,
215
+ bool * recoverable )
215
216
{
216
217
u32_t reason = K_ERR_CPU_EXCEPTION ;
217
218
u32_t mmfar = - EINVAL ;
@@ -239,7 +240,7 @@ static u32_t MpuFault(z_arch_esf_t *esf, int fromHardFault, bool *recoverable)
239
240
240
241
if ((SCB -> CFSR & SCB_CFSR_MMARVALID_Msk ) != 0 ) {
241
242
PR_EXC (" MMFAR Address: 0x%x" , mmfar );
242
- if (fromHardFault ) {
243
+ if (from_hard_fault ) {
243
244
/* clear SCB_MMAR[VALID] to reset */
244
245
SCB -> CFSR &= ~SCB_CFSR_MMARVALID_Msk ;
245
246
}
@@ -328,13 +329,13 @@ static u32_t MpuFault(z_arch_esf_t *esf, int fromHardFault, bool *recoverable)
328
329
329
330
/**
330
331
*
331
- * @brief Dump bus fault information
332
+ * @brief Dump BusFault information
332
333
*
333
- * See _FaultDump () for example.
334
+ * See z_arm_fault_dump () for example.
334
335
*
335
336
* @return N/A
336
337
*/
337
- static int BusFault (z_arch_esf_t * esf , int fromHardFault , bool * recoverable )
338
+ static int bus_fault (z_arch_esf_t * esf , int from_hard_fault , bool * recoverable )
338
339
{
339
340
u32_t reason = K_ERR_CPU_EXCEPTION ;
340
341
@@ -360,7 +361,7 @@ static int BusFault(z_arch_esf_t *esf, int fromHardFault, bool *recoverable)
360
361
361
362
if ((SCB -> CFSR & SCB_CFSR_BFARVALID_Msk ) != 0 ) {
362
363
PR_EXC (" BFAR Address: 0x%x" , bfar );
363
- if (fromHardFault ) {
364
+ if (from_hard_fault ) {
364
365
/* clear SCB_CFSR_BFAR[VALID] to reset */
365
366
SCB -> CFSR &= ~SCB_CFSR_BFARVALID_Msk ;
366
367
}
@@ -482,13 +483,13 @@ static int BusFault(z_arch_esf_t *esf, int fromHardFault, bool *recoverable)
482
483
483
484
/**
484
485
*
485
- * @brief Dump usage fault information
486
+ * @brief Dump UsageFault information
486
487
*
487
- * See _FaultDump () for example.
488
+ * See z_arm_fault_dump () for example.
488
489
*
489
490
* @return error code to identify the fatal error reason
490
491
*/
491
- static u32_t UsageFault (const z_arch_esf_t * esf )
492
+ static u32_t usage_fault (const z_arch_esf_t * esf )
492
493
{
493
494
u32_t reason = K_ERR_CPU_EXCEPTION ;
494
495
@@ -538,13 +539,13 @@ static u32_t UsageFault(const z_arch_esf_t *esf)
538
539
#if defined(CONFIG_ARM_SECURE_FIRMWARE )
539
540
/**
540
541
*
541
- * @brief Dump secure fault information
542
+ * @brief Dump SecureFault information
542
543
*
543
- * See _FaultDump () for example.
544
+ * See z_arm_fault_dump () for example.
544
545
*
545
546
* @return N/A
546
547
*/
547
- static void SecureFault (const z_arch_esf_t * esf )
548
+ static void secure_fault (const z_arch_esf_t * esf )
548
549
{
549
550
PR_FAULT_INFO ("***** SECURE FAULT *****" );
550
551
@@ -579,11 +580,11 @@ static void SecureFault(const z_arch_esf_t *esf)
579
580
*
580
581
* @brief Dump debug monitor exception information
581
582
*
582
- * See _FaultDump () for example.
583
+ * See z_arm_fault_dump () for example.
583
584
*
584
585
* @return N/A
585
586
*/
586
- static void DebugMonitor (const z_arch_esf_t * esf )
587
+ static void debug_monitor (const z_arch_esf_t * esf )
587
588
{
588
589
ARG_UNUSED (esf );
589
590
@@ -599,11 +600,11 @@ static void DebugMonitor(const z_arch_esf_t *esf)
599
600
*
600
601
* @brief Dump hard fault information
601
602
*
602
- * See _FaultDump () for example.
603
+ * See z_arm_fault_dump () for example.
603
604
*
604
605
* @return error code to identify the fatal error reason
605
606
*/
606
- static u32_t HardFault (z_arch_esf_t * esf , bool * recoverable )
607
+ static u32_t hard_fault (z_arch_esf_t * esf , bool * recoverable )
607
608
{
608
609
u32_t reason = K_ERR_CPU_EXCEPTION ;
609
610
@@ -643,14 +644,14 @@ static u32_t HardFault(z_arch_esf_t *esf, bool *recoverable)
643
644
} else if ((SCB -> HFSR & SCB_HFSR_FORCED_Msk ) != 0 ) {
644
645
PR_EXC (" Fault escalation (see below)" );
645
646
if (SCB_MMFSR != 0 ) {
646
- reason = MpuFault (esf , 1 , recoverable );
647
+ reason = mem_manage_fault (esf , 1 , recoverable );
647
648
} else if (SCB_BFSR != 0 ) {
648
- reason = BusFault (esf , 1 , recoverable );
649
+ reason = bus_fault (esf , 1 , recoverable );
649
650
} else if (SCB_UFSR != 0 ) {
650
- reason = UsageFault (esf );
651
+ reason = usage_fault (esf );
651
652
#if defined(CONFIG_ARM_SECURE_FIRMWARE )
652
653
} else if (SAU -> SFSR != 0 ) {
653
- SecureFault (esf );
654
+ secure_fault (esf );
654
655
#endif /* CONFIG_ARM_SECURE_FIRMWARE */
655
656
}
656
657
}
@@ -665,11 +666,11 @@ static u32_t HardFault(z_arch_esf_t *esf, bool *recoverable)
665
666
*
666
667
* @brief Dump reserved exception information
667
668
*
668
- * See _FaultDump () for example.
669
+ * See z_arm_fault_dump () for example.
669
670
*
670
671
* @return N/A
671
672
*/
672
- static void ReservedException (const z_arch_esf_t * esf , int fault )
673
+ static void reserved_exception (const z_arch_esf_t * esf , int fault )
673
674
{
674
675
ARG_UNUSED (esf );
675
676
@@ -679,47 +680,47 @@ static void ReservedException(const z_arch_esf_t *esf, int fault)
679
680
}
680
681
681
682
/* Handler function for ARM fault conditions. */
682
- static u32_t FaultHandle (z_arch_esf_t * esf , int fault , bool * recoverable )
683
+ static u32_t fault_handle (z_arch_esf_t * esf , int fault , bool * recoverable )
683
684
{
684
685
u32_t reason = K_ERR_CPU_EXCEPTION ;
685
686
686
687
* recoverable = false;
687
688
688
689
switch (fault ) {
689
690
case 3 :
690
- reason = HardFault (esf , recoverable );
691
+ reason = hard_fault (esf , recoverable );
691
692
break ;
692
693
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE )
693
- /* HardFault is used for all fault conditions on ARMv6-M. */
694
+ /* HardFault is raised for all fault conditions on ARMv6-M. */
694
695
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE )
695
696
case 4 :
696
- reason = MpuFault (esf , 0 , recoverable );
697
+ reason = mem_manage_fault (esf , 0 , recoverable );
697
698
break ;
698
699
case 5 :
699
- reason = BusFault (esf , 0 , recoverable );
700
+ reason = bus_fault (esf , 0 , recoverable );
700
701
break ;
701
702
case 6 :
702
- reason = UsageFault (esf );
703
+ reason = usage_fault (esf );
703
704
break ;
704
705
#if defined(CONFIG_ARM_SECURE_FIRMWARE )
705
706
case 7 :
706
- SecureFault (esf );
707
+ secure_fault (esf );
707
708
break ;
708
709
#endif /* CONFIG_ARM_SECURE_FIRMWARE */
709
710
case 12 :
710
- DebugMonitor (esf );
711
+ debug_monitor (esf );
711
712
break ;
712
713
#else
713
714
#error Unknown ARM architecture
714
715
#endif /* CONFIG_ARMV6_M_ARMV8_M_BASELINE */
715
716
default :
716
- ReservedException (esf , fault );
717
+ reserved_exception (esf , fault );
717
718
break ;
718
719
}
719
720
720
721
if ((* recoverable ) == false) {
721
722
/* Dump generic information about the fault. */
722
- FaultShow (esf , fault );
723
+ fault_show (esf , fault );
723
724
}
724
725
725
726
return reason ;
@@ -733,7 +734,7 @@ static u32_t FaultHandle(z_arch_esf_t *esf, int fault, bool *recoverable)
733
734
*
734
735
* @param secure_esf Pointer to the secure stack frame.
735
736
*/
736
- static void SecureStackDump (const z_arch_esf_t * secure_esf )
737
+ static void secure_stack_dump (const z_arch_esf_t * secure_esf )
737
738
{
738
739
/*
739
740
* In case a Non-Secure exception interrupted the Secure
@@ -769,7 +770,7 @@ static void SecureStackDump(const z_arch_esf_t *secure_esf)
769
770
PR_FAULT_INFO (" S instruction address: 0x%x" , sec_ret_addr );
770
771
771
772
}
772
- #define SECURE_STACK_DUMP (esf ) SecureStackDump (esf)
773
+ #define SECURE_STACK_DUMP (esf ) secure_stack_dump (esf)
773
774
#else
774
775
/* We do not dump the Secure stack information for lower dump levels. */
775
776
#define SECURE_STACK_DUMP (esf )
@@ -805,7 +806,7 @@ static void SecureStackDump(const z_arch_esf_t *secure_esf)
805
806
* Note: exc_return argument shall only be used by the Fault handler if we are
806
807
* running a Secure Firmware.
807
808
*/
808
- void _Fault (z_arch_esf_t * esf , u32_t exc_return )
809
+ void z_arm_fault (z_arch_esf_t * esf , u32_t exc_return )
809
810
{
810
811
u32_t reason = K_ERR_CPU_EXCEPTION ;
811
812
int fault = SCB -> ICSR & SCB_ICSR_VECTACTIVE_Msk ;
@@ -880,7 +881,7 @@ void _Fault(z_arch_esf_t *esf, u32_t exc_return)
880
881
(void ) exc_return ;
881
882
#endif /* CONFIG_ARM_SECURE_FIRMWARE */
882
883
883
- reason = FaultHandle (esf , fault , & recoverable );
884
+ reason = fault_handle (esf , fault , & recoverable );
884
885
if (recoverable ) {
885
886
return ;
886
887
}
@@ -900,7 +901,7 @@ void _Fault(z_arch_esf_t *esf, u32_t exc_return)
900
901
*
901
902
* @return N/A
902
903
*/
903
- void z_FaultInit (void )
904
+ void z_arm_fault_init (void )
904
905
{
905
906
#if defined(CONFIG_ARMV6_M_ARMV8_M_BASELINE )
906
907
#elif defined(CONFIG_ARMV7_M_ARMV8_M_MAINLINE )
0 commit comments