[coreboot-gerrit] Change in coreboot[master]: util/cbfstool: Print all supported architectures

Jonathan Neuschäfer (Code Review) gerrit at coreboot.org
Tue Apr 10 15:02:44 CEST 2018


Jonathan Neuschäfer has uploaded this change for review. ( https://review.coreboot.org/25590


Change subject: util/cbfstool: Print all supported architectures
......................................................................

util/cbfstool: Print all supported architectures

The list of supported architectures in the usage output of cbfstool is
currently hardcoded and outdated.

Use the arch_names array in common.c to provide and up-to-date list.

Change-Id: I3e7ed67c3bfd928b304c314fcc8e1bea35561662
Signed-off-by: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
---
M util/cbfstool/cbfstool.c
M util/cbfstool/common.c
M util/cbfstool/common.h
3 files changed, 17 insertions(+), 3 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/90/25590/1

diff --git a/util/cbfstool/cbfstool.c b/util/cbfstool/cbfstool.c
index 1f71906..7156e00 100644
--- a/util/cbfstool/cbfstool.c
+++ b/util/cbfstool/cbfstool.c
@@ -1350,10 +1350,11 @@
 	     "  in two possible formats: if their value is greater than\n"
 	     "  0x80000000, they are interpreted as a top-aligned x86 memory\n"
 	     "  address; otherwise, they are treated as an offset into flash.\n"
-	     "ARCHes:\n"
-	     "  arm64, arm, mips, x86\n"
-	     "TYPEs:\n", name, name
+	     "ARCHes:\n", name, name
 	    );
+	print_supported_architectures();
+
+	printf("TYPEs:\n");
 	print_supported_filetypes();
 
 	printf(
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index 72ff745..14ccaa9 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -168,6 +168,18 @@
 	return ret;
 }
 
+void print_supported_architectures(void)
+{
+	size_t i;
+
+	for (i = 0; i < ARRAY_SIZE(arch_names); i++) {
+		printf(i == 0? "  ":", ");
+		printf("%s", arch_names[i].name);
+	}
+
+	printf("\n");
+}
+
 void print_supported_filetypes(void)
 {
 	int i, number = ARRAY_SIZE(filetypes);
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index 85dfdeb..8bae63e 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -204,6 +204,7 @@
 int parse_elf_to_xip_stage(const struct buffer *input, struct buffer *output,
 				uint32_t *location, const char *ignore_section);
 
+void print_supported_architectures(void);
 void print_supported_filetypes(void);
 
 /* lzma/lzma.c */

-- 
To view, visit https://review.coreboot.org/25590
To unsubscribe, or for help writing mail filters, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I3e7ed67c3bfd928b304c314fcc8e1bea35561662
Gerrit-Change-Number: 25590
Gerrit-PatchSet: 1
Gerrit-Owner: Jonathan Neuschäfer <j.neuschaefer at gmx.net>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180410/b9a6ef9e/attachment.html>


More information about the coreboot-gerrit mailing list