compat_rt_sigframe.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #include<linux/compat.h>
  2. #include<linux/compat_siginfo.h>
  3. #include<asm/compat_ucontext.h>
  4. #ifndef _ASM_PARISC_COMPAT_RT_SIGFRAME_H
  5. #define _ASM_PARISC_COMPAT_RT_SIGFRAME_H
  6. /* In a deft move of uber-hackery, we decide to carry the top half of all
  7. * 64-bit registers in a non-portable, non-ABI, hidden structure.
  8. * Userspace can read the hidden structure if it *wants* but is never
  9. * guaranteed to be in the same place. Infact the uc_sigmask from the
  10. * ucontext_t structure may push the hidden register file downards
  11. */
  12. struct compat_regfile {
  13. /* Upper half of all the 64-bit registers that were truncated
  14. on a copy to a 32-bit userspace */
  15. compat_int_t rf_gr[32];
  16. compat_int_t rf_iasq[2];
  17. compat_int_t rf_iaoq[2];
  18. compat_int_t rf_sar;
  19. };
  20. #define COMPAT_SIGRETURN_TRAMP 4
  21. #define COMPAT_SIGRESTARTBLOCK_TRAMP 5
  22. #define COMPAT_TRAMP_SIZE (COMPAT_SIGRETURN_TRAMP + COMPAT_SIGRESTARTBLOCK_TRAMP)
  23. struct compat_rt_sigframe {
  24. /* XXX: Must match trampoline size in arch/parisc/kernel/signal.c
  25. Secondary to that it must protect the ERESTART_RESTARTBLOCK
  26. trampoline we left on the stack (we were bad and didn't
  27. change sp so we could run really fast.) */
  28. compat_uint_t tramp[COMPAT_TRAMP_SIZE];
  29. compat_siginfo_t info;
  30. struct compat_ucontext uc;
  31. /* Hidden location of truncated registers, *must* be last. */
  32. struct compat_regfile regs;
  33. };
  34. /*
  35. * The 32-bit ABI wants at least 48 bytes for a function call frame:
  36. * 16 bytes for arg0-arg3, and 32 bytes for magic (the only part of
  37. * which Linux/parisc uses is sp-20 for the saved return pointer...)
  38. * Then, the stack pointer must be rounded to a cache line (64 bytes).
  39. */
  40. #define SIGFRAME32 64
  41. #define FUNCTIONCALLFRAME32 48
  42. #define PARISC_RT_SIGFRAME_SIZE32 \
  43. (((sizeof(struct compat_rt_sigframe) + FUNCTIONCALLFRAME32) + SIGFRAME32) & -SIGFRAME32)
  44. #endif