From a642218a45371bc46a48cad245f97cdd8fdbe06a Mon Sep 17 00:00:00 2001 From: Amine Khaldi Date: Sat, 27 Feb 2010 14:59:20 +0000 Subject: [PATCH] Move alignment macros to wdm.h svn path=/branches/header-work/; revision=45699 --- include/ddk/wdm.h | 16 ++++++++++++++++ include/ddk/winddk.h | 15 --------------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/include/ddk/wdm.h b/include/ddk/wdm.h index f3f40d7aebe..45179790335 100644 --- a/include/ddk/wdm.h +++ b/include/ddk/wdm.h @@ -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; diff --git a/include/ddk/winddk.h b/include/ddk/winddk.h index 3c16d907d5c..094efc9d96f 100644 --- a/include/ddk/winddk.h +++ b/include/ddk/winddk.h @@ -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 */ -- 2.17.1