blob: 277671c09f2d364d3882c390a2b2e4a391733f0e [file] [log] [blame]
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// The BERT collector collects error reports from the Boot Error Record Table
// (as defined in the ACPI spec).
// These are exposed in /sys/firmware/acpi/tables (see path definitions in
// for details), and are useful for debugging firmware
// crashes.
#include <base/files/file_path.h>
#include <base/macros.h>
#include "crash-reporter/crash_collector.h"
#define ACPI_NAME_SIZE 4
#define ACPI_BERT_REGION_STRUCT_SIZE (5 * sizeof(uint32_t))
// BERT (Boot Error Record Table) as defined in ACPI spec, APEI chapter at
struct acpi_table_bert {
char signature[ACPI_NAME_SIZE];
uint32_t length;
uint8_t revision;
uint8_t checksum;
char oem_id[6];
char oem_table_id[8];
uint32_t oem_revision;
char asl_compiler_id[ACPI_NAME_SIZE];
uint32_t asl_compiler_revision;
uint32_t region_length;
uint64_t address;
static_assert(sizeof(acpi_table_bert) == 48,
"acpi_table_bert size is not correct");
// Firmware Error Bert dump collector.
class BERTCollector : public CrashCollector {
BERTCollector(const BERTCollector&) = delete;
BERTCollector& operator=(const BERTCollector&) = delete;
~BERTCollector() override;
// Collect Bert dump.
bool Collect();
friend class BERTCollectorTest;
base::FilePath acpitable_path_;