parameters.c 716 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /*
  2. * Copyright (c) 2006-2021, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Email: opensource_embedded@phytium.com.cn
  7. *
  8. * Change Logs:
  9. * Date Author Notes
  10. * 2022-10-26 huanghe first commit
  11. *
  12. */
  13. #include "rtconfig.h"
  14. #include <rtthread.h>
  15. #include "fcpu_info.h"
  16. #include "fparameters.h"
  17. u32 GetCpuMaskToAffval(u32 *cpu_mask, u32 *cluster_id, u32 *target_list)
  18. {
  19. if (*cpu_mask == 0)
  20. {
  21. return 0;
  22. }
  23. *target_list = 0;
  24. *cluster_id = 0;
  25. if (*cpu_mask & 0x1)
  26. {
  27. *target_list = 1;
  28. *cluster_id = 0x200;
  29. *cpu_mask &= ~0x1;
  30. }
  31. else
  32. {
  33. *cpu_mask = 0;
  34. return 0;
  35. }
  36. return 1;
  37. }