Re: [edk2-devel] bootloader build error

2024-04-05 Thread Andrew Fish via groups.io
Bill,

The Python tools can tend to throw vs.flagging errors in the config files. Did 
you happen to edit anything in *.inf,*.dsc, or *.fdf files? This could just be 
a syntax error in those changes. 

This error looks like trying to make the FV (Firmware Volume) and Ffs would be 
one of the files in the FV, and the file is built out of sections. 

> OSError: [Errno 2] No such file or directory: 
> '/.../vendor/BOOT.MXF.2.0/boot_images/Build/ClarenceLAA/Core/RELEASE_CLANG120LINUX/FV/Ffs/1C04F529-0612-4319-9315-B2E75C16810AFeatureEnablerDxe/1C04F529-0612-4319-9315-B2E75C16810ASEC2.1.pe32'



Thanks,

Andrew Fish

PS FYI  Python 2.7 is no longer supported as of January 1st, 2020.

> On Apr 4, 2024, at 5:13 AM, Bill Shih 施炫全 via groups.io 
>  wrote:
> 
> Hi Sir
>  
> I have problem when building android bootloader.
>  
> The log suggested I could mail you for help.
>  
> Can I have your suggestion to solve this error?
>  
> Thank you
>  
> The log:
>  
> build.py...
> : error C0DE: Unknown fatal error when processing 
> [/.../vendor/BOOT.MXF.2.0/boot_images/boot/***/Library/EblCmdLib/EblCmdLib.inf
>  [AARCH64, CLANG120LINUX, RELEASE]]
>
> (Please send email to devel@edk2.groups.io  for 
> help, attaching following call stack trace!)
>  
> (Python 2.7.18 on linux2) Traceback (most recent call last):
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
>  line 2599, in Main
> MyBuild.Launch()
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
>  line 2394, in Launch
> self._MultiThreadBuildPlatform()
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
>  line 2234, in _MultiThreadBuildPlatform
> Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
>  line 2109, in PerformAutoGen
> CmdListDict = self._GenFfsCmd(Wa.ArchList)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
>  line 2006, in _GenFfsCmd
> GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, 
> ArchList, GlobalData)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFds.py",
>  line 544, in GenFfsMakefile
> FvObj.AddToBuffer(Buffer=None, Flag=True)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/Fv.py",
>  line 127, in AddToBuffer
> FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, 
> IsMakefile=Flag, FvName=self.UiFvName)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
>  line 518, in GenFfs
> InputSectList, InputSectAlignments = self.__GenComplexFileSection__(Rule, 
> FvChildAddr, FvParentAddr, IsMakefile=IsMakefile)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
>  line 969, in __GenComplexFileSection__
> SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid, 
> SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/EfiSection.py",
>  line 321, in GenSection
> IsMakefile=IsMakefile
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py",
>  line 502, in GenerateSection
> if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and
>   File 
> "/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/Common/LongFilePathOsPath.py",
>  line 21, in getsize
> return os.path.getsize(LongFilePath(filename))
>   File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
> return os.stat(filename).st_size
> OSError: [Errno 2] No such file or directory: 
> '/.../vendor/BOOT.MXF.2.0/boot_images/Build/ClarenceLAA/Core/RELEASE_CLANG120LINUX/FV/Ffs/1C04F529-0612-4319-9315-B2E75C16810AFeatureEnablerDxe/1C04F529-0612-4319-9315-B2E75C16810ASEC2.1.pe32'
>  
>  
> - Failed -
> Build end time: 17:11:19, Apr.03 2024
> Build total time: 00:00:04
>  
> , u'-b', u'RELEASE', u'-t', u'CLANG120LINUX', '-D', 'TARGETPKG=SocPkg', '-D', 
> u'DTC=/pkg/qct/software/boottools/', '-D', 
> 'EDK2ROOT=/.../vendor/BOOT.MXF.2.0/boot_images/edk2', '-D', 
> u'CLANG120=/opt/LLVM/12.0.3/bin', '-D', 
> 'BOOTTOOLS=/.../vendor/BOOT.MXF.2.0/boot_images/boot_tools', '-D', 
> u'COMPILER=CLANG120LINUX', '-D', 
> u'SECTOOLSROOT=/.../vendor/QCM4490.LA.1.0/common/sectoolsv2/ext/Linux', '-D', 
> '***DIR=', '-D', 'TARGETID=SocClarence', '-D', u'VAR=LAA', '-D', 
> 'TARGETROOT=***/SocPkg/Clarence', '-D', 
> u'BOOTROOT=/.../vendor/BOOT.MXF.2.0/boot_images/boot', '-D', 
> 'BUILDROOT=/.../vendor/BOOT.MXF.2.0/boot_images', '-D', 'PRODMODE=PRODMODE', 
> '-D', 'XBLSEC=', '-D', u'AARCH=AARCH64', '-D', 'SECONDDLL=', '-D', 
> 'COMPLIER=', 

