mirror of
https://github.com/reactos/reactos.git
synced 2025-01-06 06:20:13 +00:00
[SOFT386]
- Code formatting (align on 4-space) - Fix union / struct problem in _SOFT386_PAGE_TABLE. svn path=/branches/ntvdm/; revision=60189
This commit is contained in:
parent
7588e8cb68
commit
c27ff5b52f
3 changed files with 108 additions and 105 deletions
|
@ -11,35 +11,35 @@
|
||||||
|
|
||||||
/* DEFINES ********************************************************************/
|
/* DEFINES ********************************************************************/
|
||||||
|
|
||||||
#define SOFT386_NUM_GEN_REGS 8
|
#define SOFT386_NUM_GEN_REGS 8
|
||||||
#define SOFT386_NUM_SEG_REGS 6
|
#define SOFT386_NUM_SEG_REGS 6
|
||||||
#define SOFT386_NUM_CTRL_REGS 8
|
#define SOFT386_NUM_CTRL_REGS 8
|
||||||
#define SOFT386_NUM_DBG_REGS 8
|
#define SOFT386_NUM_DBG_REGS 8
|
||||||
|
|
||||||
#define SOFT386_CR0_PE (1 << 0)
|
#define SOFT386_CR0_PE (1 << 0)
|
||||||
#define SOFT386_CR0_MP (1 << 1)
|
#define SOFT386_CR0_MP (1 << 1)
|
||||||
#define SOFT386_CR0_EM (1 << 2)
|
#define SOFT386_CR0_EM (1 << 2)
|
||||||
#define SOFT386_CR0_TS (1 << 3)
|
#define SOFT386_CR0_TS (1 << 3)
|
||||||
#define SOFT386_CR0_ET (1 << 4)
|
#define SOFT386_CR0_ET (1 << 4)
|
||||||
#define SOFT386_CR0_NE (1 << 5)
|
#define SOFT386_CR0_NE (1 << 5)
|
||||||
#define SOFT386_CR0_WP (1 << 16)
|
#define SOFT386_CR0_WP (1 << 16)
|
||||||
#define SOFT386_CR0_AM (1 << 18)
|
#define SOFT386_CR0_AM (1 << 18)
|
||||||
#define SOFT386_CR0_NW (1 << 29)
|
#define SOFT386_CR0_NW (1 << 29)
|
||||||
#define SOFT386_CR0_CD (1 << 30)
|
#define SOFT386_CR0_CD (1 << 30)
|
||||||
#define SOFT386_CR0_PG (1 << 31)
|
#define SOFT386_CR0_PG (1 << 31)
|
||||||
|
|
||||||
#define SOFT386_IDT_TASK_GATE 0x5
|
#define SOFT386_IDT_TASK_GATE 0x5
|
||||||
#define SOFT386_IDT_INT_GATE 0x6
|
#define SOFT386_IDT_INT_GATE 0x6
|
||||||
#define SOFT386_IDT_TRAP_GATE 0x7
|
#define SOFT386_IDT_TRAP_GATE 0x7
|
||||||
#define SOFT386_IDT_INT_GATE_32 0xE
|
#define SOFT386_IDT_INT_GATE_32 0xE
|
||||||
#define SOFT386_IDT_TRAP_GATE_32 0xF
|
#define SOFT386_IDT_TRAP_GATE_32 0xF
|
||||||
|
|
||||||
#define SOFT386_PREFIX_SEG (1 << 0)
|
#define SOFT386_PREFIX_SEG (1 << 0)
|
||||||
#define SOFT386_PREFIX_OPSIZE (1 << 1)
|
#define SOFT386_PREFIX_OPSIZE (1 << 1)
|
||||||
#define SOFT386_PREFIX_ADSIZE (1 << 2)
|
#define SOFT386_PREFIX_ADSIZE (1 << 2)
|
||||||
#define SOFT386_PREFIX_LOCK (1 << 3)
|
#define SOFT386_PREFIX_LOCK (1 << 3)
|
||||||
#define SOFT386_PREFIX_REPNZ (1 << 4)
|
#define SOFT386_PREFIX_REPNZ (1 << 4)
|
||||||
#define SOFT386_PREFIX_REP (1 << 5)
|
#define SOFT386_PREFIX_REP (1 << 5)
|
||||||
|
|
||||||
struct _SOFT386_STATE;
|
struct _SOFT386_STATE;
|
||||||
typedef struct _SOFT386_STATE SOFT386_STATE, *PSOFT386_STATE;
|
typedef struct _SOFT386_STATE SOFT386_STATE, *PSOFT386_STATE;
|
||||||
|
@ -176,47 +176,47 @@ typedef struct _SOFT386_SEG_REG
|
||||||
USHORT Selector;
|
USHORT Selector;
|
||||||
|
|
||||||
/* Descriptor cache */
|
/* Descriptor cache */
|
||||||
ULONG Accessed : 1;
|
ULONG Accessed : 1;
|
||||||
ULONG ReadWrite : 1;
|
ULONG ReadWrite : 1;
|
||||||
ULONG DirConf : 1;
|
ULONG DirConf : 1;
|
||||||
ULONG Executable : 1;
|
ULONG Executable : 1;
|
||||||
ULONG SystemType : 1;
|
ULONG SystemType : 1;
|
||||||
ULONG Dpl : 2;
|
ULONG Dpl : 2;
|
||||||
ULONG Present : 1;
|
ULONG Present : 1;
|
||||||
ULONG Size : 1;
|
ULONG Size : 1;
|
||||||
ULONG Limit;
|
ULONG Limit;
|
||||||
ULONG Base;
|
ULONG Base;
|
||||||
} SOFT386_SEG_REG, *PSOFT386_SEG_REG;
|
} SOFT386_SEG_REG, *PSOFT386_SEG_REG;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
ULONG Limit : 16;
|
ULONG Limit : 16;
|
||||||
ULONG Base : 24;
|
ULONG Base : 24;
|
||||||
ULONG Accessed : 1;
|
ULONG Accessed : 1;
|
||||||
ULONG ReadWrite : 1;
|
ULONG ReadWrite : 1;
|
||||||
ULONG DirConf : 1;
|
ULONG DirConf : 1;
|
||||||
ULONG Executable : 1;
|
ULONG Executable : 1;
|
||||||
ULONG SystemType : 1;
|
ULONG SystemType : 1;
|
||||||
ULONG Dpl : 2;
|
ULONG Dpl : 2;
|
||||||
ULONG Present : 1;
|
ULONG Present : 1;
|
||||||
ULONG LimitHigh : 4;
|
ULONG LimitHigh : 4;
|
||||||
ULONG Avl : 1;
|
ULONG Avl : 1;
|
||||||
ULONG Reserved : 1;
|
ULONG Reserved : 1;
|
||||||
ULONG Size : 1;
|
ULONG Size : 1;
|
||||||
ULONG Granularity : 1;
|
ULONG Granularity : 1;
|
||||||
ULONG BaseHigh : 8;
|
ULONG BaseHigh : 8;
|
||||||
} SOFT386_GDT_ENTRY, *PSOFT386_GDT_ENTRY;
|
} SOFT386_GDT_ENTRY, *PSOFT386_GDT_ENTRY;
|
||||||
|
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
ULONG Offset : 16;
|
ULONG Offset : 16;
|
||||||
ULONG Selector : 16;
|
ULONG Selector : 16;
|
||||||
ULONG Zero : 8;
|
ULONG Zero : 8;
|
||||||
ULONG Type : 4;
|
ULONG Type : 4;
|
||||||
ULONG Storage : 1;
|
ULONG Storage : 1;
|
||||||
ULONG Dpl : 2;
|
ULONG Dpl : 2;
|
||||||
ULONG Present : 1;
|
ULONG Present : 1;
|
||||||
ULONG OffsetHigh : 16;
|
ULONG OffsetHigh : 16;
|
||||||
} SOFT386_IDT_ENTRY, *PSOFT386_IDT_ENTRY;
|
} SOFT386_IDT_ENTRY, *PSOFT386_IDT_ENTRY;
|
||||||
|
|
||||||
typedef struct _SOFT386_TABLE_REG
|
typedef struct _SOFT386_TABLE_REG
|
||||||
|
@ -230,27 +230,27 @@ typedef union _SOFT386_FLAGS_REG
|
||||||
ULONG Long;
|
ULONG Long;
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
ULONG Cf : 1;
|
ULONG Cf : 1;
|
||||||
ULONG AlwaysSet : 1;
|
ULONG AlwaysSet : 1;
|
||||||
ULONG Pf : 1;
|
ULONG Pf : 1;
|
||||||
ULONG Reserved0 : 1;
|
ULONG Reserved0 : 1;
|
||||||
ULONG Af : 1;
|
ULONG Af : 1;
|
||||||
ULONG Reserved1 : 1;
|
ULONG Reserved1 : 1;
|
||||||
ULONG Zf : 1;
|
ULONG Zf : 1;
|
||||||
ULONG Sf : 1;
|
ULONG Sf : 1;
|
||||||
ULONG Tf : 1;
|
ULONG Tf : 1;
|
||||||
ULONG If : 1;
|
ULONG If : 1;
|
||||||
ULONG Df : 1;
|
ULONG Df : 1;
|
||||||
ULONG Of : 1;
|
ULONG Of : 1;
|
||||||
ULONG Iopl : 2;
|
ULONG Iopl : 2;
|
||||||
ULONG Nt : 1;
|
ULONG Nt : 1;
|
||||||
ULONG Reserved2 : 1;
|
ULONG Reserved2 : 1;
|
||||||
ULONG Rf : 1;
|
ULONG Rf : 1;
|
||||||
ULONG Vm : 1;
|
ULONG Vm : 1;
|
||||||
ULONG Ac : 1;
|
ULONG Ac : 1;
|
||||||
ULONG Vif : 1;
|
ULONG Vif : 1;
|
||||||
ULONG Vip : 1;
|
ULONG Vip : 1;
|
||||||
ULONG Id : 1;
|
ULONG Id : 1;
|
||||||
|
|
||||||
// ULONG Reserved : 10;
|
// ULONG Reserved : 10;
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/soft386)
|
include_directories(${REACTOS_SOURCE_DIR}/include/reactos/libs/soft386)
|
||||||
|
|
||||||
list(APPEND SOURCE
|
list(APPEND SOURCE
|
||||||
|
|
|
@ -15,17 +15,19 @@
|
||||||
#define FASTCALL __fastcall
|
#define FASTCALL __fastcall
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define SIGN_FLAG_BYTE 0x80
|
#define SIGN_FLAG_BYTE 0x80
|
||||||
#define SIGN_FLAG_WORD 0x8000
|
#define SIGN_FLAG_WORD 0x8000
|
||||||
#define SIGN_FLAG_LONG 0x80000000
|
#define SIGN_FLAG_LONG 0x80000000
|
||||||
#define GET_SEGMENT_RPL(s) ((s) & 3)
|
|
||||||
#define GET_SEGMENT_INDEX(s) ((s) & 0xFFF8)
|
#define GET_SEGMENT_RPL(s) ((s) & 3)
|
||||||
|
#define GET_SEGMENT_INDEX(s) ((s) & 0xFFF8)
|
||||||
#define EXCEPTION_HAS_ERROR_CODE(x) (((x) == 8) || ((x) >= 10 && (x) <= 14))
|
#define EXCEPTION_HAS_ERROR_CODE(x) (((x) == 8) || ((x) >= 10 && (x) <= 14))
|
||||||
#define PAGE_ALIGN(x) ((x) & 0xFFFFF000)
|
|
||||||
#define PAGE_OFFSET(x) ((x) & 0x00000FFF)
|
#define PAGE_ALIGN(x) ((x) & 0xFFFFF000)
|
||||||
|
#define PAGE_OFFSET(x) ((x) & 0x00000FFF)
|
||||||
|
|
||||||
#ifndef PAGE_SIZE
|
#ifndef PAGE_SIZE
|
||||||
#define PAGE_SIZE 4096
|
#define PAGE_SIZE 4096
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
typedef struct _SOFT386_MOD_REG_RM
|
typedef struct _SOFT386_MOD_REG_RM
|
||||||
|
@ -45,35 +47,35 @@ typedef union _SOFT386_PAGE_DIR
|
||||||
{
|
{
|
||||||
struct
|
struct
|
||||||
{
|
{
|
||||||
ULONG Present : 1;
|
ULONG Present : 1;
|
||||||
ULONG Writeable : 1;
|
ULONG Writeable : 1;
|
||||||
ULONG Usermode : 1;
|
ULONG Usermode : 1;
|
||||||
ULONG WriteThrough : 1;
|
ULONG WriteThrough : 1;
|
||||||
ULONG NoCache : 1;
|
ULONG NoCache : 1;
|
||||||
ULONG Accessed : 1;
|
ULONG Accessed : 1;
|
||||||
ULONG AlwaysZero : 1;
|
ULONG AlwaysZero : 1;
|
||||||
ULONG Size : 1;
|
ULONG Size : 1;
|
||||||
ULONG Unused : 4;
|
ULONG Unused : 4;
|
||||||
ULONG TableAddress : 20;
|
ULONG TableAddress : 20;
|
||||||
};
|
};
|
||||||
ULONG Value;
|
ULONG Value;
|
||||||
} SOFT386_PAGE_DIR, *PSOFT386_PAGE_DIR;
|
} SOFT386_PAGE_DIR, *PSOFT386_PAGE_DIR;
|
||||||
|
|
||||||
typedef struct _SOFT386_PAGE_TABLE
|
typedef union _SOFT386_PAGE_TABLE
|
||||||
{
|
{
|
||||||
union
|
struct
|
||||||
{
|
{
|
||||||
ULONG Present : 1;
|
ULONG Present : 1;
|
||||||
ULONG Writeable : 1;
|
ULONG Writeable : 1;
|
||||||
ULONG Usermode : 1;
|
ULONG Usermode : 1;
|
||||||
ULONG WriteThrough : 1;
|
ULONG WriteThrough : 1;
|
||||||
ULONG NoCache : 1;
|
ULONG NoCache : 1;
|
||||||
ULONG Accessed : 1;
|
ULONG Accessed : 1;
|
||||||
ULONG Dirty : 1;
|
ULONG Dirty : 1;
|
||||||
ULONG AlwaysZero : 1;
|
ULONG AlwaysZero : 1;
|
||||||
ULONG Global : 1;
|
ULONG Global : 1;
|
||||||
ULONG Unused : 3;
|
ULONG Unused : 3;
|
||||||
ULONG Address : 20;
|
ULONG Address : 20;
|
||||||
};
|
};
|
||||||
ULONG Value;
|
ULONG Value;
|
||||||
} SOFT386_PAGE_TABLE, *PSOFT386_PAGE_TABLE;
|
} SOFT386_PAGE_TABLE, *PSOFT386_PAGE_TABLE;
|
||||||
|
|
Loading…
Reference in a new issue