boot_info.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /**
  2. * @file boot_info.h
  3. * @brief 启动信息接口
  4. * @author Zone.N ([email protected])
  5. * @version 1.0
  6. * @date 2021-09-18
  7. * @copyright MIT LICENSE
  8. * https://github.com/Simple-XX/SimpleKernel
  9. * @par change log:
  10. * <table>
  11. * <tr><th>Date<th>Author<th>Description
  12. * <tr><td>2021-09-18<td>digmouse233<td>迁移到 doxygen
  13. * </table>
  14. */
  15. #ifndef _BOOT_INFO_H_
  16. #define _BOOT_INFO_H_
  17. #include "stdint.h"
  18. //#include "resource.h"
  19. /**
  20. * @brief 启动信息接口
  21. * 由引导传递的机器信息处理
  22. * 如 grub2 传递的 multiboot2 结构
  23. * opensbi 传递的 dtb 结构
  24. * 注意这部分是通过内存传递的,在重新保存之前不能被覆盖
  25. * 架构专有的数据在 dtb.h 或 multiboot2.h
  26. * 实现在 dtb.cpp 或 multiboot2.cpp
  27. */
  28. namespace BOOT_INFO {
  29. /// 声明,定义在具体的实现中
  30. /// 地址
  31. extern "C" uintptr_t boot_info_addr;
  32. /// 长度
  33. extern size_t boot_info_size;
  34. /**
  35. * @brief 初始化,定义在具体实现中
  36. * @return true 成功
  37. * @return false 成功
  38. */
  39. extern bool init(void);
  40. /**
  41. * @brief 获取物理内存信息
  42. * @return resource_t 物理内存资源信息
  43. */
  44. extern resource_t get_memory(void);
  45. /**
  46. * @brief 获取 clint 信息
  47. * @return resource_t clint 资源信息
  48. */
  49. extern resource_t get_clint(void);
  50. /**
  51. * @brief 获取 plic 信息
  52. * @return resource_t plic 资源信息
  53. */
  54. extern resource_t get_plic(void);
  55. };
  56. #endif /* _BOOT_INFO_H_ */