Re: [edk2-devel] [PATCH v6 0/3] IntelFsp2Pkg: Fsp T new ARCH UPD Support

2024-04-05 Thread Chiu, Chasel


Thanks for taking all the feedbacks and update patches.
For the patch series: Reviewed-by: Chasel Chiu 


> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of cbduggap
> Sent: Friday, April 5, 2024 10:06 AM
> To: devel@edk2.groups.io
> Subject: [edk2-devel] [PATCH v6 0/3] IntelFsp2Pkg: Fsp T new ARCH UPD Support
> 
> This Patch will add changes to support FSP T new ARCH UPD and Fix Bug in
> IntelFsp2WrapperPkg
> 
> cbduggap (3):
>   IntelFsp2Pkg: Fsp T new ARCH UPD Support
>   IntelFsp2WrapperPkg: Fsp T new ARCH UPD Support
>   IntelFsp2WrapperPkg: Fix UPD structure Reserved bytes
> 
>  IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf |  1 +
>  IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf   |  1 +
>  .../FspSecCore/Ia32/Fsp24ApiEntryM.nasm   |  1 -
>  .../FspSecCore/Ia32/FspApiEntryM.nasm |  1 -
>  .../FspSecCore/Ia32/FspApiEntryT.nasm | 60 +---
>  .../FspSecCore/Ia32/SaveRestoreSseNasm.inc| 11 +++
>  IntelFsp2Pkg/FspSecCore/SecFsp.c  |  9 +++
>  IntelFsp2Pkg/FspSecCore/SecFsp.h  |  1 +
>  IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 68 +++
>  IntelFsp2Pkg/Include/FspEas/FspApi.h  | 12 +++-
>  IntelFsp2Pkg/Include/Library/FspPlatformLib.h | 13 
>  .../Include/SaveRestoreSseAvxNasm.inc | 21 ++
>  .../BaseFspPlatformLib/FspPlatformMemory.c| 38 +++
>  .../SecRamInitData.c  | 12 ++--
>  14 files changed, 219 insertions(+), 30 deletions(-)
> 
> --
> 2.39.1.windows.1
> 
> 
> 
> 
> 



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117465): https://edk2.groups.io/g/devel/message/117465
Mute This Topic: https://groups.io/mt/105352668/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v6 3/3] IntelFsp2WrapperPkg: Fix UPD structure Reserved bytes

2024-04-05 Thread cbduggap
Changes to update SecRamInitData UPD structure reserved
bytes as par the latest spec.


Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Chiu Chasel 
Cc: Duggapu Chinni B 


Signed-off-by: Duggapu Chinni B 
---
 .../SecFspWrapperPlatformSecLibSample/SecRamInitData.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
index f4ed658674..dabcd83eef 100644
--- 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
+++ 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
@@ -34,8 +34,11 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA  
FsptUpdDataPtr = {
 // UPD header revision must be equal or greater than 2 when the structure 
is compliant with FSP spec 2.2.
 //
 0x02,
-{ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }
+{
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00
+}
   },
   //
   // If FSP spec version < 2.2, remove FSPT_ARCH_UPD structure.
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117464): https://edk2.groups.io/g/devel/message/117464
Mute This Topic: https://groups.io/mt/105352679/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v6 2/3] IntelFsp2WrapperPkg: Fsp T new ARCH UPD Support

2024-04-05 Thread cbduggap
Changes to update SecRamInitData as per New Spec


Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Chiu Chasel 
Cc: Duggapu Chinni B 


Signed-off-by: Duggapu Chinni B 
---
 .../SecFspWrapperPlatformSecLibSample/SecRamInitData.c   | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
index fb0d9a8683..f4ed658674 100644
--- 
a/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
+++ 
b/IntelFsp2WrapperPkg/Library/SecFspWrapperPlatformSecLibSample/SecRamInitData.c
@@ -43,14 +43,15 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST FSPT_UPD_CORE_DATA  
FsptUpdDataPtr = {
   // Else, use FSPT_ARCH2_UPD structure.
   //
   {
-0x02,
+0x03,
 {
   0x00, 0x00, 0x00
 },
 0x0020,
 0x,
+0x,
 {
-  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   0x00, 0x00, 0x00, 0x00, 0x00, 0x00
 }
   },
-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117463): https://edk2.groups.io/g/devel/message/117463
Mute This Topic: https://groups.io/mt/105352676/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] [PATCH v6 1/3] IntelFsp2Pkg: Fsp T new ARCH UPD Support

