sigcontext.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. #ifndef _ASMi386_SIGCONTEXT_H
  2. #define _ASMi386_SIGCONTEXT_H
  3. /*
  4.  * As documented in the iBCS2 standard..
  5.  *
  6.  * The first part of "struct _fpstate" is just the normal i387
  7.  * hardware setup, the extra "status" word is used to save the
  8.  * coprocessor status word before entering the handler.
  9.  *
  10.  * Pentium III FXSR, SSE support
  11.  * Gareth Hughes <gareth@valinux.com>, May 2000
  12.  *
  13.  * The FPU state data structure has had to grow to accomodate the
  14.  * extended FPU state required by the Streaming SIMD Extensions.
  15.  * There is no documented standard to accomplish this at the moment.
  16.  */
  17. struct _fpreg {
  18. unsigned short significand[4];
  19. unsigned short exponent;
  20. };
  21. struct _fpxreg {
  22. unsigned short significand[4];
  23. unsigned short exponent;
  24. unsigned short padding[3];
  25. };
  26. struct _xmmreg {
  27. unsigned long element[4];
  28. };
  29. struct _fpstate {
  30. /* Regular FPU environment */
  31. unsigned long  cw;
  32. unsigned long sw;
  33. unsigned long tag;
  34. unsigned long ipoff;
  35. unsigned long cssel;
  36. unsigned long dataoff;
  37. unsigned long datasel;
  38. struct _fpreg _st[8];
  39. unsigned short status;
  40. unsigned short magic; /* 0xffff = regular FPU data only */
  41. /* FXSR FPU environment */
  42. unsigned long _fxsr_env[6]; /* FXSR FPU env is ignored */
  43. unsigned long mxcsr;
  44. unsigned long reserved;
  45. struct _fpxreg _fxsr_st[8]; /* FXSR FPU reg data is ignored */
  46. struct _xmmreg _xmm[8];
  47. unsigned long padding[56];
  48. };
  49. #define X86_FXSR_MAGIC 0x0000
  50. struct sigcontext {
  51. unsigned short gs, __gsh;
  52. unsigned short fs, __fsh;
  53. unsigned short es, __esh;
  54. unsigned short ds, __dsh;
  55. unsigned long edi;
  56. unsigned long esi;
  57. unsigned long ebp;
  58. unsigned long esp;
  59. unsigned long ebx;
  60. unsigned long edx;
  61. unsigned long ecx;
  62. unsigned long eax;
  63. unsigned long trapno;
  64. unsigned long err;
  65. unsigned long eip;
  66. unsigned short cs, __csh;
  67. unsigned long eflags;
  68. unsigned long esp_at_signal;
  69. unsigned short ss, __ssh;
  70. struct _fpstate * fpstate;
  71. unsigned long oldmask;
  72. unsigned long cr2;
  73. };
  74. #endif