/** @file\r
-\r
Root include file for Mde Package Base type modules\r
\r
This is the include file for any module of type base. Base modules only use \r
// Modifiers for Data Types used to self document code.\r
// This concept is borrowed for UEFI specification.\r
//\r
-#ifndef IN\r
-//\r
-// Some other envirnments use this construct, so #ifndef to prevent\r
-// mulitple definition.\r
-//\r
#define IN\r
#define OUT\r
#define OPTIONAL\r
-#endif\r
\r
-//\r
-// Constants. They may exist in other build structures, so #ifndef them.\r
-//\r
-#ifndef TRUE\r
//\r
// UEFI specification claims 1 and 0. We are concerned about the \r
// complier portability so we did it this way.\r
//\r
#define TRUE ((BOOLEAN)(1==1))\r
-#endif\r
-\r
-#ifndef FALSE\r
#define FALSE ((BOOLEAN)(0==1))\r
-#endif\r
\r
-#ifndef NULL\r
#define NULL ((VOID *) 0)\r
-#endif\r
\r
#define BIT0 0x00000001\r
#define BIT1 0x00000002\r
//\r
// Also support coding convention rules for var arg macros\r
//\r
-#ifndef VA_START\r
-\r
typedef CHAR8 *VA_LIST;\r
#define VA_START(ap, v) (ap = (VA_LIST) & (v) + _INT_SIZE_OF (v))\r
#define VA_ARG(ap, t) (*(t *) ((ap += _INT_SIZE_OF (t)) - _INT_SIZE_OF (t)))\r
#define VA_END(ap) (ap = (VA_LIST) 0)\r
\r
-#endif\r
-\r
//\r
// Macro that returns the byte offset of a field in a data structure. \r
//\r
#define RETURN_WARN_WRITE_FAILURE ENCODE_WARNING (3)\r
#define RETURN_WARN_BUFFER_TOO_SMALL ENCODE_WARNING (4)\r
\r
+/**\r
+ Returns a 16-bit signature built from 2 ASCII characters.\r
+ \r
+ @param A The first ASCII character.\r
+ @param B The second ASCII character.\r
+\r
+ @return A 16-bit value built from the two ASCII characters specified by A and B.\r
+\r
+**/\r
+#define SIGNATURE_16(A, B) ((A) | (B << 8))\r
+\r
+/**\r
+ Returns a 32-bit signature built from 4 ASCII characters.\r
+ \r
+ @param A The first ASCII character.\r
+ @param B The second ASCII character.\r
+ @param C The third ASCII character.\r
+ @param D The fourth ASCII character.\r
+\r
+ @return A 32-bit value built from the two ASCII characters specified by A, B,\r
+ C and D.\r
+\r
+**/\r
+#define SIGNATURE_32(A, B, C, D) (SIGNATURE_16 (A, B) | (SIGNATURE_16 (C, D) << 16))\r
+\r
+/**\r
+ Returns a 64-bit signature built from 8 ASCII characters.\r
+ \r
+ @param A The first ASCII character.\r
+ @param B The second ASCII character.\r
+ @param C The third ASCII character.\r
+ @param D The fourth ASCII character.\r
+ @param E The fifth ASCII character.\r
+ @param F The sixth ASCII character.\r
+ @param G The seventh ASCII character.\r
+ @param H The eighth ASCII character.\r
+\r
+ @return A 64-bit value built from the two ASCII characters specified by A, B,\r
+ C, D, E, F, G and H.\r
+\r
+**/\r
+#define SIGNATURE_64(A, B, C, D, E, F, G, H) \\r
+ (SIGNATURE_32 (A, B, C, D) | ((UINT64) (SIGNATURE_32 (E, F, G, H)) << 32))\r
+\r
#endif\r
\r