Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
Laszlo, I have already mentioned that the documentation is sufficient as _Static_assert is C standard, so I do not plan to make a V3 for this patch. The patch is merge ready. As for usage examples I have an opposing opinion to yours and believe it is based on very good reasons. Not using

Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
members. A couple years ago that was still there just because there still existed some compilers that did not support [] syntax. Best wishes, Vitaly > 17 авг. 2019 г., в 1:58, Andrew Fish написал(а): > > > >> On Aug 16, 2019, at 2:40 PM, Vitaly Cheptsov via Groups.Io

[edk2-devel] [PATCH v1 1/3] MdeModulePkg/ResetUtilityLib: Use STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
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 --- MdeModulePkg/Library/ResetUtilityLib/ResetUtility.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git

[edk2-devel] [PATCH v1 2/3] MdePkg: Use STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
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 --- MdePkg/Include/Base.h | 79 ++-- 1 file changed, 40 insertions(+), 39 deletions(-) diff --git a/MdePkg/Include/Base.h

[edk2-devel] [PATCH v1 3/3] MdePkg: Drop VERIFY_SIZE_OF in favour of STATIC_ASSERT

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
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 --- MdePkg/Include/Base.h | 13 - 1 file changed, 13 deletions(-) diff --git a/MdePkg/Include/Base.h

[edk2-devel] [PATCH v1 0/3] Replace VERIFY_SIZE_OF with STATIC_ASSERT

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
Things to note: - This patchset should go after STATIC_ASSERT implementation: https://edk2.groups.io/g/devel/topic/32917749 - It is suggested that unlike the previous patch, which in my opinion should appear in edk2-stable201908, this patchset should land in edk2-stable2019011. This will

Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
Laszlo, I am very glad to you for expressing a different opinion as this lets me view the situation from different angles. I understand your concerns, and believe that most of them should actually be addressed in a way you explain. In fact, I plan to submit more patches myself for everyone's

[edk2-devel] [PATCH v3 1/1] MdePkg: Add STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
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 --- MdePkg/Include/Base.h | 14 ++ 1 file changed, 14 insertions(+) diff --git

Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-15 Thread Vitaly Cheptsov via Groups.Io
Hi Donald, Glad to hear it helped a little, and sorry for some outdated quotes. Your clarification regarding model range is very helpful. Xeon W being client and thus having client clock makes sense, though I must say it was quite not obvious. I was referring to the same SDM table, and it

Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-15 Thread Vitaly Cheptsov via Groups.Io
Hello, Thank you for the patch! I reviewed the code and noticed select issues explained below. 1. The following construction: if (RegEbx == 0) { DEBUG ((DEBUG_ERROR, "The CPU is not capble for Core Crystal Clock Frequency !!\n")); ASSERT (RegEbx != 0); } Does not look good to me, and in my

[edk2-devel] Determining TSC frequency programmatically

2019-08-15 Thread Vitaly Cheptsov via Groups.Io
Hello, I initially raised this question in a new TimerLib patch[1], but as the discussion was getting more distracted, I decided to create a separate thread in hopes new people could join. The issue is that our UEFI bootloader needs to obtain TSC frequency to pass it to our specialised

[edk2-devel] [PATCH v3 0/1] MdePkg: Add STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
Implements https://bugzilla.tianocore.org/show_bug.cgi?id=3D2048. Things to note: - _Static_assert is a standard C11 keyword and thus is available on every modern compiler (including Apple Clang, Clang, and GCC). See: https://en.cppreference.com/w/c/keyword/_Static_assert - static_assert is a

Re: [edk2-devel] [PATCH v2 1/1] MdePkg: Add STATIC_ASSERT macro

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
Mike, I missed your message while writing mine, but I am afraid I disagree with the functional macro usage for this feature. I explicitly quoted C standard static_assert definition in one of my previous messages, and I want EDK II to be as close to standard C as possible. This will avoid a

Re: [edk2-devel] Determining TSC frequency programmatically

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
.com/tianocore/edk2/blob/master/EmulatorPkg/Unix/Host/EmuThunk.c#L250> > > > I would point that a library that did TSC frequency discovery would likely be > useful for the UefiCpuPkg CpuDxe driver. > > Thanks, > > Andrew Fish > >> On Aug 15, 2019, at 2:10 PM, Vi

Re: [edk2-devel] [PATCH] UefiCpuPkg: Adding a new TSC library by using CPUID(0x15) TSC leaf

2019-08-16 Thread Vitaly Cheptsov via Groups.Io
me HW assumptions that helps keep > the FW init code small and efficient. This does imply that different > libraries may be required for FW init and UEFI Applications. > > Thanks, > > Mike > > From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> > [mailto:d

Re: [edk2-devel] [PATCH v3 1/1] MdePkg: Add STATIC_ASSERT macro

2019-09-09 Thread Vitaly Cheptsov via Groups.Io
https://edk2.groups.io/g/devel/message/45691> gives RB. > > If no other comments, I will push this change this week. > > Thanks > Liming > From: devel@edk2.groups.io <mailto:devel@edk2.groups.io> > [mailto:devel@edk2.groups.io <mailto:devel@edk2.groups.io>] On Behal

Re: [edk2-devel] [PATCH v3 1/1] MdePkg: Add STATIC_ASSERT macro

2019-09-07 Thread Vitaly Cheptsov via Groups.Io
Hello, Given that new EDK II stable has already landed, and it was suggested to merge this right afterwards, it seems to me about the time to merge this patch. Best wishes, Vitaly -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#47003):