<feed xmlns='http://www.w3.org/2005/Atom'>
<title>Tianocore/edk2.git/EmbeddedPkg/Include/Library/TimeBaseLib.h, branch master</title>
<subtitle>EDK II (mirror)</subtitle>
<id>https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master</id>
<link rel='self' href='https://git.radix-linux.su/Tianocore/edk2.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/'/>
<updated>2026-02-23T21:01:28+00:00</updated>
<entry>
<title>EmbeddedPkg: Replace include guards with #pragma once</title>
<updated>2026-02-23T21:01:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2026-02-03T18:18:20+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=de527ff60653a3ed7cf0e313695267b53c120a09'/>
<id>urn:sha1:de527ff60653a3ed7cf0e313695267b53c120a09</id>
<content type='text'>
Replace traditional `#ifndef`/`#define`/`#endif` include guards with
`#pragma` once.

`#pragma once` is a widely supported preprocessor directive that
prevents header files from being included multiple times. It is
supported by all toolchains used to build edk2: GCC, Clang/LLVM, and
MSVC.

Compared to macro-based include guards, `#pragma once`:

- Eliminates the risk of macro name collisions or copy/paste errors
  where two headers inadvertently use the same guard macro.
- Eliminate inconsistency in the way include guard macros are named
  (e.g., some files use `__FILE_H__`, others use `FILE_H_`, etc.).
- Reduces boilerplate (three lines replaced by one).
- Avoids polluting the macro namespace with guard symbols.
- Can improve build times as the preprocessor can skip re-opening the
  file entirely, rather than re-reading it to find the matching
  `#endif` ("multiple-include optimization").
  - Note that some compilers may already optimize traditional include
    guards, by recognzining the idiomatic pattern.

This change is made acknowledging that overall portability of the
code will technically be reduced, as `#pragma once` is not part of the
C/C++ standards.

However, this is considered acceptable given:

1. edk2 already defines a subset of supported compilers in
   BaseTools/Conf/tools_def.template, all of which have supported
   `#pragma once` for over two decades.
2. There have been concerns raised to the project about inconsistent
   include guard naming and potential macro collisions.

Approximate compiler support dates:

