mirror of
https://github.com/reactos/reactos.git
synced 2024-08-20 18:35:32 +00:00
[FAST486]
Add a macro ALIGNMENT_CHECK that checks for unaligned pointers and generates an exception. svn path=/branches/ntvdm/; revision=62279
This commit is contained in:
parent
011259b78f
commit
0b434e7c6c
|
@ -55,6 +55,15 @@ if (State->PrefixFlags & FAST486_PREFIX_LOCK)\
|
||||||
|
|
||||||
#define SWAP(x, y) { (x) ^= (y); (y) ^= (x); (x) ^= (y); }
|
#define SWAP(x, y) { (x) ^= (y); (y) ^= (x); (x) ^= (y); }
|
||||||
|
|
||||||
|
#define ALIGNMENT_CHECK(x, a) if (State->Flags.Ac \
|
||||||
|
&& (State->ControlRegisters[FAST486_REG_CR0] & FAST486_CR0_AM)\
|
||||||
|
&& (State->Cpl == 3)\
|
||||||
|
&& (((x) % (a)) != 0))\
|
||||||
|
{\
|
||||||
|
Fast486Exception(State, FAST486_EXCEPTION_AC);\
|
||||||
|
return FALSE;\
|
||||||
|
}
|
||||||
|
|
||||||
#define PAGE_ALIGN(x) ((x) & 0xFFFFF000)
|
#define PAGE_ALIGN(x) ((x) & 0xFFFFF000)
|
||||||
#define PAGE_OFFSET(x) ((x) & 0x00000FFF)
|
#define PAGE_OFFSET(x) ((x) & 0x00000FFF)
|
||||||
#define GET_ADDR_PDE(x) ((x) >> 22)
|
#define GET_ADDR_PDE(x) ((x) >> 22)
|
||||||
|
|
Loading…
Reference in a new issue