diff --git a/bochs/cpu/cpu.h b/bochs/cpu/cpu.h index b8eb76f54..085d4b43e 100644 --- a/bochs/cpu/cpu.h +++ b/bochs/cpu/cpu.h @@ -26,51 +26,59 @@ // // segment register encoding -#define BX_SEG_REG_ES 0 -#define BX_SEG_REG_CS 1 -#define BX_SEG_REG_SS 2 -#define BX_SEG_REG_DS 3 -#define BX_SEG_REG_FS 4 -#define BX_SEG_REG_GS 5 +enum { + BX_SEG_REG_ES = 0, + BX_SEG_REG_CS = 1, + BX_SEG_REG_SS = 2, + BX_SEG_REG_DS = 3, + BX_SEG_REG_FS = 4, + BX_SEG_REG_GS = 5 +}; + // NULL now has to fit in 3 bits. #define BX_SEG_REG_NULL 7 #define BX_NULL_SEG_REG(seg) ((seg) == BX_SEG_REG_NULL) -#define BX_16BIT_REG_AX 0 -#define BX_16BIT_REG_CX 1 -#define BX_16BIT_REG_DX 2 -#define BX_16BIT_REG_BX 3 -#define BX_16BIT_REG_SP 4 -#define BX_16BIT_REG_BP 5 -#define BX_16BIT_REG_SI 6 -#define BX_16BIT_REG_DI 7 +enum { + BX_16BIT_REG_AX, + BX_16BIT_REG_CX, + BX_16BIT_REG_DX, + BX_16BIT_REG_BX, + BX_16BIT_REG_SP, + BX_16BIT_REG_BP, + BX_16BIT_REG_SI, + BX_16BIT_REG_DI +}; -#define BX_32BIT_REG_EAX 0 -#define BX_32BIT_REG_ECX 1 -#define BX_32BIT_REG_EDX 2 -#define BX_32BIT_REG_EBX 3 -#define BX_32BIT_REG_ESP 4 -#define BX_32BIT_REG_EBP 5 -#define BX_32BIT_REG_ESI 6 -#define BX_32BIT_REG_EDI 7 +enum { + BX_32BIT_REG_EAX, + BX_32BIT_REG_ECX, + BX_32BIT_REG_EDX, + BX_32BIT_REG_EBX, + BX_32BIT_REG_ESP, + BX_32BIT_REG_EBP, + BX_32BIT_REG_ESI, + BX_32BIT_REG_EDI +}; -#define BX_64BIT_REG_RAX 0 -#define BX_64BIT_REG_RCX 1 -#define BX_64BIT_REG_RDX 2 -#define BX_64BIT_REG_RBX 3 -#define BX_64BIT_REG_RSP 4 -#define BX_64BIT_REG_RBP 5 -#define BX_64BIT_REG_RSI 6 -#define BX_64BIT_REG_RDI 7 - -#define BX_64BIT_REG_R8 8 -#define BX_64BIT_REG_R9 9 -#define BX_64BIT_REG_R10 10 -#define BX_64BIT_REG_R11 11 -#define BX_64BIT_REG_R12 12 -#define BX_64BIT_REG_R13 13 -#define BX_64BIT_REG_R14 14 -#define BX_64BIT_REG_R15 15 +enum { + BX_64BIT_REG_RAX, + BX_64BIT_REG_RCX, + BX_64BIT_REG_RDX, + BX_64BIT_REG_RBX, + BX_64BIT_REG_RSP, + BX_64BIT_REG_RBP, + BX_64BIT_REG_RSI, + BX_64BIT_REG_RDI, + BX_64BIT_REG_R8, + BX_64BIT_REG_R9, + BX_64BIT_REG_R10, + BX_64BIT_REG_R11, + BX_64BIT_REG_R12, + BX_64BIT_REG_R13, + BX_64BIT_REG_R14, + BX_64BIT_REG_R15 +}; #if BX_SUPPORT_X86_64 # define BX_GENERAL_REGISTERS 16 @@ -5425,10 +5433,13 @@ IMPLEMENT_EFLAG_SET_ACCESSOR (DF, 10) IMPLEMENT_EFLAG_SET_ACCESSOR_IF( 9) IMPLEMENT_EFLAG_SET_ACCESSOR_TF( 8) -#define BX_TASK_FROM_CALL 0 -#define BX_TASK_FROM_IRET 1 -#define BX_TASK_FROM_JUMP 2 -#define BX_TASK_FROM_INT 3 +// hardware task switching +enum { + BX_TASK_FROM_CALL = 0, + BX_TASK_FROM_IRET = 1, + BX_TASK_FROM_JUMP = 2, + BX_TASK_FROM_INT = 3 +}; // exception types for interrupt method enum {