From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andy Shevchenko Date: Fri, 3 Apr 2020 16:39:39 +0300 Subject: [PATCH v3 29/29] acpi: Add an acpi command In-Reply-To: <20200330171226.v3.29.Ia4301e60eeaa06de172c4c6aaf5c6bdda81c0d77@changeid> References: <20200330231305.130488-1-sjg@chromium.org> <20200330171226.v3.29.Ia4301e60eeaa06de172c4c6aaf5c6bdda81c0d77@changeid> Message-ID: <20200403133939.GL3676135@smile.fi.intel.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Mar 30, 2020 at 05:13:05PM -0600, Simon Glass wrote: > It is useful to dump ACPI tables in U-Boot to see what has been generated. > Add a command to handle this. > > To allow the command to find the tables, add a position into the global > data. > > Support subcommands to list and dump the tables. ... > +static void dump_hdr(struct acpi_table_header *hdr) > +{ > + bool has_hdr = memcmp(hdr->signature, "FACS", ACPI_NAME_LEN); I believe more than one table has the same header structure. Either this function is incorrectly called (should be dump_facs_hdr() or alike), or you need to make it better, i.e. generic. > + printf("%.*s %08lx %06x", ACPI_NAME_LEN, hdr->signature, > + (ulong)map_to_sysmem(hdr), hdr->length); > + if (has_hdr) { > + printf(" (v%02d %.6s %.8s %u %.4s %d)\n", hdr->revision, > + hdr->oem_id, hdr->oem_table_id, hdr->oem_revision, > + hdr->aslc_id, hdr->aslc_revision); > + } else { > + printf("\n"); > + } > +} -- With Best Regards, Andy Shevchenko