summaryrefslogtreecommitdiffstats
path: root/MdePkg/Include/Base.h
Commit message (Collapse)AuthorAgeFilesLines
* MdePkg Base.h: Delete prototype for __builtin_return_addressJessica Clarke2020-07-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1004 Being a compiler builtin, the type of __builtin_return_address is already known to the compiler so no prototype is needed. Clang also errors out when redeclaring certain builtins like this[1], though currently only for ones with custom type checking. At the moment, __builtin_return_address does not use custom type checking and so does not trigger this error, however, the CHERI fork of LLVM, which will form the basis of the toolchain for Arm's experimental Morello platform, does use custom type checking for it, and so gives an error. Thus, simply delete the unnecessary line. [1] llvm/llvm-project@41af97137572ad6d4dafc872e7ecf6bbb08d4984 Cc: Leif Lindholm <leif@nuviainc.com> Signed-off-by: Jessica Clarke <jrtc27@jrtc27.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Leif Lindholm <leif@nuviainc.com>
* MdePkg Base.h: Use correct style to check macro _MSC_VER valueLiming Gao2020-02-061-1/+1
| | | | | Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Avoid using __clang__ to specify CLANGPDBLiu, Zhiguang2020-02-061-1/+1
| | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2415 Avoid using __clang__ to specify CLANGPDB because this macro is also defined in CLANG38 and this causes CLANG38 build failure. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg Base.h: Use correct style to check the defined macroLiming Gao2020-01-171-2/+2
| | | | | | | | #if MACRO is not good style. It should be changed to #ifdef MACRO style or #if defined (MACRO) style. Signed-off-by: Zhiguang Liu <zhiguang.liu@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Use __builtin_offset with CLANGPDB toolchainAlex James2019-12-201-3/+1
| | | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=2393 CLANGPDB does not define __GNUC__, but it does define __clang__. Check for the __clang__ preprocessor definition to use __builtin_offsetof to implement the OFFSET_OF macro. Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Liming Gao <liming.gao@intel.com> Signed-off-by: Alex James <theracermaster@gmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg Base.h: Add definition for CLANG9 tool chainLiming Gao2019-10-241-3/+3
| | | | | | | | | | | | BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=1603 CLANG9 tool chain defines __clang__ macro only, doesn't define __GNUC__ macro. But, it uses some same definitions with GCC. So, update base definition for CLANG9 tool chain. Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdePkg Base.h: Define STATIC_ASSERT macro as empty for EBC archLiming Gao2019-09-251-1/+3
| | | | | | | | | | | | EBC compiler doesn't support C11 static_assert macro. So, define STATIC_ASSERT as empty to pass EBC arch build. STATIC_ASSERT macro is introduced @204ae9da230ecbf0910c21acac7aa5d5e8cbb8d0 Cc: Michael D Kinney <michael.d.kinney@intel.com> Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdePkg: Drop VERIFY_SIZE_OF in favour of STATIC_ASSERTVitaly Cheptsov via Groups.Io2019-09-171-13/+0
| | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2048 New STATIC_ASSERT macro supersedes VERIFY_SIZE_OF as being more functional. Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Use STATIC_ASSERT macroVitaly Cheptsov via Groups.Io2019-09-171-39/+40
| | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2048 Use new STATIC_ASSERT macro instead of VERIFY_SIZE_OF. Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Add STATIC_ASSERT macroVitaly Cheptsov via Groups.Io2019-09-111-0/+14
| | | | | | | | | | | | | REF:https://bugzilla.tianocore.org/show_bug.cgi?id=2048 Provide a macro for compile time assertions. Equivalent to C11 static_assert macro from assert.h. Signed-off-by: Vitaly Cheptsov <vit9696@protonmail.com> Reviewed-by: Philippe Mathieu-Daude <philmd@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> Acked-by: Jiewen Yao <jiewen.yao@intel.com>
* MdePkg: Replace BSD License with BSD+Patent LicenseMichael D Kinney2019-04-091-7/+1
| | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=1373 Replace BSD 2-Clause License with BSD+Patent License. This change is based on the following emails: https://lists.01.org/pipermail/edk2-devel/2019-February/036260.html https://lists.01.org/pipermail/edk2-devel/2018-October/030385.html RFCs with detailed process for the license change: V3: https://lists.01.org/pipermail/edk2-devel/2019-March/038116.html V2: https://lists.01.org/pipermail/edk2-devel/2019-March/037669.html V1: https://lists.01.org/pipermail/edk2-devel/2019-March/037500.html Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* Revert "MdePkg: avoid __builtin_unreachable() on GCC v4.4"Laszlo Ersek2019-01-081-2/+1
| | | | | | | | | | | | | | | | | | | | | | This reverts commit 357cec385d4f ("MdePkg: avoid __builtin_unreachable() on GCC v4.4", 2016-07-21). We've removed BaseTools support for GCC44..GCC47, therefore we need not catch the GCC44 corner case for __builtin_unreachable(). No GCC44..GCC47 references remain under MdePkg after this patch. Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Liming Gao <liming.gao@intel.com> Cc: Marvin Haeuser <Marvin.Haeuser@outlook.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1377 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/Base.h: Implement BASE_CR() via OFFSET_OF().Marvin.Haeuser@outlook.com2018-11-021-1/+1
| | | | | | | | | | | Replace the current NULL pointer dereference to retrieve Field's offset with a call to OFFSET_OF(). This is implemented via __builtin_offsetof for GCC and Clang, which eliminates UB caught by Clang UndefinedBehaviorSanitizer. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Clean up source filesLiming Gao2018-06-281-4/+4
| | | | | | | | | 1. Do not use tab characters 2. No trailing white space in one line 3. All files must end with CRLF Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Liming Gao <liming.gao@intel.com>
* MdePkg/Include: Add VA list support for VS2017/ARM64Pete Batard2018-03-191-4/+3
| | | | | | | | | | | We need to explicitly call the built-in __va_start() for ARM64, otherwise the variable parameters are not properly enqueued for the next function calls. Also do the same for ARM, as as it doesn't harm us. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/Include: Add VA list support for VS2017/ARMPete Batard2018-02-071-0/+13
| | | | | | | | | VA_START, VA_END and VA_COPY are the same as the generic macros. VA_ARG was reverse engineered from MS ARM assembly output. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Pete Batard <pete@akeo.ie> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/BaseSafeIntLib: Add SafeIntLib class and instanceSean Brogan2018-01-251-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=798 SafeIntLib provides helper functions to prevent integer overflow during type conversion, addition, subtraction, and multiplication. Conversion Functions ==================== * Converting from a signed type to an unsigned type of the same size, or vice-versa. * Converting to a smaller type that could possibly overflow. * Converting from a signed type to a larger unsigned type. Unsigned Addition, Subtraction, Multiplication =============================================== * Unsigned integer math functions protect from overflow and underflow (in case of subtraction). Signed Addition, Subtraction, Multiplication ============================================ * Strongly consider using unsigned numbers. * Signed numbers are often used where unsigned numbers should be used. For example file sizes and array indices should always be unsigned. Subtracting a larger positive signed number from a smaller positive signed number with SafeInt32Sub() will succeed, producing a negative number, that then must not be used as an array index (but can occasionally be used as a pointer index.) Similarly for adding a larger magnitude negative number to a smaller magnitude positive number. * SafeIntLib does not protect you from such errors. It tells you if your integer operations overflowed, not if you are doing the right thing with your non-overflowed integers. * Likewise you can overflow a buffer with a non-overflowed unsigned index. Based on content from the following branch/commits: https://github.com/Microsoft/MS_UEFI/tree/share/MsCapsuleSupport https://github.com/Microsoft/MS_UEFI/commit/21ef3a321c907b40fa93797619c9f6c686dd92e0 https://github.com/Microsoft/MS_UEFI/commit/ca516b1a61315c2d823f453e12d2135098f53d61 https://github.com/Microsoft/MS_UEFI/commit/33bab4031a417d7d5a7d356c15a14c2e60302b2d Cc: Sean Brogan <sean.brogan@microsoft.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Sean Brogan <sean.brogan@microsoft.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: add RETURNS_TWICE attributeM1cha2018-01-101-0/+20
| | | | | | Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Michael Zimmermann <sigmaepsilon92@gmail.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: correct and clarify documentation of VA_LIST in Base.hZenith4322017-12-121-8/+17
| | | | | | | | | | | | This is to resolve bug 457. https://bugzilla.tianocore.org/show_bug.cgi?id=457 Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Zenith432 <zenith432@users.sourceforge.net> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> [lersek@redhat.com: reconstruct commit from patch pasted into email] Signed-off-by: Laszlo Ersek <lersek@redhat.com>
* MdePkg: Declare _ReturnAddress() in Base.h for MSFT tool chainLiming Gao2017-07-111-0/+1
| | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=590 Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Star Zeng <star.zeng@intel.com>
* MdePkg: update Base.h in MdePkg to check the _MSC_VERYonghong Zhu2017-06-231-1/+1
| | | | | | | | | | | update Base.h in MdePkg to check the _MSC_VER and define GLOBAL_REMOVE_IF_UNREFERENCED to nothing for VS2013 and higher tool chain tags. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Yonghong Zhu <yonghong.zhu@intel.com> Reviewed-by: Michael D Kinney <michael.d.kinney@intel.com>
* MdePkg: Define IPv4_ADDRESS and IPv6_ADDRESS in Base.hRuiyu Ni2017-02-281-1/+15
| | | | | | | | | | Since the following patch needs to add API converting string to IP address in BaseLib, define the IP address as base types in Base.h. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg Base.h: Add add comments on __ prefix in enum VERIFY_UINTXX_ENUM_SIZELiming Gao2016-11-181-0/+7
| | | | | | | Cc: Michael Kinney <michael.d.kinney@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg/BaseLib: Move CHAR_NULL definition to Base.h in BaseLibSong, BinX2016-11-041-0/+5
| | | | | | | | | | | - Required unicode control chars -> Null character - Remove CHAR_NULL definition in SimpleTextIn.h - https://bugzilla.tianocore.org/show_bug.cgi?id=172 Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Bell Song <binx.song@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/Include: Add enumeration size checks to Base.hMichael Kinney2016-10-271-0/+16
| | | | | | | | | | | | | | | | | | | | | | https://bugzilla.tianocore.org/show_bug.cgi?id=181 Add size check for 8-bit, 16-bit, and 32-bit enums to make sure they follow the UEFI Specification 2.3.1 Data Types. <Enumerated Type> Element of a standard ANSI C enum type declaration. Type INT32.or UINT32. ANSI C does not define the size of sign of an enum so they should never be used in structures. ANSI C integer promotion rules make INT32 or UINT32 interchangeable when passed as an argument to a function. Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg/Include/Base.h: introduce the ARRAY_SIZE() function-like macroLaszlo Ersek2016-10-271-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Several modules use ARRAY_SIZE() already; centralize the definition. (The module-specific macro definitions are guarded by #ifndef directives at this point.) Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org> Cc: Cecil Sheng <cecil.sheng@hpe.com> Cc: Chao Zhang <chao.b.zhang@intel.com> Cc: Dandan Bi <dandan.bi@intel.com> Cc: Daryl McDaniel <edk2-lists@mc2research.org> Cc: David Wei <david.wei@intel.com> Cc: Eric Dong <eric.dong@intel.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Gary Lin <glin@suse.com> Cc: Jaben Carsey <jaben.carsey@intel.com> Cc: Jeff Fan <jeff.fan@intel.com> Cc: Jiaxin Wu <jiaxin.wu@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Siyuan Fu <siyuan.fu@intel.com> Cc: Star Zeng <star.zeng@intel.com> Cc: Tim He <tim.he@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jaben Carsey <jaben.carsey@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdePkg: Fix some typing errors in the header filesThomas Huth2016-10-071-1/+1
| | | | | | | | | Correct the typos in some header files of MdePkg. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Thomas Huth <thuth@redhat.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg CryptoPkg EdkCompatibilityPkg: retire NO_BUILTIN_VA_FUNCS defineArd Biesheuvel2016-07-211-1/+1
| | | | | | | | | | | | This is never set anymore, so unsetting it or testing whether it is unset no longer makes any sense. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-By: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Enable new MS VA intrinsics for GNUC x86 64bits buildShi, Steven2016-07-211-0/+26
| | | | | | | | | | | | | | | | | | | | Both GCC and LLVM 3.8 64bits support new variable argument (VA) intrinsics for Microsoft ABI, enable these new VA intrinsics for GNUC family 64bits code build. These VA intrinsics are only permitted use in 64bits code, so not use them in 32bits code build. The original 32bits GNU VA intrinsics has the same calling convention as MS, so we don't need change them. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Steven Shi <steven.shi@intel.com> [ardb: update CPP logic so that the change only applies to X64] Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-By: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: avoid __builtin_unreachable() on GCC v4.4Ard Biesheuvel2016-07-211-1/+2
| | | | | | | | | | | | GCC v4.4 does not implement __builtin_unreachable(), so avoid using it when building with this version or earlier. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> Tested-by: Laszlo Ersek <lersek@redhat.com> Tested-By: Liming Gao <liming.gao@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg Base.h: Fix typo funcation to functionStar Zeng2016-07-091-5/+5
| | | | | | | | | Cc: Liming Gao <liming.gao@intel.com> Cc: Michael D Kinney <michael.d.kinney@intel.com> Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Add NORETURN attribute and UNREACHABLE() macro.Marvin H?user2016-06-221-0/+110
| | | | | | | | | | | | | | | | | | | | The NORETURN attribute informs compilers and analyzers that the flagged function cannot return. This may improve the quality of the optimizations. The UNREACHABLE() macro informs compilers and analyzers that its position cannot be reached, for example eliminating implicit returns. It is recommended to be used together with the NORETURN attribute to prevent warnings regarding the function flagged as 'noreturn' returning. The ANALYZER-prefixed versions have the same effects, but exclude compilers. They may be used to surpress warnings of static analyzers, such as possible dereferencing of a NULL pointer when dereferencing it after having checked it via ASSERT(). Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Liming Gao <liming.gao@intel.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com>
* MdePkg: Add definition for new warning code EFI_WARN_FILE_SYSTEM.Fu Siyuan2016-02-251-0/+6
| | | | | | | | | Add the definition for the new return status code defined in UEFI 2.6. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Fu Siyuan <siyuan.fu@intel.com> Reviewed-by: Samer El-Haj-Mahmoud <elhaj@hpe.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
* MdePkg: Update Base.h to fix compilation issues with ICC.edk2-devel2016-02-121-1/+1
| | | | | | | | | | | | | Recent versions of the Intel C compiler define the _MSC_EXTENSIONS constant. Base.h checks if this constant is defined to decide whether or not to use a pragma intrinsic, which is unsupported by the latest version of the Intel C compiler. Thus the check has been modified to only pass in the case __INTEL_COMPILER is not defined. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Marvin Haeuser <Marvin.Haeuser@outlook.com> Reviewed-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* MdePkg:Add a new error status code EFI_HTTP_ERROR.Zhang Lubo2016-02-031-1/+6
| | | | | | | | | | | | | | | | | v2: *Return the EFI_HTTP_ERROR in the “Status” field in token, instead of in the status codes returned table of EFI_HTTP_PROTOCOL.Response() interface. Add a new error status code EFI_HTTP_ERROR in corresponding with the UEFI 2.6 spec Cc: Ye Ting <ting.ye@intel.com> Cc: Fu Siyuan <siyuan.fu@intel.com> Cc: Liming Gao <liming.gao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Zhang Lubo <lubo.zhang@intel.com> Reviewed-by: Siyuan Fu <siyuan.fu@intel.com> Reviewed-by: Jiaxin Wu <jiaxin.wu@intel.com>
* MdePkg/Include: Add support for flexible array membersMichael Kinney2015-05-071-1/+7
| | | | | | | | | | | | | | Use pragma to disable warning 4200 for all VS* and DDK* tool chains to support data structure declarations where the last field of the data structure is a flexible array member. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Michael Kinney <michael.d.kinney@intel.com> Reviewed-by: lhauch <larry.hauch@intel.com> Tested-by: Chao Zhang <chao.b.zhang@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@17361 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg Base.h: Fix EBC build failure and add comments for RETURN_ADDRESS macro.Star Zeng2014-11-171-12/+32
| | | | | | | | Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16395 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg: Add RETURN_ADDRESS macro into Base.h.Star Zeng2014-11-121-1/+22
| | | | | | | | | | | | Based on compiler intrinsic function. MSVC: _ReturnAddress GCC: __builtin_return_address Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16334 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg Base.h: Always define ASM_PFXJordan Justen2014-09-011-13/+12
| | | | | | | | | | | | Some compilers may define __USER_LABEL_PREFIX__ to determine the prefix used with ASM_PFX. Otherwise, IA32 will use a single underscore '_' character, and all other architectures will use an empty prefix. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Liming Gao <liming.gao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16019 6f19259b-4bc3-4df7-8a09-765794883524
* 1. Add defines for MAX values for UEFI data types.Liming Gao2013-07-121-1/+12
| | | | | | | | | | | 2. Remove the #defines and add the extern declarations for gEfiDebugPortVariableGuid and gEfiDebugPortDevicePathGuid. Signed-off-by: Liming Gao <liming.gao@intel.com> Reviewed-by: michael.d.kinney@intel.com Reviewed-by: Star Zeng <star.zeng@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14465 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg/Include/Base.h: Defined __va_copy macro when not defined by the ARM ↵oliviermartin2012-02-281-0/+5
| | | | | | | | | | | | | toolchain The newer versions of ARM RVCT do not define __va_copy. Signed-off-by: oliviermartin Reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13067 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg: Add a new macro VA_COPY for variable argument support. Fix a bug in ↵rsun32012-02-221-1/+19
| | | | | | | | | | the UefiLib instance that there is a non portable assumption that Marker is copied when passed to a function. Signed-off-by: rsun3 Reviewed-by: mdkinney git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@13025 6f19259b-4bc3-4df7-8a09-765794883524
* Add header file for KMS.lzeng142011-07-191-0/+12
| | | | | | | Signed-off-by: lzeng14 Reviewed-by: lgao4 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12025 6f19259b-4bc3-4df7-8a09-765794883524
* Add ABS() macro (Absolute Value) to Base.h in MdePkgmdkinney2011-06-131-2/+14
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11818 6f19259b-4bc3-4df7-8a09-765794883524
* MdePkg: Use builtin offsetof function for GCC 4.0 and newerjljusten2010-10-131-109/+117
| | | | | | | | | | | | GCC 4.0 and newer have a builtin function for implementing 'offsetof' therefore we make use of it for our OFFSET_OF macro. References: http://gcc.gnu.org/onlinedocs/gcc-4.0.0/gcc/Offsetof.html http://gcc.gnu.org/onlinedocs/gcc-4.5.1/gcc/Offsetof.html git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10931 6f19259b-4bc3-4df7-8a09-765794883524
* Fixed K9 scan issues.hhuan132010-08-091-1/+1
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10781 6f19259b-4bc3-4df7-8a09-765794883524
* Made use of GCC built-in functions for variable arguments in procedures ↵geekboy15a2010-04-291-1/+1
| | | | | | dependent on NO_BUILTIN_VA_FUNCS. This is because they do not function correctly in GCC 4.4 when using ms_abi in X64 images. This does not change functionality for other projects. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10440 6f19259b-4bc3-4df7-8a09-765794883524
* Update the copyright notice formathhtian2010-04-231-3/+3
| | | | git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10403 6f19259b-4bc3-4df7-8a09-765794883524
* Define VERIFY_SIZE_OF macro to verify size of basic UEFI Data types. This ↵qhuang82010-03-191-15/+26
| | | | | | should be equivalent with previous implementation. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10283 6f19259b-4bc3-4df7-8a09-765794883524
* Clarify @pram b in Base.h. Accepted and edited in Qing Huang changes for ↵myronporter2010-03-151-1/+2
| | | | | | @retval EFI_INVALID_PARAMETER lines. 171 & 321. git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@10248 6f19259b-4bc3-4df7-8a09-765794883524