hal_blue_screen.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /* Copyright (C) 2018 RDA Technologies Limited and/or its affiliates("RDA").
  2. * All rights reserved.
  3. *
  4. * This software is supplied "AS IS" without any warranties.
  5. * RDA assumes no responsibility or liability for the use of the software,
  6. * conveys no license or title under any patent, copyright, or mask work
  7. * right to the product. RDA reserves the right to make changes in the
  8. * software without notification. RDA also make no representation or
  9. * warranty that such application will be suitable for the specified use
  10. * without further testing or modification.
  11. */
  12. #ifndef _HAL_BLUE_SCREEN_H_
  13. #define _HAL_BLUE_SCREEN_H_
  14. #include "osi_compiler.h"
  15. OSI_EXTERN_C_BEGIN
  16. /**
  17. * \brief save blue screen context
  18. *
  19. * The context format and \p ctx format are implementation dependent,
  20. * and platform dependent. It must match the exception handler.
  21. *
  22. * It should be only called in the beginning of blue screen.
  23. *
  24. * It may be called in bootloader (without OS) stage, and application
  25. * (with OS) stage. The format should be the same.
  26. *
  27. * The string information will be prepare, and can be fetched by
  28. * \p halBlueScreenGetInfo.
  29. */
  30. void halBlueScreenSaveContext(void);
  31. /**
  32. * \brief get blue screen info
  33. *
  34. * \return
  35. * - blue screen info string
  36. */
  37. const char *halBlueScreenGetInfo(void);
  38. /**
  39. * \brief save blue screen info into bscore buffer
  40. */
  41. void halBscoreBufSave(void);
  42. /**
  43. * \brief get bscore buffer
  44. *
  45. * \return
  46. * - blue screen core buffer pointer and size
  47. * - (0, 0) if there are no blue screen core buffer
  48. */
  49. osiBuffer_t halGetBscoreBuf(void);
  50. /**
  51. * \brief clear bscore buffer
  52. *
  53. * This should be called after the bscore buffer is processed.
  54. *
  55. * \code{.cpp}
  56. * osiBuffer_t buf = halGetBscoreBuf();
  57. * if (buf.size > 0) {
  58. * // Save bscore buffer, or send out the buffer,
  59. * // or copy to another place to be processed later.
  60. * }
  61. * halClearBscoreBuf(); // clear it no matter it is valid or not
  62. * \endcode
  63. */
  64. void halClearBscoreBuf(void);
  65. OSI_EXTERN_C_END
  66. #endif