public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* FW: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value.
       [not found] <20211108082136.2707-1-xiaolu.jiang@intel.com>
@ 2021-11-10  2:59 ` Jiang, Xiaolu
  2021-11-12  6:59   ` Jiang, Xiaolu
  0 siblings, 1 reply; 2+ messages in thread
From: Jiang, Xiaolu @ 2021-11-10  2:59 UTC (permalink / raw)
  To: devel@edk2.groups.io
  Cc: Jiang, Xiaolu, Feng, Bob C, Liming Gao, Chen, Christine,
	Wu, Yidong

Hi  All,

I have update the patch for the comments, Please help review the patch.

-----Original Message-----
From: Jiang, Xiaolu <xiaolu.jiang@intel.com> 
Sent: Monday, November 8, 2021 4:22 PM
To: devel@edk2.groups.io
Cc: Jiang, Xiaolu <xiaolu.jiang@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value.

Currently the PCD Value only support 13 Guid,When use more 13 pcd will cause the build tool fail, Need calculate the required memory,then allocate it.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3718

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>

Signed-off-by: Xiaolu Jiang <xiaolu.jiang@intel.com>
---
 BaseTools/Source/C/DevicePath/DevicePath.c | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/DevicePath.c b/BaseTools/Source/C/DevicePath/DevicePath.c
index c4d224ed61..8a0f5f4e2a 100644
--- a/BaseTools/Source/C/DevicePath/DevicePath.c
+++ b/BaseTools/Source/C/DevicePath/DevicePath.c
@@ -144,6 +144,40 @@ Returns:
   *UniString = '\0'; } ++/**+  Returns the length of a Null-terminated ASCII string.++  This function returns the number of ASCII characters in the Null-terminated+  ASCII string specified by String.++  If Length > 0 and Destination is NULL, then ASSERT().+  If Length > 0 and Source is NULL, then ASSERT().+  If PcdMaximumAsciiStringLength is not zero and String contains more than+  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,+  then ASSERT().++  @param  String  A pointer to a Null-terminated ASCII string.++  @return The length of String.++**/+UINTN+EFIAPI+AsciiStrLen (+  IN      CONST CHAR8               *String+  )+{+  UINTN                             Length;++  ASSERT (String != NULL);++  for (Length = 0; *String != '\0'; String++, Length++) {++  }+  return Length;+}+ int main(int argc, CHAR8 *argv[]) {   CHAR8 * Str;@@ -170,7 +204,7 @@ int main(int argc, CHAR8 *argv[])
     fprintf(stderr, "Invalid option value, Device Path can't be NULL");     return STATUS_ERROR;   }-  Str16 = (CHAR16 *)malloc(1024);+  Str16 = (CHAR16 *)malloc((AsciiStrLen (Str) + 1) * sizeof (CHAR16));   if (Str16 == NULL) {     fprintf(stderr, "Resource, memory cannot be allocated");     return STATUS_ERROR;-- 
2.30.2.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value.
  2021-11-10  2:59 ` FW: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value Jiang, Xiaolu
@ 2021-11-12  6:59   ` Jiang, Xiaolu
  0 siblings, 0 replies; 2+ messages in thread
From: Jiang, Xiaolu @ 2021-11-12  6:59 UTC (permalink / raw)
  To: devel@edk2.groups.io; +Cc: Feng, Bob C, Liming Gao, Chen, Christine, Wu, Yidong

Hi,

Please help review the patch, If you have any concern pls let me know.

-----Original Message-----
From: Jiang, Xiaolu 
Sent: Wednesday, November 10, 2021 11:00 AM
To: devel@edk2.groups.io
Cc: Jiang, Xiaolu <xiaolu.jiang@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>; Wu, Yidong <yidong.wu@intel.com>
Subject: FW: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value.

Hi  All,

I have update the patch for the comments, Please help review the patch.

-----Original Message-----
From: Jiang, Xiaolu <xiaolu.jiang@intel.com> 
Sent: Monday, November 8, 2021 4:22 PM
To: devel@edk2.groups.io
Cc: Jiang, Xiaolu <xiaolu.jiang@intel.com>; Feng, Bob C <bob.c.feng@intel.com>; Liming Gao <gaoliming@byosoft.com.cn>; Chen, Christine <yuwei.chen@intel.com>
Subject: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value.

Currently the PCD Value only support 13 Guid,When use more 13 pcd will cause the build tool fail, Need calculate the required memory,then allocate it.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3718

Cc: Bob Feng <bob.c.feng@intel.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Yuwei Chen <yuwei.chen@intel.com>

Signed-off-by: Xiaolu Jiang <xiaolu.jiang@intel.com>
---
 BaseTools/Source/C/DevicePath/DevicePath.c | 36 +++++++++++++++++++++-
 1 file changed, 35 insertions(+), 1 deletion(-)

diff --git a/BaseTools/Source/C/DevicePath/DevicePath.c b/BaseTools/Source/C/DevicePath/DevicePath.c
index c4d224ed61..8a0f5f4e2a 100644
--- a/BaseTools/Source/C/DevicePath/DevicePath.c
+++ b/BaseTools/Source/C/DevicePath/DevicePath.c
@@ -144,6 +144,40 @@ Returns:
   *UniString = '\0'; } ++/**+  Returns the length of a Null-terminated ASCII string.++  This function returns the number of ASCII characters in the Null-terminated+  ASCII string specified by String.++  If Length > 0 and Destination is NULL, then ASSERT().+  If Length > 0 and Source is NULL, then ASSERT().+  If PcdMaximumAsciiStringLength is not zero and String contains more than+  PcdMaximumAsciiStringLength ASCII characters, not including the Null-terminator,+  then ASSERT().++  @param  String  A pointer to a Null-terminated ASCII string.++  @return The length of String.++**/+UINTN+EFIAPI+AsciiStrLen (+  IN      CONST CHAR8               *String+  )+{+  UINTN                             Length;++  ASSERT (String != NULL);++  for (Length = 0; *String != '\0'; String++, Length++) {++  }+  return Length;+}+ int main(int argc, CHAR8 *argv[]) {   CHAR8 * Str;@@ -170,7 +204,7 @@ int main(int argc, CHAR8 *argv[])
     fprintf(stderr, "Invalid option value, Device Path can't be NULL");     return STATUS_ERROR;   }-  Str16 = (CHAR16 *)malloc(1024);+  Str16 = (CHAR16 *)malloc((AsciiStrLen (Str) + 1) * sizeof (CHAR16));   if (Str16 == NULL) {     fprintf(stderr, "Resource, memory cannot be allocated");     return STATUS_ERROR;-- 
2.30.2.windows.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-11-12  6:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20211108082136.2707-1-xiaolu.jiang@intel.com>
2021-11-10  2:59 ` FW: [edk2-devel][PATCH] BaseTools: Increase the DevicePath length for support more PCD value Jiang, Xiaolu
2021-11-12  6:59   ` Jiang, Xiaolu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox