Move alignment macros to wdm.h

svn path=/branches/header-work/; revision=45699
This commit is contained in:
Amine Khaldi 2010-02-27 14:59:20 +00:00
parent a61593425b
commit a642218a45
2 changed files with 16 additions and 15 deletions

View file

@ -56,6 +56,22 @@ extern "C" {
#endif
/*
* Alignment Macros
*/
#define ALIGN_DOWN(s, t) \
((ULONG)(s) & ~(sizeof(t) - 1))
#define ALIGN_UP(s, t) \
(ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t))
#define ALIGN_DOWN_POINTER(p, t) \
((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1)))
#define ALIGN_UP_POINTER(p, t) \
(ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t))
/* Simple types */
typedef UCHAR KPROCESSOR_MODE;
typedef LONG KPRIORITY;

View file

@ -74,21 +74,6 @@ extern "C" {
# define _DDK_DUMMYUNION_N_MEMBER(n, name) name
#endif
/*
* Alignment Macros
*/
#define ALIGN_DOWN(s, t) \
((ULONG)(s) & ~(sizeof(t) - 1))
#define ALIGN_UP(s, t) \
(ALIGN_DOWN(((ULONG)(s) + sizeof(t) - 1), t))
#define ALIGN_DOWN_POINTER(p, t) \
((PVOID)((ULONG_PTR)(p) & ~((ULONG_PTR)sizeof(t) - 1)))
#define ALIGN_UP_POINTER(p, t) \
(ALIGN_DOWN_POINTER(((ULONG_PTR)(p) + sizeof(t) - 1), t))
/*
* GUID Comparison
*/