本站源代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

40 lines
1.0KB

  1. // Copyright 2015 The Go Authors. All rights reserved.
  2. // Use of this source code is governed by a BSD-style
  3. // license that can be found in the LICENSE file.
  4. // +build gccgo
  5. // +build !aix
  6. #include <errno.h>
  7. #include <stdint.h>
  8. #include <unistd.h>
  9. #define _STRINGIFY2_(x) #x
  10. #define _STRINGIFY_(x) _STRINGIFY2_(x)
  11. #define GOSYM_PREFIX _STRINGIFY_(__USER_LABEL_PREFIX__)
  12. // Call syscall from C code because the gccgo support for calling from
  13. // Go to C does not support varargs functions.
  14. struct ret {
  15. uintptr_t r;
  16. uintptr_t err;
  17. };
  18. struct ret
  19. gccgoRealSyscall(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
  20. {
  21. struct ret r;
  22. errno = 0;
  23. r.r = syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
  24. r.err = errno;
  25. return r;
  26. }
  27. uintptr_t
  28. gccgoRealSyscallNoError(uintptr_t trap, uintptr_t a1, uintptr_t a2, uintptr_t a3, uintptr_t a4, uintptr_t a5, uintptr_t a6, uintptr_t a7, uintptr_t a8, uintptr_t a9)
  29. {
  30. return syscall(trap, a1, a2, a3, a4, a5, a6, a7, a8, a9);
  31. }
上海开阖软件有限公司 沪ICP备12045867号-1