stub-data.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. /*
  3. * Copyright (C) 2015 Thomas Meyer (thomas@m3y3r.de)
  4. * Copyright (C) 2005 Jeff Dike (jdike@karaya.com)
  5. */
  6. #ifndef __STUB_DATA_H
  7. #define __STUB_DATA_H
  8. #include <linux/compiler_types.h>
  9. #include <as-layout.h>
  10. #include <sysdep/tls.h>
  11. #define STUB_NEXT_SYSCALL(s) \
  12. ((struct stub_syscall *) (((unsigned long) s) + (s)->cmd_len))
  13. enum stub_syscall_type {
  14. STUB_SYSCALL_UNSET = 0,
  15. STUB_SYSCALL_MMAP,
  16. STUB_SYSCALL_MUNMAP,
  17. STUB_SYSCALL_MPROTECT,
  18. };
  19. struct stub_syscall {
  20. struct {
  21. unsigned long addr;
  22. unsigned long length;
  23. unsigned long offset;
  24. int fd;
  25. int prot;
  26. } mem;
  27. enum stub_syscall_type syscall;
  28. };
  29. struct stub_data {
  30. unsigned long offset;
  31. long err, child_err;
  32. int syscall_data_len;
  33. /* 128 leaves enough room for additional fields in the struct */
  34. struct stub_syscall syscall_data[(UM_KERN_PAGE_SIZE - 128) / sizeof(struct stub_syscall)] __aligned(16);
  35. /* Stack for our signal handlers and for calling into . */
  36. unsigned char sigstack[UM_KERN_PAGE_SIZE] __aligned(UM_KERN_PAGE_SIZE);
  37. };
  38. #endif