- MSVC: Supported since Visual C++ 4.2 (1996)
- GCC: Supported since 3.4 (2004)
  (http://gnu.ist.utl.pt/software/gcc/gcc-3.4/changes.html)
- Clang (LLVM based): Since initial release in 2007

Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg: Apply uncrustify changes</title>
<updated>2021-12-07T17:24:28+00:00</updated>
<author>
<name>Michael Kubacki</name>
<email>michael.kubacki@microsoft.com</email>
</author>
<published>2021-12-05T22:53:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e7108d0e9655b1795c94ac372b0449f28dd907df'/>
<id>urn:sha1:e7108d0e9655b1795c94ac372b0449f28dd907df</id>
<content type='text'>
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3737

Apply uncrustify changes to .c/.h files in the EmbeddedPkg package

Cc: Andrew Fish &lt;afish@apple.com&gt;
Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Michael D Kinney &lt;michael.d.kinney@intel.com&gt;
Signed-off-by: Michael Kubacki &lt;michael.kubacki@microsoft.com&gt;
Reviewed-by: Andrew Fish &lt;afish@apple.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg/TimeBaseLib: Add function to check Timezone and Daylight</title>
<updated>2021-01-07T16:43:48+00:00</updated>
<author>
<name>Nhi Pham</name>
<email>nhi@os.amperecomputing.com</email>
</author>
<published>2021-01-06T16:09:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=e31dc4717c75d8e771dfa5c9b1648fa20d88ab0d'/>
<id>urn:sha1:e31dc4717c75d8e771dfa5c9b1648fa20d88ab0d</id>
<content type='text'>
This adds two functions IsValidTimeZone() and IsValidDaylight() to check
the time zone and daylight value from EFI time. These functions are
retrieved from the RealTimeClockRuntimeDxe module as they reduce
duplicated code in RTC modules.

Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Signed-off-by: Nhi Pham &lt;nhi@os.amperecomputing.com&gt;
Reviewed-by: Leif Lindholm &lt;leif@nuviainc.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg/TimeBaseLib: Update comment blocks for API functions</title>
<updated>2021-01-07T16:43:48+00:00</updated>
<author>
<name>Nhi Pham</name>
<email>nhi@os.amperecomputing.com</email>
</author>
<published>2021-01-06T16:09:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=48de23e54828456f8c4c8ec7e21288201c2de107'/>
<id>urn:sha1:48de23e54828456f8c4c8ec7e21288201c2de107</id>
<content type='text'>
This updates Doxygen comment blocks for API library functions.

Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Signed-off-by: Nhi Pham &lt;nhi@os.amperecomputing.com&gt;
Reviewed-by: Leif Lindholm &lt;leif@nuviainc.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg/TimeBaseLib: remove useless truncation to 32-bit</title>
<updated>2020-12-21T15:55:16+00:00</updated>
<author>
<name>Laszlo Ersek</name>
<email>lersek@redhat.com</email>
</author>
<published>2020-12-21T11:36:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=c06635ea3f4b7b52054fe5d5b5e0cda3b594d2f5'/>
<id>urn:sha1:c06635ea3f4b7b52054fe5d5b5e0cda3b594d2f5</id>
<content type='text'>
EfiTimeToEpoch() calls EfiGetEpochDays() internally, which (reasonably)
returns a UINTN. But then EfiTimeToEpoch() truncates the EfiGetEpochDays()
retval to UINT32 for no good reason, effectively restricting Time-&gt;Year
under 2106.

This truncation was pointed out with a valid warning (= build error) by
VS2019.

Allow EfiTimeToEpoch() to return / propagate a UINTN value.

Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Philippe Mathieu-Daudé &lt;philmd@redhat.com&gt;
Signed-off-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Message-Id: &lt;20201221113657.6779-3-lersek@redhat.com&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg/TimeBaseLib: remove the SEC_PER_MONTH, SEC_PER_YEAR macros</title>
<updated>2020-09-08T10:30:28+00:00</updated>
<author>
<name>Laszlo Ersek</name>
<email>lersek@redhat.com</email>
</author>
<published>2020-09-04T15:45:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=f94345d9eae1b359c01761be975086870a4a9de9'/>
<id>urn:sha1:f94345d9eae1b359c01761be975086870a4a9de9</id>
<content type='text'>
The SEC_PER_MONTH and SEC_PER_YEAR macros are wrong: they both evaluate to
0 (of type "int"). They are also unused (they could never be used for
division, for example); so remove them. The macros were originally
introduced in commit 0f4386e775c7 ("ArmPlatformPkg/PL031RealTimeClockLib:
Implement PL031 RTC drive", 2011-06-11).

Cc: Ard Biesheuvel &lt;ard.biesheuvel@arm.com&gt;
Cc: Leif Lindholm &lt;leif@nuviainc.com&gt;
Cc: Maciej Rabeda &lt;maciej.rabeda@linux.intel.com&gt;
Cc: Philippe Mathieu-Daudé &lt;philmd@redhat.com&gt;
Reported-by: Maciej Rabeda &lt;maciej.rabeda@linux.intel.com&gt;
Signed-off-by: Laszlo Ersek &lt;lersek@redhat.com&gt;
Message-Id: &lt;20200904154541.23340-1-lersek@redhat.com&gt;
Reviewed-by: Philippe Mathieu-Daudé &lt;philmd@redhat.com&gt;
Reviewed-by: Leif Lindholm &lt;leif@nuviainc.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg/TimeBaseLib: Add macros to get build year/month/day</title>
<updated>2020-08-03T11:58:15+00:00</updated>
<author>
<name>Pete Batard</name>
<email>pete@akeo.ie</email>
</author>
<published>2020-07-24T16:37:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=bbb8a818583853ec4bb7804e78ed1d304b709d33'/>
<id>urn:sha1:bbb8a818583853ec4bb7804e78ed1d304b709d33</id>
<content type='text'>
These can be used, for instance, to automate the population of an SMBIOS
Type 0 BIOS Release Date when building a UEFI firmware (which is how we
plan to use these macros for the Raspberry Pi platform).

These macros should work for any compiler that follows ISO/IEC 9899, but
we add a check for the compiler we have tested to be on the safe side.

Note that we decided against adding a #error or #warn for compilers that
haven't been validated, as we don't want to introduce breakage for people
who may already be using the header with something else than gcc, MSVC or
Clang. Instead, we expect those to send a patch that adds their compiler
to the list, once they have tested the macros there.

Signed-off-by: Pete Batard &lt;pete@akeo.ie&gt;
Reviewed-by: Leif Lindholm &lt;leif@nuviainc.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg: improve TimeBaseLib type safety</title>
<updated>2019-06-17T11:04:11+00:00</updated>
<author>
<name>Leif Lindholm</name>
<email>leif.lindholm@linaro.org</email>
</author>
<published>2019-06-13T15:48:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=1d7571166fa8ef4bee3264e8a027b49ea9d98bd3'/>
<id>urn:sha1:1d7571166fa8ef4bee3264e8a027b49ea9d98bd3</id>
<content type='text'>
EfiTimeToEpoch currently returns a UINTN.
Also, some internal calculations was using UINTN for fixed-width.
Both of these lead to warnings/errors with VS2017.

Replace with appropriate fixed-size types.

BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=997

Cc: Alexei Fedorov &lt;Alexei.Fedorov@arm.com&gt;
Signed-off-by: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
Acked-by: Ard Biesheuvel &lt;ard.biesheuvel@linaro.org&gt;
Reviewed-by: Philippe Mathieu-Daude &lt;philmd@redhat.com&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg: Replace BSD License with BSD+Patent License</title>
<updated>2019-04-09T17:57:58+00:00</updated>
<author>
<name>Michael D Kinney</name>
<email>michael.d.kinney@intel.com</email>
</author>
<published>2019-04-03T23:03:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=878b807a435eefbb1d76f9bdec30cb3526521a5e'/>
<id>urn:sha1:878b807a435eefbb1d76f9bdec30cb3526521a5e</id>
<content type='text'>
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 &lt;michael.d.kinney@intel.com&gt;
Reviewed-by: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
</content>
</entry>
<entry>
<title>EmbeddedPkg/TimeBaseLib: Add function to get Week day.</title>
<updated>2018-06-05T15:18:21+00:00</updated>
<author>
<name>Meenakshi Aggarwal</name>
<email>meenakshi.aggarwal@nxp.com</email>
</author>
<published>2018-06-04T16:31:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/Tianocore/edk2.git/commit/?id=91c31ff04a7a72b4b0e476972ad3c76e03a106a2'/>
<id>urn:sha1:91c31ff04a7a72b4b0e476972ad3c76e03a106a2</id>
<content type='text'>
This patch add function EfiTimeToWday() which returns
day of the week.
It is needed by our upcoming patches in edk2-platforms.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Vabhav Sharma &lt;vabhav.sharma@nxp.com&gt;
Signed-off-by: Meenakshi Aggarwal &lt;meenakshi.aggarwal@nxp.com&gt;
Reviewed-by: Leif Lindholm &lt;leif.lindholm@linaro.org&gt;
</content>
</entry>
</feed>