2024-04-05 Thread cbduggap
Changes to support spec changes

1. Remove usage of Pcd.
2. Change code to validate the Temporary Ram size input.
3. Consume the input saved in YMM Register

Cc: Sai Chaganty 
Cc: Nate DeSimone 
Cc: Chiu Chasel 
Cc: Duggapu Chinni B 


Signed-off-by: Duggapu Chinni B 
---
 IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf |  1 +
 IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf   |  1 +
 .../FspSecCore/Ia32/Fsp24ApiEntryM.nasm   |  1 -
 .../FspSecCore/Ia32/FspApiEntryM.nasm |  1 -
 .../FspSecCore/Ia32/FspApiEntryT.nasm | 60 +---
 .../FspSecCore/Ia32/SaveRestoreSseNasm.inc| 11 +++
 IntelFsp2Pkg/FspSecCore/SecFsp.c  |  9 +++
 IntelFsp2Pkg/FspSecCore/SecFsp.h  |  1 +
 IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 68 +++
 IntelFsp2Pkg/Include/FspEas/FspApi.h  | 12 +++-
 IntelFsp2Pkg/Include/Library/FspPlatformLib.h | 13 
 .../Include/SaveRestoreSseAvxNasm.inc | 21 ++
 .../BaseFspPlatformLib/FspPlatformMemory.c| 38 +++
 13 files changed, 211 insertions(+), 26 deletions(-)

diff --git a/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf 
b/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
index cb011f99f9..8cb0e6411f 100644
--- a/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
+++ b/IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf
@@ -60,6 +60,7 @@
   FspSecPlatformLib
   CpuLib
   FspMultiPhaseLib
+  FspPlatformLib
 
 [Pcd]
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
diff --git a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf 
b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
index 8029832235..ef19c6ae78 100644
--- a/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
+++ b/IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf
@@ -59,6 +59,7 @@
   FspCommonLib
   FspSecPlatformLib
   CpuLib
+  FspPlatformLib
 
 [Pcd]
   gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase  ## CONSUMES
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm
index 15f8ecea83..5fa5c03569 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/Fsp24ApiEntryM.nasm
@@ -11,7 +11,6 @@
 ; Following are fixed PCDs
 ;
 extern   ASM_PFX(PcdGet32(PcdTemporaryRamBase))
-extern   ASM_PFX(PcdGet32(PcdTemporaryRamSize))
 extern   ASM_PFX(PcdGet32(PcdFspTemporaryRamSize))
 extern   ASM_PFX(PcdGet8 (PcdFspHeapSizePercentage))
 
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
index 61ab4612a3..861cce4d01 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryM.nasm
@@ -11,7 +11,6 @@
 ; Following are fixed PCDs
 ;
 extern   ASM_PFX(PcdGet32(PcdTemporaryRamBase))
-extern   ASM_PFX(PcdGet32(PcdTemporaryRamSize))
 extern   ASM_PFX(PcdGet32(PcdFspTemporaryRamSize))
 extern   ASM_PFX(PcdGet8 (PcdFspHeapSizePercentage))
 
diff --git a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm 
b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
index 900126b93b..088bd7ee7f 100644
--- a/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
+++ b/IntelFsp2Pkg/FspSecCore/Ia32/FspApiEntryT.nasm
@@ -109,7 +109,8 @@ struc LoadMicrocodeParamsFsp24
 .FsptArchReserved:resb3
 .FsptArchLength:  resd1
 .FspDebugHandler  resq1
