]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/Common/CommonLib.h
UefiCpuPkg: Move AsmRelocateApLoopStart from Mpfuncs.nasm to AmdSev.nasm
[mirror_edk2.git] / BaseTools / Source / C / Common / CommonLib.h
index 9da16e8cd30156958de599de5cb62fcb7438cfac..0f05d88db206ad7405ee1c552a8db4a0642ef60a 100644 (file)
@@ -1,14 +1,8 @@
 /** @file\r
 Common library assistance routines.\r
 \r
-Copyright (c) 2004 - 2017, Intel Corporation. All rights reserved.<BR>\r
-This program and the accompanying materials\r
-are licensed and made available under the terms and conditions of the BSD License\r
-which accompanies this distribution.  The full text of the license may be found at\r
-http://opensource.org/licenses/bsd-license.php\r
-\r
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+Copyright (c) 2004 - 2018, Intel Corporation. All rights reserved.<BR>\r
+SPDX-License-Identifier: BSD-2-Clause-Patent\r
 \r
 **/\r
 \r
@@ -18,19 +12,26 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Common/UefiBaseTypes.h>\r
 #include <Common/BuildVersion.h>\r
 #include <assert.h>\r
+#ifndef _WIN32\r
+#include <limits.h>\r
+#endif\r
+\r
 #define PRINTED_GUID_BUFFER_SIZE  37  // including null-termination\r
 \r
+#ifdef PATH_MAX\r
+#define MAX_LONG_FILE_PATH PATH_MAX\r
+#else\r
 #define MAX_LONG_FILE_PATH 500\r
+#endif\r
 \r
-#define MAX_UINTN MAX_ADDRESS\r
 #define MAX_UINT64 ((UINT64)0xFFFFFFFFFFFFFFFFULL)\r
+#define MAX_UINT32 ((UINT32)0xFFFFFFFF)\r
 #define MAX_UINT16  ((UINT16)0xFFFF)\r
 #define MAX_UINT8   ((UINT8)0xFF)\r
 #define ARRAY_SIZE(Array) (sizeof (Array) / sizeof ((Array)[0]))\r
 #define ASCII_RSIZE_MAX 1000000\r
-#ifndef RSIZE_MAX\r
+#undef RSIZE_MAX\r
 #define RSIZE_MAX 1000000\r
-#endif\r
 \r
 #define IS_COMMA(a)                ((a) == L',')\r
 #define IS_HYPHEN(a)               ((a) == L'-')\r
@@ -251,16 +252,6 @@ StrSize (
   CONST CHAR16              *String\r
   );\r
 \r
-UINTN\r
-StrHexToUintn (\r
-  CONST CHAR16              *String\r
-  );\r
-\r
-UINTN\r
-StrDecimalToUintn (\r
-  CONST CHAR16              *String\r
-  );\r
-\r
 UINT64\r
 StrHexToUint64 (\r
   CONST CHAR16             *String\r
@@ -278,13 +269,6 @@ StrHexToUint64S (
     UINT64             *Data\r
   );\r
 \r
-RETURN_STATUS\r
-StrHexToUintnS (\r
-    CONST CHAR16             *String,\r
-         CHAR16             **EndPointer,  OPTIONAL\r
-         UINTN              *Data\r
-  );\r
-\r
 RETURN_STATUS\r
 StrDecimalToUint64S (\r
     CONST CHAR16             *String,\r
@@ -292,13 +276,6 @@ StrDecimalToUint64S (
          UINT64             *Data\r
   );\r
 \r
-RETURN_STATUS\r
-StrDecimalToUintnS (\r
-    CONST CHAR16             *String,\r
-         CHAR16             **EndPointer,  OPTIONAL\r
-         UINTN              *Data\r
-  );\r
-\r
 VOID *\r
 ReallocatePool (\r
    UINTN  OldSize,\r
@@ -452,14 +429,14 @@ SplitStr (
 /*++\r
 \r
 Routine Description:\r
-  Convert FileName to the long file path, which can support larger than 260 length. \r
+  Convert FileName to the long file path, which can support larger than 260 length.\r
 \r
 Arguments:\r
-  FileName         - FileName. \r
+  FileName         - FileName.\r
 \r
 Returns:\r
   LongFilePath      A pointer to the converted long file path.\r
-  \r
+\r
 --*/\r
 \r
 #ifdef __cplusplus\r