cpu.h 817 B

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2006-2019, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. */
  9. #ifndef __RT_HW_CPU_H__
  10. #define __RT_HW_CPU_H__
  11. #include <rthw.h>
  12. #include <rtthread.h>
  13. #include <stdbool.h>
  14. struct cpu_ops_t {
  15. const char *method;
  16. int (*cpu_init)(rt_uint32_t id);
  17. int (*cpu_boot)(rt_uint32_t id);
  18. void (*cpu_shutdown)(void);
  19. };
  20. extern rt_uint64_t rt_cpu_mpidr_early[];
  21. #define cpuid_to_hwid(cpuid) rt_cpu_mpidr_early[cpuid]
  22. extern void rt_hw_cpu_shutdown(void);
  23. extern int rt_hw_cpu_init();
  24. extern int rt_hw_cpu_boot_secondary(int num_cpus, rt_uint64_t *cpu_hw_ids, struct cpu_ops_t *cpu_ops[]);
  25. extern struct cpu_ops_t cpu_ops_psci;
  26. extern struct cpu_ops_t cpu_ops_spin_tbl;
  27. #endif /* __RT_HW_CPU_H__ */