target_arch_signal.h 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. /*
  2. * i386 dependent signal definitions
  3. *
  4. *
  5. * This program is free software; you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation; either version 2 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program; if not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef TARGET_ARCH_SIGNAL_H
  19. #define TARGET_ARCH_SIGNAL_H
  20. #include "cpu.h"
  21. /* Size of the signal trampolin code placed on the stack. */
  22. #define TARGET_SZSIGCODE 0
  23. /* compare to x86/include/_limits.h */
  24. #define TARGET_MINSIGSTKSZ (512 * 4) /* min sig stack size */
  25. #define TARGET_SIGSTKSZ (MINSIGSTKSZ + 32768) /* recommended size */
  26. typedef struct target_mcontext {
  27. abi_ulong mc_onstack; /* XXX - sigcontext compat. */
  28. abi_ulong mc_gs; /* machine state (struct trapframe) */
  29. abi_ulong mc_fs;
  30. abi_ulong mc_es;
  31. abi_ulong mc_ds;
  32. abi_ulong mc_edi;
  33. abi_ulong mc_esi;
  34. abi_ulong mc_ebp;
  35. abi_ulong mc_isp;
  36. abi_ulong mc_ebx;
  37. abi_ulong mc_edx;
  38. abi_ulong mc_ecx;
  39. abi_ulong mc_eax;
  40. abi_ulong mc_trapno;
  41. abi_ulong mc_err;
  42. abi_ulong mc_eip;
  43. abi_ulong mc_cs;
  44. abi_ulong mc_eflags;
  45. abi_ulong mc_esp;
  46. abi_ulong mc_ss;
  47. int32_t mc_len; /* sizeof(mcontext_t) */
  48. #define _MC_FPFMT_NODEV 0x10000 /* device not present or configured */
  49. #define _MC_FPFMT_387 0x10001
  50. #define _MC_FPFMT_XMM 0x10002
  51. int32_t mc_fpformat;
  52. #define _MC_FPOWNED_NONE 0x20000 /* FP state not used */
  53. #define _MC_FPOWNED_FPU 0x20001 /* FP state came from FPU */
  54. #define _MC_FPOWNED_PCB 0x20002 /* FP state came from PCB */
  55. int32_t mc_ownedfp;
  56. abi_ulong mc_flags;
  57. /*
  58. * See <machine/npx.h> for the internals of mc_fpstate[].
  59. */
  60. int32_t mc_fpstate[128] __aligned(16);
  61. abi_ulong mc_fsbase;
  62. abi_ulong mc_gsbase;
  63. abi_ulong mc_xfpustate;
  64. abi_ulong mc_xfpustate_len;
  65. int32_t mc_spare2[4];
  66. } target_mcontext_t;
  67. #define TARGET_MCONTEXT_SIZE 640
  68. #define TARGET_UCONTEXT_SIZE 704
  69. #include "target_os_ucontext.h"
  70. struct target_sigframe {
  71. abi_ulong sf_signum;
  72. abi_ulong sf_siginfo; /* code or pointer to sf_si */
  73. abi_ulong sf_ucontext; /* points to sf_uc */
  74. abi_ulong sf_addr; /* undocumented 4th arg */
  75. target_ucontext_t sf_uc; /* = *sf_uncontext */
  76. target_siginfo_t sf_si; /* = *sf_siginfo (SA_SIGINFO case)*/
  77. uint32_t __spare__[2];
  78. };
  79. #define TARGET_SIGSTACK_ALIGN 8
  80. #endif /* TARGET_ARCH_SIGNAL_H */