-.FsptArchUpd: resd4
+.FspTemporaryRamSize: resd1  ; Supported only if ArchRevison is >= 
3
+.FsptArchUpd: resd3
 ; }
 ; FSPT_CORE_UPD {
 .MicrocodeCodeAddr:   resq1
@@ -267,7 +268,7 @@ ASM_PFX(LoadMicrocodeDefault):
cmpbyte [esp + LoadMicrocodeParamsFsp22.FspUpdHeaderRevision], 2
jb Fsp20UpdHeader
cmpbyte [esp + LoadMicrocodeParamsFsp22.FsptArchRevision], 2
-   je Fsp24UpdHeader
+   jaeFsp24UpdHeader
jmpFsp22UpdHeader
 
 Fsp20UpdHeader:
@@ -405,7 +406,7 @@ CheckAddress:
cmp   byte [esp + LoadMicrocodeParamsFsp22.FspUpdHeaderRevision], 2
jb Fsp20UpdHeader1
cmpbyte [esp + LoadMicrocodeParamsFsp22.FsptArchRevision], 2
-   je Fsp24UpdHeader1;
+   jaeFsp24UpdHeader1;
jmpFsp22UpdHeader1
 
 Fsp20UpdHeader1:
@@ -497,7 +498,8 @@ ASM_PFX(EstablishStackFsp):
   ; Enable FSP STACK
   ;
   mov   esp, DWORD [ASM_PFX(PcdGet32 (PcdTemporaryRamBase))]
-  add   esp, DWORD [ASM_PFX(PcdGet32 (PcdTemporaryRamSize))]
+  LOAD_TEMPORARY_RAM_SIZE ecx
+  add   esp, ecx
 
   push  DATA_LEN_OF_MCUD ; Size of the data region
   push  4455434Dh; Signature of the  data region 'MCUD'
@@ -506,7 +508,7 @@ ASM_PFX(EstablishStackFsp):
   cmp   byte [edx + LoadMicrocodeParamsFsp22.FspUpdHeaderRevision], 2
   jbFsp20UpdHeader2
   cmp   byte [esp + LoadMicrocodeParamsFsp22.FsptArchRevision], 2
-  jeFsp24UpdHeader2
+  jae   Fsp24UpdHeader2
   jmp   Fsp22UpdHeader2
 
 Fsp20UpdHeader2:
@@ -554,12 +556,13 @@ ContinueAfterUpdPush:
   ;
   ; Set ECX/EDX to the 

[edk2-devel] [PATCH v6 0/3] IntelFsp2Pkg: Fsp T new ARCH UPD Support

2024-04-05 Thread cbduggap
This Patch will add changes to support FSP T new ARCH UPD
and Fix Bug in IntelFsp2WrapperPkg

cbduggap (3):
  IntelFsp2Pkg: Fsp T new ARCH UPD Support
  IntelFsp2WrapperPkg: Fsp T new ARCH UPD Support
  IntelFsp2WrapperPkg: Fix UPD structure Reserved bytes

 IntelFsp2Pkg/FspSecCore/Fsp24SecCoreM.inf |  1 +
 IntelFsp2Pkg/FspSecCore/FspSecCoreM.inf   |  1 +
 .../FspSecCore/Ia32/Fsp24ApiEntryM.nasm   |  1 -
 .../FspSecCore/Ia32/FspApiEntryM.nasm |  1 -
 .../FspSecCore/Ia32/FspApiEntryT.nasm | 60 +---
 .../FspSecCore/Ia32/SaveRestoreSseNasm.inc| 11 +++
 IntelFsp2Pkg/FspSecCore/SecFsp.c  |  9 +++
 IntelFsp2Pkg/FspSecCore/SecFsp.h  |  1 +
 IntelFsp2Pkg/FspSecCore/X64/FspApiEntryT.nasm | 68 +++
 IntelFsp2Pkg/Include/FspEas/FspApi.h  | 12 +++-
 IntelFsp2Pkg/Include/Library/FspPlatformLib.h | 13 
 .../Include/SaveRestoreSseAvxNasm.inc | 21 ++
 .../BaseFspPlatformLib/FspPlatformMemory.c| 38 +++
 .../SecRamInitData.c  | 12 ++--
 14 files changed, 219 insertions(+), 30 deletions(-)

-- 
2.39.1.windows.1



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117461): https://edk2.groups.io/g/devel/message/117461
Mute This Topic: https://groups.io/mt/105352668/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




[edk2-devel] bootloader build error

2024-04-05 Thread Bill Shih 施炫全 via groups . io
Hi Sir

I have problem when building android bootloader.

The log suggested I could mail you for help.

Can I have your suggestion to solve this error?

Thank you

The log:

build.py...
: error C0DE: Unknown fatal error when processing 
[/.../vendor/BOOT.MXF.2.0/boot_images/boot/***/Library/EblCmdLib/EblCmdLib.inf 
[AARCH64, CLANG120LINUX, RELEASE]]

(Please send email to devel@edk2.groups.io for 
help, attaching following call stack trace!)

(Python 2.7.18 on linux2) Traceback (most recent call last):
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2599, in Main
MyBuild.Launch()
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2394, in Launch
self._MultiThreadBuildPlatform()
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2234, in _MultiThreadBuildPlatform
Wa, self.BuildModules = self.PerformAutoGen(BuildTarget,ToolChain)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2109, in PerformAutoGen
CmdListDict = self._GenFfsCmd(Wa.ArchList)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py",
 line 2006, in _GenFfsCmd
GenFfsDict = GenFds.GenFfsMakefile('', GlobalData.gFdfParser, self, 
ArchList, GlobalData)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFds.py",
 line 544, in GenFfsMakefile
FvObj.AddToBuffer(Buffer=None, Flag=True)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/Fv.py",
 line 127, in AddToBuffer
