Revision 979e7ea7ebf86e40c97c62aa3aa2f4a4611e6697 authored by Michael Walle on 09 January 2018, 17:01:13 UTC, committed by Michael Roth on 21 June 2018, 01:45:03 UTC
Writing to these registers may raise an interrupt request. Actually, this prevents the milkymist board from starting. Cc: qemu-stable@nongnu.org Signed-off-by: Michael Walle <michael@walle.cc> Tested-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> (cherry picked from commit 81e9cbd0ca1131012b058df6804b1f626a6b730c) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
1 parent 15fb5db
acpi-utils.c
/*
* ACPI Utility Functions
*
* Copyright (c) 2013 Red Hat Inc.
* Copyright (c) 2017 Skyport Systems
*
* Authors:
* Michael S. Tsirkin <mst@redhat.com>,
* Ben Warren <ben@skyportsystems.com>
*
* This work is licensed under the terms of the GNU GPL, version 2 or later.
* See the COPYING file in the top-level directory.
*/
#include "qemu/osdep.h"
#include <glib/gstdio.h>
#include "qemu-common.h"
#include "hw/smbios/smbios.h"
#include "qemu/bitmap.h"
#include "acpi-utils.h"
#include "boot-sector.h"
uint8_t acpi_calc_checksum(const uint8_t *data, int len)
{
int i;
uint8_t sum = 0;
for (i = 0; i < len; i++) {
sum += data[i];
}
return sum;
}
uint32_t acpi_find_rsdp_address(void)
{
uint32_t off;
/* RSDP location can vary across a narrow range */
for (off = 0xf0000; off < 0x100000; off += 0x10) {
uint8_t sig[] = "RSD PTR ";
int i;
for (i = 0; i < sizeof sig - 1; ++i) {
sig[i] = readb(off + i);
}
if (!memcmp(sig, "RSD PTR ", sizeof sig)) {
break;
}
}
return off;
}
void acpi_parse_rsdp_table(uint32_t addr, AcpiRsdpDescriptor *rsdp_table)
{
ACPI_READ_FIELD(rsdp_table->signature, addr);
ACPI_ASSERT_CMP64(rsdp_table->signature, "RSD PTR ");
ACPI_READ_FIELD(rsdp_table->checksum, addr);
ACPI_READ_ARRAY(rsdp_table->oem_id, addr);
ACPI_READ_FIELD(rsdp_table->revision, addr);
ACPI_READ_FIELD(rsdp_table->rsdt_physical_address, addr);
ACPI_READ_FIELD(rsdp_table->length, addr);
}
Computing file changes ...