syscall.c 753 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * Copyright (C) 2017 Andes Technology, Inc.
  3. * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
  4. */
  5. #include <errno.h>
  6. #include <stdarg.h>
  7. #include <sys/syscall.h>
  8. #include <sysdep.h>
  9. #include <unistd.h>
  10. long int syscall (long int __sysno, ...)
  11. {
  12. int result;
  13. unsigned long arg1,arg2,arg3,arg4,arg5,arg6;
  14. va_list arg;
  15. va_start (arg, __sysno);
  16. arg1 = va_arg (arg, unsigned long);
  17. arg2 = va_arg (arg, unsigned long);
  18. arg3 = va_arg (arg, unsigned long);
  19. arg4 = va_arg (arg, unsigned long);
  20. arg5 = va_arg (arg, unsigned long);
  21. arg6 = va_arg (arg, unsigned long);
  22. va_end (arg);
  23. __asm__ volatile ( "" ::: "memory" );
  24. result = INLINE_SYSCALL(syscall,7,__sysno,arg1,arg2,arg3,arg4,arg5,arg6);
  25. return result;
  26. }