FileName = FfsFile.GenFfs(MacroDict, FvParentAddr=BaseAddress, 
IsMakefile=Flag, FvName=self.UiFvName)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
 line 518, in GenFfs
InputSectList, InputSectAlignments = self.__GenComplexFileSection__(Rule, 
FvChildAddr, FvParentAddr, IsMakefile=IsMakefile)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/FfsInfStatement.py",
 line 969, in __GenComplexFileSection__
SectList, Align = Sect.GenSection(self.OutputPath, self.ModuleGuid, 
SecIndex, self.KeyStringList, self, IsMakefile = IsMakefile)
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/EfiSection.py",
 line 321, in GenSection
IsMakefile=IsMakefile
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py",
 line 502, in GenerateSection
if (os.path.getsize(Output) >= GenFdsGlobalVariable.LARGE_FILE_SIZE and
  File 
"/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/Common/LongFilePathOsPath.py",
 line 21, in getsize
return os.path.getsize(LongFilePath(filename))
  File "/usr/lib/python2.7/genericpath.py", line 57, in getsize
return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: 
'/.../vendor/BOOT.MXF.2.0/boot_images/Build/ClarenceLAA/Core/RELEASE_CLANG120LINUX/FV/Ffs/1C04F529-0612-4319-9315-B2E75C16810AFeatureEnablerDxe/1C04F529-0612-4319-9315-B2E75C16810ASEC2.1.pe32'


- Failed -
Build end time: 17:11:19, Apr.03 2024
Build total time: 00:00:04

, u'-b', u'RELEASE', u'-t', u'CLANG120LINUX', '-D', 'TARGETPKG=SocPkg', '-D', 
u'DTC=/pkg/qct/software/boottools/', '-D', 
'EDK2ROOT=/.../vendor/BOOT.MXF.2.0/boot_images/edk2', '-D', 
u'CLANG120=/opt/LLVM/12.0.3/bin', '-D', 
'BOOTTOOLS=/.../vendor/BOOT.MXF.2.0/boot_images/boot_tools', '-D', 
u'COMPILER=CLANG120LINUX', '-D', 
u'SECTOOLSROOT=/.../vendor/QCM4490.LA.1.0/common/sectoolsv2/ext/Linux', '-D', 
'***DIR=', '-D', 'TARGETID=SocClarence', '-D', u'VAR=LAA', '-D', 
'TARGETROOT=***/SocPkg/Clarence', '-D', 
u'BOOTROOT=/.../vendor/BOOT.MXF.2.0/boot_images/boot', '-D', 
'BUILDROOT=/.../vendor/BOOT.MXF.2.0/boot_images', '-D', 'PRODMODE=PRODMODE', 
'-D', 'XBLSEC=', '-D', u'AARCH=AARCH64', '-D', 'SECONDDLL=', '-D', 'COMPLIER=', 
'-D', 'REL=RELEASE', '-D', 'FIRSTDLL=']

ERROR: buildex::Run  ['python', 
u'/.../vendor/BOOT.MXF.2.0/boot_images/edk2/BaseTools/Source/Python/build/build.py',
 u'-p', u'***/SocPkg/Clarence/LAA/Core.dsc', u'-j', 
u'***/SocPkg/Clarence/LAA/build_Core.log', u'-w', u'-a', u'AARCH64', u'-b', 
u'RELEASE', u'-t', u'CLANG120LINUX', '-D', 'TARGETPKG=SocPkg', '-D', 
u'DTC=/pkg/qct/software/boottools/', '-D', 
'EDK2ROOT=/.../vendor/BOOT.MXF.2.0/boot_images/edk2', '-D', 
u'CLANG120=/opt/LLVM/12.0.3/bin', '-D', 
'BOOTTOOLS=/.../vendor/BOOT.MXF.2.0/boot_images/boot_tools', '-D', 
u'COMPILER=CLANG120LINUX', '-D', 
u'SECTOOLSROOT=/.../vendor/QCM4490.LA.1.0/common/sectoolsv2/ext/Linux', '-D', 
'***DIR=', '-D', 'TARGETID=SocClarence', '-D', u'VAR=LAA', '-D', 
'TARGETROOT=***/SocPkg/Clarence', '-D', 
u'BOOTROOT=/.../vendor/BOOT.MXF.2.0/boot_images/boot', '-D', 
'BUILDROOT=/.../vendor/BOOT.MXF.2.0/boot_images', '-D', 'PRODMODE=PRODMODE', 
'-D', 'XBLSEC=', '-D', u'AARCH=AARCH64', 

[edk2-devel] [PATCH] OvmfPkg: OVMF supports USB mouses

2024-04-05 Thread phillip
From: Phillip Tennen 

UsbMouseDxe was missing from the OVMF build description, so 
the Simple Pointer Protocol wasn't usable from within QEMU.

Here's an example of somone getting tripped up by this:
https://forum.osdev.org/viewtopic.php?f=1=31572.

I worked around this by including the below patch in my local
builds, and was encouraged by Heinrich Schuchardt to submit a patch.

I have not contributed to this project before, so please accept
my apologies if I've formatted anything incorrect. All the best.

Signed-off-by: Phillip Tennen 

---
 OvmfPkg/OvmfPkgX64.dsc | 1 +
 OvmfPkg/OvmfPkgX64.fdf | 1 +
 2 files changed, 2 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 56c920168d..d76a263859 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -953,6 +953,7 @@
   MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
   MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
   MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 
 !include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
 
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf
index eb3fb90cb8..bfe201a352 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -342,6 +342,7 @@ INF  MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
 INF  MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
 INF  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
 INF  MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
+INF  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
 INF  MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
 
 INF  OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf
-- 
2.39.3 (Apple Git-145)



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117459): https://edk2.groups.io/g/devel/message/117459
Mute This Topic: https://groups.io/mt/105348119/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] OvmfPkg: OVMF supports USB mouses

