[coreboot-gerrit] Change in coreboot[master]: arch/x86/acpigen: Allow writing buffers larger than 256 bytes

Martin Roth (Code Review) gerrit at coreboot.org
Mon Apr 3 04:53:11 CEST 2017


Martin Roth has submitted this change and it was merged. ( https://review.coreboot.org/18966 )

Change subject: arch/x86/acpigen: Allow writing buffers larger than 256 bytes
......................................................................


arch/x86/acpigen: Allow writing buffers larger than 256 bytes

Currently only 256 bytes can be written at a time using the
acpigen_write_return_byte_buffer or acpigen_write_byte_buffer API's
and there can be cases where the buffer size can exceed this, hence
increase the number of bytes that can be written.

Change-Id: Ifaf508ae1d5c0eb2629ca112224bfeae1c644e58
Signed-off-by: Rizwan Qureshi <rizwan.qureshi at intel.com>
Signed-off-by: Sowmya V <v.sowmya at intel.com>
Reviewed-on: https://review.coreboot.org/18966
Tested-by: build bot (Jenkins)
Reviewed-by: Duncan Laurie <dlaurie at chromium.org>
Reviewed-by: Aaron Durbin <adurbin at chromium.org>
---
M src/arch/x86/acpigen.c
M src/arch/x86/include/arch/acpigen.h
2 files changed, 6 insertions(+), 6 deletions(-)

Approvals:
  Aaron Durbin: Looks good to me, approved
  Duncan Laurie: Looks good to me, approved
  build bot (Jenkins): Verified



diff --git a/src/arch/x86/acpigen.c b/src/arch/x86/acpigen.c
index 81a69ce..d3aaa3d 100644
--- a/src/arch/x86/acpigen.c
+++ b/src/arch/x86/acpigen.c
@@ -1146,13 +1146,13 @@
 	acpigen_emit_byte(dst);
 }
 
-void acpigen_write_byte_buffer(uint8_t *arr, uint8_t size)
+void acpigen_write_byte_buffer(uint8_t *arr, size_t size)
 {
-	uint8_t i;
+	size_t i;
 
 	acpigen_emit_byte(BUFFER_OP);
 	acpigen_write_len_f();
-	acpigen_write_byte(size);
+	acpigen_write_integer(size);
 
 	for (i = 0; i < size; i++)
 		acpigen_emit_byte(arr[i]);
@@ -1160,7 +1160,7 @@
 	acpigen_pop_len();
 }
 
-void acpigen_write_return_byte_buffer(uint8_t *arr, uint8_t size)
+void acpigen_write_return_byte_buffer(uint8_t *arr, size_t size)
 {
 	acpigen_emit_byte(RETURN_OP);
 	acpigen_write_byte_buffer(arr, size);
diff --git a/src/arch/x86/include/arch/acpigen.h b/src/arch/x86/include/arch/acpigen.h
index b08ce93..f76fce8 100644
--- a/src/arch/x86/include/arch/acpigen.h
+++ b/src/arch/x86/include/arch/acpigen.h
@@ -242,8 +242,8 @@
 void acpigen_write_else(void);
 void acpigen_write_to_buffer(uint8_t src, uint8_t dst);
 void acpigen_write_to_integer(uint8_t src, uint8_t dst);
-void acpigen_write_byte_buffer(uint8_t *arr, uint8_t size);
-void acpigen_write_return_byte_buffer(uint8_t *arr, uint8_t size);
+void acpigen_write_byte_buffer(uint8_t *arr, size_t size);
+void acpigen_write_return_byte_buffer(uint8_t *arr, size_t size);
 void acpigen_write_return_singleton_buffer(uint8_t arg);
 void acpigen_write_return_byte(uint8_t arg);
 /*

-- 
To view, visit https://review.coreboot.org/18966
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifaf508ae1d5c0eb2629ca112224bfeae1c644e58
Gerrit-PatchSet: 3
Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-Owner: V Sowmya <v.sowmya at intel.com>
Gerrit-Reviewer: Aamir Bohra <aamir.bohra at intel.com>
Gerrit-Reviewer: Aaron Durbin <adurbin at chromium.org>
Gerrit-Reviewer: Balaji Manigandan <balaji.manigandan at intel.com>
Gerrit-Reviewer: Barnali Sarkar <barnali.sarkar at intel.com>
Gerrit-Reviewer: Duncan Laurie <dlaurie at chromium.org>
Gerrit-Reviewer: Furquan Shaikh <furquan at google.com>
Gerrit-Reviewer: Martin Roth <martinroth at google.com>
Gerrit-Reviewer: Naresh Solanki <naresh.solanki at intel.com>
Gerrit-Reviewer: Paul Menzel <paulepanter at users.sourceforge.net>
Gerrit-Reviewer: Rizwan Qureshi <rizwan.qureshi at intel.com>
Gerrit-Reviewer: Subrata Banik <subrata.banik at intel.com>
Gerrit-Reviewer: V Sowmya <v.sowmya at intel.com>
Gerrit-Reviewer: build bot (Jenkins)



More information about the coreboot-gerrit mailing list