Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

mcd_arch_interface.h 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /*
  2. * Copyright (c) 2025, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2025-08-16 Rbb666 first version
  9. */
  10. #ifndef __MCD_ARCH_INTERFACE_H__
  11. #define __MCD_ARCH_INTERFACE_H__
  12. #include <stdint.h>
  13. /**
  14. * @brief Architecture-specific hard fault exception handler
  15. *
  16. * This function should be implemented by each supported architecture
  17. * to handle the architecture-specific stack frame processing.
  18. *
  19. * @param context Pointer to exception context (architecture-specific format)
  20. * @return int Always returns -1 to indicate fault condition
  21. */
  22. #ifdef PKG_USING_MCOREDUMP_ARCH_ARMV7M
  23. int armv7m_hard_fault_exception_hook(void *context);
  24. /**
  25. * @brief Architecture-specific register collection function
  26. *
  27. * This function extracts register values from the architecture-specific
  28. * stack frame format and stores them in the standard register sets.
  29. *
  30. * @param stack_top Pointer to the stack frame
  31. * @param core_regset Pointer to store ARM core registers
  32. * @param fp_regset Pointer to store FPU registers
  33. */
  34. void collect_registers_armv7m(uint32_t *stack_top,
  35. core_regset_type *core_regset,
  36. fp_regset_type *fp_regset);
  37. /* Generic interface macro for architecture-agnostic code */
  38. #define collect_registers collect_registers_armv7m
  39. #endif
  40. #ifdef PKG_USING_MCOREDUMP_ARCH_ARMV8M
  41. int armv8m_hard_fault_exception_hook(void *context);
  42. /**
  43. * @brief Architecture-specific register collection function
  44. *
  45. * This function extracts register values from the architecture-specific
  46. * stack frame format and stores them in the standard register sets.
  47. *
  48. * @param stack_top Pointer to the stack frame
  49. * @param core_regset Pointer to store ARM core registers
  50. * @param fp_regset Pointer to store FPU registers
  51. */
  52. void collect_registers_armv8m(uint32_t *stack_top,
  53. core_regset_type *core_regset,
  54. fp_regset_type *fp_regset);
  55. /* Generic interface macro for architecture-agnostic code */
  56. #define collect_registers collect_registers_armv8m
  57. #endif
  58. #endif /* __MCD_ARCH_INTERFACE_H__ */