2024-04-05 Thread Heinrich Schuchardt

On 05.04.24 14:58, phil...@axleos.com wrote:

From: Phillip Tennen 

UsbMouseDxe was missing from the OVMF build description, so
the Simple Pointer Protocol wasn't usable from within QEMU.

Here's an example of somone getting tripped up by this:
https://forum.osdev.org/viewtopic.php?f=1=31572.

I worked around this by including the below patch in my local
builds, and was encouraged by Heinrich Schuchardt to submit a patch.

I have not contributed to this project before, so please accept
my apologies if I've formatted anything incorrect. All the best.

Signed-off-by: Phillip Tennen 

---
  OvmfPkg/OvmfPkgX64.dsc | 1 +
  OvmfPkg/OvmfPkgX64.fdf | 1 +
  2 files changed, 2 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 56c920168d..d76a263859 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -953,6 +953,7 @@
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf


Thank you Phillip for your contribution.

https://github.com/tianocore/tianocore.github.io/wiki/Code-Contributions 
provides some guidance for contributing.


Currently applying the patch fails:

$ git am --keep-cr /tmp/\[PATCH\]\ OvmfPkg\:\ OVMF\ supports\ USB\ 
mouses\ -\ phil...@axleos.com\ -\ 2024-04-05\ 1458.eml

warning: quoted CRLF detected
Applying: OvmfPkg: OVMF supports USB mouses
.git/rebase-apply/patch:14: trailing whitespace.
  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
.git/rebase-apply/patch:26: trailing whitespace.
INF  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
error: patch failed: OvmfPkg/OvmfPkgX64.dsc:953
error: OvmfPkg/OvmfPkgX64.dsc: patch does not apply
error: patch failed: OvmfPkg/OvmfPkgX64.fdf:342
error: OvmfPkg/OvmfPkgX64.fdf: patch does not apply
Patch failed at 0001 OvmfPkg: OVMF supports USB mouses

I guess this is due to line endings.

Please, run 'python3 BaseTools/Scripts/SetupGit.py' in your git 
repository to set it up to match the Tianocore submission style, e.g.


[sendemail]
transferEncoding = 8bit

Please, align to the existing indentation.

For consistency it would be preferable to add both lines in the same 
place under UsbKbDxe.inf.


The change looks correct and the USB mouse works fine when testing with 
your IRC application.


File Maintainers contains the list of people that should be CCed on 
mails with OvmfPkg patches.


Best regards

Heinrich

  
  !include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
  
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf

index eb3fb90cb8..bfe201a352 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -342,6 +342,7 @@ INF  MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
  INF  MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
  INF  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
  INF  MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
+INF  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
  INF  MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
  
  INF  OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117458): https://edk2.groups.io/g/devel/message/117458
Mute This Topic: https://groups.io/mt/105348119/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH] OvmfPkg: OVMF supports USB mouses

2024-04-05 Thread Heinrich Schuchardt

On 05.04.24 14:58, phil...@axleos.com wrote:

From: Phillip Tennen 

UsbMouseDxe was missing from the OVMF build description, so
the Simple Pointer Protocol wasn't usable from within QEMU.

Here's an example of somone getting tripped up by this:
https://forum.osdev.org/viewtopic.php?f=1=31572.

I worked around this by including the below patch in my local
builds, and was encouraged by Heinrich Schuchardt to submit a patch.

I have not contributed to this project before, so please accept
my apologies if I've formatted anything incorrect. All the best.

Signed-off-by: Phillip Tennen 

