cpuport.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. /*
  2. * Copyright (c) 2006-2018, RT-Thread Development Team
  3. * Copyright (c) 2019-Present Nuclei Limited. All rights reserved.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Change Logs:
  8. * Date Author Notes
  9. * 2020/03/26 Huaqi Nuclei RISC-V Core porting code.
  10. */
  11. #ifndef __CPUPORT_H__
  12. #define __CPUPORT_H__
  13. #include <rtconfig.h>
  14. #include <nuclei_sdk_soc.h>
  15. #ifdef __cplusplus
  16. extern "C" {
  17. #endif
  18. /* Scheduler utilities. */
  19. #define portYIELD() \
  20. { \
  21. /* Set a software interrupt(SWI) request to request a context switch. */ \
  22. SysTimer_SetSWIRQ(); \
  23. /* Barriers are normally not required but do ensure the code is completely \
  24. within the specified behaviour for the architecture. */ \
  25. __RWMB(); \
  26. }
  27. #ifdef __cplusplus
  28. }
  29. #endif
  30. #endif