From owner-svn-src-user@FreeBSD.ORG Sat May 4 23:33:55 2013 Return-Path: Delivered-To: svn-src-user@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 3D71017D; Sat, 4 May 2013 23:33:55 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 2DBA46BD; Sat, 4 May 2013 23:33:55 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r44NXtho099742; Sat, 4 May 2013 23:33:55 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r44NXtLc099741; Sat, 4 May 2013 23:33:55 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <201305042333.r44NXtLc099741@svn.freebsd.org> From: Attilio Rao Date: Sat, 4 May 2013 23:33:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-user@freebsd.org Subject: svn commit: r250260 - user/attilio/jeff-numa/sys/x86/acpica X-SVN-Group: user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-user@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the experimental " user" src tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 04 May 2013 23:33:55 -0000 Author: attilio Date: Sat May 4 23:33:54 2013 New Revision: 250260 URL: http://svnweb.freebsd.org/changeset/base/250260 Log: Add code to correctly parse and display ACPI SLIT (System Locality Information Table). Sponsored by: EMC / Isilon storage division Obtained from: jeff Modified: user/attilio/jeff-numa/sys/x86/acpica/srat.c Modified: user/attilio/jeff-numa/sys/x86/acpica/srat.c ============================================================================== --- user/attilio/jeff-numa/sys/x86/acpica/srat.c Sat May 4 22:50:15 2013 (r250259) +++ user/attilio/jeff-numa/sys/x86/acpica/srat.c Sat May 4 23:33:54 2013 (r250260) @@ -331,6 +331,48 @@ srat_walk_table(acpi_subtable_handler *h acpi_walk_subtables(srat + 1, (char *)srat + srat->Header.Length, handler, arg); } + +static void +acpi_handle_slit(ACPI_TABLE_SLIT *slit) +{ + UINT64 i, j; + + printf("ACPI System Locality Information Table: %ju localities\n", + (uintmax_t)slit->LocalityCount); + printf(" "); + for (i = 0; i < slit->LocalityCount; i++) + printf(" %3ju", (uintmax_t)i); + printf("\n +"); + for (i = 0; i < slit->LocalityCount; i++) + printf("----"); + printf("\n"); + for (i = 0; i < slit->LocalityCount; i++) { + printf(" %3ju |", (uintmax_t)i); + for (j = 0; j < slit->LocalityCount; j++) + printf(" %3u", + slit->Entry[i * slit->LocalityCount + j]); + printf("\n"); + } +} + +static void +parse_slit(void *arg __unused) +{ + ACPI_TABLE_SLIT *slit; + vm_paddr_t slit_physaddr; + + if (resource_disabled("slit", 0)) + return; + + slit_physaddr = acpi_find_table(ACPI_SIG_SLIT); + if (slit_physaddr == 0) + return; + slit = acpi_map_table(slit_physaddr, ACPI_SIG_SLIT); + acpi_handle_slit(slit); + acpi_unmap_table(slit); +} + +SYSINIT(parse_slit, SI_SUB_VM - 1, SI_ORDER_SECOND, parse_slit, NULL); /* * Setup per-CPU ACPI IDs.