Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

registers.h 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #ifndef REGISTERS_H
  2. #define REGISTERS_H
  3. #include "stdint.h"
  4. #include "compiler.h"
  5. /* Basic 16-bit and 32-bit register types */
  6. typedef union {
  7. struct {
  8. union {
  9. uint8_t l;
  10. uint8_t byte;
  11. };
  12. uint8_t h;
  13. } PACKED;
  14. uint16_t word;
  15. } PACKED reg16_t;
  16. typedef union {
  17. reg16_t;
  18. uint32_t dword;
  19. } PACKED reg32_t;
  20. /* As created by pushal / read by popal */
  21. struct i386_regs {
  22. union {
  23. uint16_t di;
  24. uint32_t edi;
  25. };
  26. union {
  27. uint16_t si;
  28. uint32_t esi;
  29. };
  30. union {
  31. uint16_t bp;
  32. uint32_t ebp;
  33. };
  34. union {
  35. uint16_t sp;
  36. uint32_t esp;
  37. };
  38. union {
  39. struct {
  40. uint8_t bl;
  41. uint8_t bh;
  42. } PACKED;
  43. uint16_t bx;
  44. uint32_t ebx;
  45. };
  46. union {
  47. struct {
  48. uint8_t dl;
  49. uint8_t dh;
  50. } PACKED;
  51. uint16_t dx;
  52. uint32_t edx;
  53. };
  54. union {
  55. struct {
  56. uint8_t cl;
  57. uint8_t ch;
  58. } PACKED;
  59. uint16_t cx;
  60. uint32_t ecx;
  61. };
  62. union {
  63. struct {
  64. uint8_t al;
  65. uint8_t ah;
  66. } PACKED;
  67. uint16_t ax;
  68. uint32_t eax;
  69. };
  70. } PACKED;
  71. /* Our pushal/popal equivalent for segment registers */
  72. struct i386_seg_regs {
  73. uint16_t cs;
  74. uint16_t ss;
  75. uint16_t ds;
  76. uint16_t es;
  77. uint16_t fs;
  78. uint16_t gs;
  79. } PACKED;
  80. /* All i386 registers, as passed in by prot_call or kir_call */
  81. struct i386_all_regs {
  82. struct i386_seg_regs;
  83. struct i386_regs;
  84. uint32_t i386_flags;
  85. } PACKED;
  86. #endif /* REGISTERS_H */