xref: /freebsd/sys/x86/acpica/srat.c (revision 685dc743dc3b5645e34836464128e1c0558b404b)
1dd540b46SJohn Baldwin /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3ebf5747bSPedro F. Giffuni  *
4179fa75eSJohn Baldwin  * Copyright (c) 2010 Hudson River Trading LLC
5dd540b46SJohn Baldwin  * Written by: John H. Baldwin <jhb@FreeBSD.org>
6dd540b46SJohn Baldwin  * All rights reserved.
7dd540b46SJohn Baldwin  *
8dd540b46SJohn Baldwin  * Redistribution and use in source and binary forms, with or without
9dd540b46SJohn Baldwin  * modification, are permitted provided that the following conditions
10dd540b46SJohn Baldwin  * are met:
11dd540b46SJohn Baldwin  * 1. Redistributions of source code must retain the above copyright
12dd540b46SJohn Baldwin  *    notice, this list of conditions and the following disclaimer.
13dd540b46SJohn Baldwin  * 2. Redistributions in binary form must reproduce the above copyright
14dd540b46SJohn Baldwin  *    notice, this list of conditions and the following disclaimer in the
15dd540b46SJohn Baldwin  *    documentation and/or other materials provided with the distribution.
16dd540b46SJohn Baldwin  *
17dd540b46SJohn Baldwin  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
18dd540b46SJohn Baldwin  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19dd540b46SJohn Baldwin  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20dd540b46SJohn Baldwin  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
21dd540b46SJohn Baldwin  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22dd540b46SJohn Baldwin  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23dd540b46SJohn Baldwin  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24dd540b46SJohn Baldwin  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25dd540b46SJohn Baldwin  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26dd540b46SJohn Baldwin  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27dd540b46SJohn Baldwin  * SUCH DAMAGE.
28dd540b46SJohn Baldwin  */
29dd540b46SJohn Baldwin 
30dd540b46SJohn Baldwin #include <sys/cdefs.h>
3162d70a81SJohn Baldwin #include "opt_vm.h"
3262d70a81SJohn Baldwin 
33dd540b46SJohn Baldwin #include <sys/param.h>
3483c9dea1SGleb Smirnoff #include <sys/systm.h>
35dd540b46SJohn Baldwin #include <sys/bus.h>
36dd540b46SJohn Baldwin #include <sys/kernel.h>
37dd540b46SJohn Baldwin 
38dd540b46SJohn Baldwin #include <contrib/dev/acpica/include/acpi.h>
39dd540b46SJohn Baldwin 
40fd1f83fbSRoger Pau Monné #include <machine/md_var.h>
41dd540b46SJohn Baldwin 
42dd540b46SJohn Baldwin #include <dev/acpica/acpivar.h>
43dd540b46SJohn Baldwin 
44941646f5SAttilio Rao #if MAXMEMDOM > 1
45a3a61674SJayachandran C. 
46a3a61674SJayachandran C. static void
parse_acpi_tables(void * dummy)47a3a61674SJayachandran C. parse_acpi_tables(void *dummy)
48a3a61674SJayachandran C. {
49a3a61674SJayachandran C. 
50a3a61674SJayachandran C. 	acpi_pxm_init(max_apic_id + 1, cpu_getmaxphyaddr());
51a3a61674SJayachandran C. 	acpi_pxm_parse_tables();
52a3a61674SJayachandran C. 	acpi_pxm_set_mem_locality();
53a3a61674SJayachandran C. }
54415d7ccaSAdrian Chadd SYSINIT(parse_acpi_tables, SI_SUB_VM - 1, SI_ORDER_FIRST, parse_acpi_tables,
55415d7ccaSAdrian Chadd     NULL);
56dd540b46SJohn Baldwin 
57941646f5SAttilio Rao #endif /* MAXMEMDOM > 1 */
58