---
  OvmfPkg/OvmfPkgX64.dsc | 1 +
  OvmfPkg/OvmfPkgX64.fdf | 1 +
  2 files changed, 2 insertions(+)

diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc
index 56c920168d..d76a263859 100644
--- a/OvmfPkg/OvmfPkgX64.dsc
+++ b/OvmfPkg/OvmfPkgX64.dsc
@@ -953,6 +953,7 @@
MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
+  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf


Thank you Phillip for contributing.

https://github.com/tianocore/tianocore.github.io/wiki/Code-Contributions
has some information on the contribution process.

Currently applying the patch in this mail fails:

git am --keep-cr '[PATCH] OvmfPkg: OVMF supports USB mouses - 
phil...@axleos.com - 2024-04-05 1458.eml'


warning: quoted CRLF detected
Applying: OvmfPkg: OVMF supports USB mouses
.git/rebase-apply/patch:14: trailing whitespace.
  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
.git/rebase-apply/patch:26: trailing whitespace.
INF  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
error: patch failed: OvmfPkg/OvmfPkgX64.dsc:953
error: OvmfPkg/OvmfPkgX64.dsc: patch does not apply
error: patch failed: OvmfPkg/OvmfPkgX64.fdf:342
error: OvmfPkg/OvmfPkgX64.fdf: patch does not apply
Patch failed at 0001 OvmfPkg: OVMF supports USB mouses

I guess it is just a problem with the line endings.

Please, run 'python3 BaseTools/Scripts/SetupGit.py' once. This will set 
up your git repository with the Tianocore defaults for submitting patches.


It would be preferable to match the existing indentation.

Maybe make both insertions at the same place under UsbKbDxe.inf.

Otherwise looks good to me and works fine: The USB mouse is usable in 
your IRC application.


The file 'Maintainers' has a list of the persons that should be CCed for 
OvmfPkg patches.


Best regards

Heinrich

  
  !include OvmfPkg/Include/Dsc/ShellComponents.dsc.inc
  
diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf

index eb3fb90cb8..bfe201a352 100644
--- a/OvmfPkg/OvmfPkgX64.fdf
+++ b/OvmfPkg/OvmfPkgX64.fdf
@@ -342,6 +342,7 @@ INF  MdeModulePkg/Bus/Pci/EhciDxe/EhciDxe.inf
  INF  MdeModulePkg/Bus/Pci/XhciDxe/XhciDxe.inf
  INF  MdeModulePkg/Bus/Usb/UsbBusDxe/UsbBusDxe.inf
  INF  MdeModulePkg/Bus/Usb/UsbKbDxe/UsbKbDxe.inf
+INF  MdeModulePkg/Bus/Usb/UsbMouseDxe/UsbMouseDxe.inf
  INF  MdeModulePkg/Bus/Usb/UsbMassStorageDxe/UsbMassStorageDxe.inf
  
  INF  OvmfPkg/QemuVideoDxe/QemuVideoDxe.inf




-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117457): https://edk2.groups.io/g/devel/message/117457
Mute This Topic: https://groups.io/mt/105348119/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [PATCH 0/2] ArmPkg: Remove ArmCortexA[5x|9].h files

2024-04-05 Thread Sami Mujawar
Merged as 6fb3cc05dc87..8707f835ae35

Thanks.

Regards,

Sami Mujawar


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117456): https://edk2.groups.io/g/devel/message/117456
Mute This Topic: https://groups.io/mt/104351709/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Question] using Flexible Array Member in Structure.

2024-04-05 Thread Pedro Falcato
On Wed, Apr 3, 2024 at 10:27 AM levi.yun  wrote:
>
> Hello all!
>
> while I see the code. I have one question related using Flexible Array
> Member.
>
> For example)
>
> ///
> /// Socket Type Data.
> ///
> typedef struct {
>EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE CommonMemoryDeviceHeader;
>UINT16 SocketIdentifier;
>UINT16 Reserved;
>// EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE MemoryDeviceStructure[];
> } EFI_ACPI_6_4_PMTT_SOCKET_TYPE_DATA;
>
>
> ///
> /// Socket Type Data.
> ///
> typedef struct {
>EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE CommonMemoryDeviceHeader;
>UINT16 SocketIdentifier;
>UINT16 Reserved;
>EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE  MemoryDeviceStructure[]
> }

This change might be okay. Both variants may be size (and
layout)-equivalent. See https://godbolt.org/z/364e4T4a7. You need to
check if e.g there's any padding after Reserved and before
MemoryDeviceStructure.
Basically make sure member offsets and sizes remain stable.

Thanks,
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117455): https://edk2.groups.io/g/devel/message/117455
Mute This Topic: https://groups.io/mt/105305209/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Question] using Flexible Array Member in Structure.

