[coreboot-gerrit] Change in coreboot[master]: util/autoport: Adapt logmaker for newer ACPI versions

Patrick Georgi (Code Review) gerrit at coreboot.org
Tue Aug 14 11:52:23 CEST 2018


Patrick Georgi has submitted this change and it was merged. ( https://review.coreboot.org/28054 )

Change subject: util/autoport: Adapt logmaker for newer ACPI versions
......................................................................

util/autoport: Adapt logmaker for newer ACPI versions

acpidump now creates dumps with 4 spaces instead of 2 in front of the hex dump,
so be a bit smarter about the input with regexp.

Tested with X220 autoport logs: Still creates the same coreboot code.

Change-Id: I8d48c09cdff9432f394b350540ea9765fc942781
Signed-off-by: Arthur Heymans <arthur at aheymans.xyz>
Reviewed-on: https://review.coreboot.org/28054
Tested-by: build bot (Jenkins) <no-reply at coreboot.org>
Reviewed-by: Nico Huber <nico.h at gmx.de>
---
M util/autoport/log_reader.go
1 file changed, 4 insertions(+), 1 deletion(-)

Approvals:
  build bot (Jenkins): Verified
  Nico Huber: Looks good to me, approved



diff --git a/util/autoport/log_reader.go b/util/autoport/log_reader.go
index c94d182..d9a687a 100644
--- a/util/autoport/log_reader.go
+++ b/util/autoport/log_reader.go
@@ -6,6 +6,7 @@
 	"fmt"
 	"log"
 	"os"
+	"regexp"
 	"strconv"
 	"strings"
 )
@@ -106,11 +107,13 @@
 	curTable := ""
 	for scanner.Scan() {
 		line := scanner.Text()
+		/* Only supports ACPI tables up to 0x10000 in size, FIXME if needed */
+		is_hexline, _ := regexp.MatchString(" *[0-9A-Fa-f]{4}: ", line)
 		switch {
 		case len(line) >= 6 && line[5] == '@':
 			curTable = line[0:4]
 			Tables[curTable] = make([]byte, 0, 100000)
-		case len(line) > 7 && line[0:2] == "  " && isXDigit(line[2]) && isXDigit(line[3]) && isXDigit(line[4]) && isXDigit(line[5]) && line[6] == ':':
+		case is_hexline:
 			Tables[curTable] = l.AssignHexLine(line, Tables[curTable])
 		}
 	}

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

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I8d48c09cdff9432f394b350540ea9765fc942781
Gerrit-Change-Number: 28054
Gerrit-PatchSet: 5
Gerrit-Owner: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Angel Pons <th3fanbus at gmail.com>
Gerrit-Reviewer: Arthur Heymans <arthur at aheymans.xyz>
Gerrit-Reviewer: Nico Huber <nico.h at gmx.de>
Gerrit-Reviewer: Patrick Georgi <pgeorgi at google.com>
Gerrit-Reviewer: build bot (Jenkins) <no-reply at coreboot.org>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20180814/9caff681/attachment.html>


More information about the coreboot-gerrit mailing list