aml-build.c (d8a4b4c3b4dd258c5f5f6237473349d377ea7fc9) aml-build.c (a82fe82916432091ca6fcbd7f357cccf35f6e80d)
1/* Support for generating ACPI tables and passing them to Guests
2 *
3 * Copyright (C) 2015 Red Hat Inc
4 *
5 * Author: Michael S. Tsirkin <mst@redhat.com>
6 * Author: Igor Mammedov <imammedo@redhat.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 1940 unchanged lines hidden (view full) ---

1949 build_append_int_noprefix(table_data, segment, 2);
1950 /* PCI Bus Device Function */
1951 build_append_int_noprefix(table_data, bus, 1);
1952 build_append_int_noprefix(table_data, devfn, 1);
1953 /* Reserved */
1954 build_append_int_noprefix(table_data, 0, 12);
1955}
1956
1/* Support for generating ACPI tables and passing them to Guests
2 *
3 * Copyright (C) 2015 Red Hat Inc
4 *
5 * Author: Michael S. Tsirkin <mst@redhat.com>
6 * Author: Igor Mammedov <imammedo@redhat.com>
7 *
8 * This program is free software; you can redistribute it and/or modify

--- 1940 unchanged lines hidden (view full) ---

1949 build_append_int_noprefix(table_data, segment, 2);
1950 /* PCI Bus Device Function */
1951 build_append_int_noprefix(table_data, bus, 1);
1952 build_append_int_noprefix(table_data, devfn, 1);
1953 /* Reserved */
1954 build_append_int_noprefix(table_data, 0, 12);
1955}
1956
1957static void build_append_srat_acpi_device_handle(GArray *table_data,
1958 const char *hid,
1959 uint32_t uid)
1960{
1961 assert(strlen(hid) == 8);
1962 /* Device Handle - ACPI */
1963 for (int i = 0; i < sizeof(hid); i++) {
1964 build_append_int_noprefix(table_data, hid[i], 1);
1965 }
1966 build_append_int_noprefix(table_data, uid, 4);
1967 build_append_int_noprefix(table_data, 0, 4);
1968}
1969
1957/*
1958 * ACPI spec, Revision 6.3
1959 * 5.2.16.6 Generic Initiator Affinity Structure
1960 * With PCI Device Handle.
1961 */
1962void build_srat_pci_generic_initiator(GArray *table_data, int node,
1963 uint16_t segment, uint8_t bus,
1964 uint8_t devfn)

--- 12 unchanged lines hidden (view full) ---

1977 build_append_srat_pci_device_handle(table_data, segment, bus, devfn);
1978 /* Flags - GI Enabled */
1979 build_append_int_noprefix(table_data, 1, 4);
1980 /* Reserved */
1981 build_append_int_noprefix(table_data, 0, 4);
1982}
1983
1984/*
1970/*
1971 * ACPI spec, Revision 6.3
1972 * 5.2.16.6 Generic Initiator Affinity Structure
1973 * With PCI Device Handle.
1974 */
1975void build_srat_pci_generic_initiator(GArray *table_data, int node,
1976 uint16_t segment, uint8_t bus,
1977 uint8_t devfn)

--- 12 unchanged lines hidden (view full) ---

1990 build_append_srat_pci_device_handle(table_data, segment, bus, devfn);
1991 /* Flags - GI Enabled */
1992 build_append_int_noprefix(table_data, 1, 4);
1993 /* Reserved */
1994 build_append_int_noprefix(table_data, 0, 4);
1995}
1996
1997/*
1998 * ACPI spec, Revision 6.5
1999 * 5.2.16.7 Generic Port Affinity Structure
2000 * With ACPI Device Handle.
2001 */
2002void build_srat_acpi_generic_port(GArray *table_data, uint32_t node,
2003 const char *hid, uint32_t uid)
2004{
2005 /* Type */
2006 build_append_int_noprefix(table_data, 6, 1);
2007 /* Length */
2008 build_append_int_noprefix(table_data, 32, 1);
2009 /* Reserved */
2010 build_append_int_noprefix(table_data, 0, 1);
2011 /* Device Handle Type: ACPI */
2012 build_append_int_noprefix(table_data, 0, 1);
2013 /* Proximity Domain */
2014 build_append_int_noprefix(table_data, node, 4);
2015 /* Device Handle */
2016 build_append_srat_acpi_device_handle(table_data, hid, uid);
2017 /* Flags - GP Enabled */
2018 build_append_int_noprefix(table_data, 1, 4);
2019 /* Reserved */
2020 build_append_int_noprefix(table_data, 0, 4);
2021}
2022
2023/*
1985 * ACPI spec 5.2.17 System Locality Distance Information Table
1986 * (Revision 2.0 or later)
1987 */
1988void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms,
1989 const char *oem_id, const char *oem_table_id)
1990{
1991 int i, j;
1992 int nb_numa_nodes = ms->numa_state->num_nodes;

--- 573 unchanged lines hidden ---
2024 * ACPI spec 5.2.17 System Locality Distance Information Table
2025 * (Revision 2.0 or later)
2026 */
2027void build_slit(GArray *table_data, BIOSLinker *linker, MachineState *ms,
2028 const char *oem_id, const char *oem_table_id)
2029{
2030 int i, j;
2031 int nb_numa_nodes = ms->numa_state->num_nodes;

--- 573 unchanged lines hidden ---