We want to check "if platver < 0.3" in an easy way.
---
.../IndustryStandard/SbsaQemuPlatformVersion.h | 25 ++++++++++++++++++++
1 file changed, 25 insertions(+)
diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h
new file mode 100644
index 000000000000..dd2483787002
--- /dev/null
+++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h
@@ -0,0 +1,25 @@
+/** @file
+*
+* Copyright (c) Linaro Limited. All rights reserved.
+*
+* SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef SBSAQEMUPLATFORM_VERSION_H
+#define SBSAQEMUPLATFORM_VERSION_H
+
+/*
+ * Compare PlatformVersion
+ *
+ */
+
+#define PLATFORM_VERSION_LESS_THAN(Major, Minor) ( \
+ ( \
+ ( PcdGet32 (PcdPlatformVersionMajor) < Major) || \
+ ( \
+ ( PcdGet32 (PcdPlatformVersionMajor) == Major) && \
+ ( PcdGet32 (PcdPlatformVersionMinor) < Minor) \
+ ) \
+ ) \
+)
+#endif
--
2.41.0
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#109682): https://edk2.groups.io/g/devel/message/109682
Mute This Topic: https://groups.io/mt/102017313/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-
On Tue, 17 Oct 2023 at 15:23, Marcin Juszkiewicz <marcin.juszkiewicz@linaro.org> wrote: > > We want to check "if platver < 0.3" in an easy way. > --- > .../IndustryStandard/SbsaQemuPlatformVersion.h | 25 ++++++++++++++++++++ > 1 file changed, 25 insertions(+) > > diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h > new file mode 100644 > index 000000000000..dd2483787002 > --- /dev/null > +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h > @@ -0,0 +1,25 @@ > +/** @file > +* > +* Copyright (c) Linaro Limited. All rights reserved. > +* > +* SPDX-License-Identifier: BSD-2-Clause-Patent > +**/ > + > +#ifndef SBSAQEMUPLATFORM_VERSION_H > +#define SBSAQEMUPLATFORM_VERSION_H > + > +/* > + * Compare PlatformVersion > + * > + */ > + > +#define PLATFORM_VERSION_LESS_THAN(Major, Minor) ( \ > + ( \ > + ( PcdGet32 (PcdPlatformVersionMajor) < Major) || \ > + ( \ > + ( PcdGet32 (PcdPlatformVersionMajor) == Major) && \ > + ( PcdGet32 (PcdPlatformVersionMinor) < Minor) \ > + ) \ > + ) \ > +) > +#endif > I don't mind adding this here but it is slightly unidiomatic so I'd like Leif's take on this too. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109713): https://edk2.groups.io/g/devel/message/109713 Mute This Topic: https://groups.io/mt/102017313/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
On Wed, 18 Oct 2023 at 10:45, Ard Biesheuvel <ardb@kernel.org> wrote: > > On Tue, 17 Oct 2023 at 15:23, Marcin Juszkiewicz > <marcin.juszkiewicz@linaro.org> wrote: > > > > We want to check "if platver < 0.3" in an easy way. > > --- > > .../IndustryStandard/SbsaQemuPlatformVersion.h | 25 ++++++++++++++++++++ > > 1 file changed, 25 insertions(+) > > > > diff --git a/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h > > new file mode 100644 > > index 000000000000..dd2483787002 > > --- /dev/null > > +++ b/Silicon/Qemu/SbsaQemu/Include/IndustryStandard/SbsaQemuPlatformVersion.h > > @@ -0,0 +1,25 @@ > > +/** @file > > +* > > +* Copyright (c) Linaro Limited. All rights reserved. > > +* > > +* SPDX-License-Identifier: BSD-2-Clause-Patent > > +**/ > > + > > +#ifndef SBSAQEMUPLATFORM_VERSION_H > > +#define SBSAQEMUPLATFORM_VERSION_H > > + > > +/* > > + * Compare PlatformVersion > > + * > > + */ > > + > > +#define PLATFORM_VERSION_LESS_THAN(Major, Minor) ( \ > > + ( \ > > + ( PcdGet32 (PcdPlatformVersionMajor) < Major) || \ > > + ( \ > > + ( PcdGet32 (PcdPlatformVersionMajor) == Major) && \ > > + ( PcdGet32 (PcdPlatformVersionMinor) < Minor) \ > > + ) \ > > + ) \ > > +) > > +#endif > > > > I don't mind adding this here but it is slightly unidiomatic so I'd > like Leif's take on this too. ... and it also lacks a s-o-b line -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109714): https://edk2.groups.io/g/devel/message/109714 Mute This Topic: https://groups.io/mt/102017313/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
W dniu 18.10.2023 o 10:46, Ard Biesheuvel pisze: >> I don't mind adding this here but it is slightly unidiomatic so I'd >> like Leif's take on this too. > ... and it also lacks a s-o-b line Oops. Added in local copy. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#109725): https://edk2.groups.io/g/devel/message/109725 Mute This Topic: https://groups.io/mt/102017313/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=-=-=-=-=-=-=-=-=-=-=-
© 2016 - 2026 Red Hat, Inc.