2024-04-05 Thread Pedro Falcato
On Fri, Apr 5, 2024 at 7:43 AM levi.yun  wrote:
>
> Hi Michael! Thanks for answer.
>
> > Converting these to a flexible array member would not be
> a backwards compatible change.
>
> That's the point. But at least when I see the compiler used in tool_def.txt,
> there's no compiler which doesn't support to flexible array member.
>
> Do we still need to consider the case building edk2 with lower version of 
> comipler
> which isn't manifested in tool_def.txt?

That's not in question. What Mike is referring to here is, e.g:

typedef struct {
BOOLEAN Supported;
UINT64 KeyCount;
UINT64 CapabilityCount;
EFI_BLOCK_IO_CRYPTO_CAPABILITY Capabilities [1];
} EFI_BLOCK_IO_CRYPTO_CAPABILITIES1;

typedef struct {
BOOLEAN Supported;
UINT64 KeyCount;
UINT64 CapabilityCount;
EFI_BLOCK_IO_CRYPTO_CAPABILITY Capabilities [];
} EFI_BLOCK_IO_CRYPTO_CAPABILITIES2;

sizeof(EFI_BLOCK_IO_CRYPTO_CAPABILITIES1) !=
sizeof(EFI_BLOCK_IO_CRYPTO_CAPABILITIES2), so it's an ABI break.
And unfortunately many of these structs need to be ABI-stable (I took
this one off the spec, you can find many such cases by ctrl+F'ing
[1]).

Basically, it comes down to the ABI. If it breaks the ABI, you need to
figure out *if* it matters (e.g is it part of a protocol, or is it an
internal lib struct that does not need to be stable, is it ABI to some
external component).
Also, worth noting that the "[1]" pattern is UB, and only works
because GCC (et al) don't want to break a bunch of code. If you're
defining a new struct, there's no reason to use [1] as a flexible
array.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117454): https://edk2.groups.io/g/devel/message/117454
Mute This Topic: https://groups.io/mt/105305209/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-




Re: [edk2-devel] [Question] using Flexible Array Member in Structure.

2024-04-05 Thread levi.yun
Hi Michael! Thanks for answer.

> Converting these to a flexible array member would not be
a backwards compatible change.

That's the point. But at least when I see the compiler used in tool_def.txt,
there's no compiler which doesn't support to flexible array member.

Do we still need to consider the case building edk2 with lower version of 
comipler
which isn't manifested in tool_def.txt?

Thanks!



From: Kinney, Michael D 
Sent: 03 April 2024 17:17
To: devel@edk2.groups.io; Yeo Reum Yun
Cc: nd; Sami Mujawar; Kinney, Michael D
Subject: RE: [edk2-devel] [Question] using Flexible Array Member in Structure.

Yes.  Use of flexible array members is supported and encouraged.

There are challenges with existing structure definitions that declare
arrays of size [1] when a flexible array is really intended. Those
were defined before flexible array members were supported by all the
compilers.  Converting these to a flexible array member would not be
a backwards compatible change.

Mike

> -Original Message-
> From: devel@edk2.groups.io  On Behalf Of
> levi.yun
> Sent: Wednesday, April 3, 2024 2:27 AM
> To: devel@edk2.groups.io
> Cc: n...@arm.com; sami.muja...@arm.com
> Subject: [edk2-devel] [Question] using Flexible Array Member in
> Structure.
>
> Hello all!
>
> while I see the code. I have one question related using Flexible Array
> Member.
>
> For example)
>
> ///
> /// Socket Type Data.
> ///
> typedef struct {
>EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE CommonMemoryDeviceHeader;
>UINT16 SocketIdentifier;
>UINT16 Reserved;
>// EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE MemoryDeviceStructure[];
> } EFI_ACPI_6_4_PMTT_SOCKET_TYPE_DATA;
>
> In here, why MemoryDeviceStructure should remain with comments?
>
> IIUC, edk2 coding style guide doesn't seem to prevent use of Flexible
> Array Member which is C99 standard.
>
> And consider the compiler used to compile edk2 uses defaults standard
> above of C99 standard.
>
> Couldn't I use the flexible array member like:
>
> ///
> /// Socket Type Data.
> ///
> typedef struct {
>EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE CommonMemoryDeviceHeader;
>UINT16 SocketIdentifier;
>UINT16 Reserved;
>EFI_ACPI_6_4_PMTT_COMMON_MEMORY_DEVICE  MemoryDeviceStructure[]
> }
>
> Thanks!
>
>
> 
>



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#117453): https://edk2.groups.io/g/devel/message/117453
Mute This Topic: https://groups.io/mt/105305209/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-