csky_clone.S 418 B

123456789101112131415161718192021222324252627
  1. /*
  2. * Copyright (C) 2017 Hangzhou C-SKY Microsystems co.,ltd.
  3. *
  4. * Licensed under the LGPL v2.1 or later, see the file COPYING.LIB
  5. * in this tarball.
  6. */
  7. #include <sysdep.h>
  8. PSEUDO_ERRVAL(__csky_clone, clone, 5)
  9. cmpnei a0, 0
  10. bf start_thread
  11. rts
  12. start_thread:
  13. #ifdef __CSKYABIV2__
  14. subi sp, 4
  15. #endif
  16. ld.w a0, (sp, 0x4)
  17. ld.w a1, (sp, 0x0)
  18. addi sp, 8
  19. jsr a1
  20. DO_CALL(exit, 0)
  21. END(__csky_clone)