ucontexth.inc 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. const
  2. {* Used by swapcontext(3). *}
  3. UCF_SWAPPED = $00000001;
  4. _MC_FPFMT_NODEV = $10000; {* device not present or configured *}
  5. _MC_FPFMT_387 = $10001;
  6. _MC_FPFMT_XMM = $10002;
  7. _MC_FPOWNED_NONE = $20000; {* FP state not used *}
  8. _MC_FPOWNED_FPU = $20001; {* FP state came from FPU *}
  9. _MC_FPOWNED_PCB = $20002; {* FP state came from PCB *}
  10. type
  11. plwpid_t = ^lwpid_t;
  12. lwpid_t = cint32;
  13. TLwPid = lwpid_t;
  14. PLwPid = ^lwpid_t;
  15. {$packrecords 16}
  16. TMCFPStateArray = record
  17. items: array[0..127] of cInt;
  18. end;
  19. {$packrecords C}
  20. mcontext_t = record
  21. {*
  22. * The first 20 fields must match the definition of
  23. * sigcontext. So that we can support sigcontext
  24. * and ucontext_t at the same time.
  25. *}
  26. mc_onstack: cInt; {* XXX - sigcontext compat. *}
  27. mc_gs: cInt; {* machine state (struct trapframe) *}
  28. mc_fs: cInt;
  29. mc_es: cInt;
  30. mc_ds: cInt;
  31. mc_edi: cInt;
  32. mc_esi: cInt;
  33. mc_ebp: cInt;
  34. mc_isp: cInt;
  35. mc_ebx: cInt;
  36. mc_edx: cInt;
  37. mc_ecx: cInt;
  38. mc_eax: cInt;
  39. mc_trapno: cInt;
  40. mc_err: cInt;
  41. mc_eip: cInt;
  42. mc_cs: cInt;
  43. mc_eflags: cInt;
  44. mc_esp: cInt;
  45. mc_ss: cInt;
  46. mc_len: cInt; {* sizeof(mcontext_t) *}
  47. mc_fpformat: cInt;
  48. mc_ownedfp: cInt;
  49. mc_spare1: array[0..0] of cInt; {* align next field to 16 bytes *}
  50. mc_fpstate: TMCFPStateArray;
  51. mc_spare2: array[0..7] of cInt;
  52. end;
  53. pucontext_t = ^ucontext_t;
  54. ucontext_t = record // required for kse threads
  55. {*
  56. * Keep the order of the first two fields. Also,
  57. * keep them the first two fields in the structure.
  58. * This way we can have a union with struct
  59. * sigcontext and ucontext_t. This allows us to
  60. * support them both at the same time.
  61. * note: the union is not defined, though.
  62. *}
  63. uc_sigmask: sigset_t;
  64. uc_mcontext: mcontext_t;
  65. uc_link: pucontext_t;
  66. uc_stack: stack_t;
  67. uc_flags: cInt;
  68. __spare__: array[0..3] of cInt;
  69. end;