From owner-svn-src-head@FreeBSD.ORG Thu Jun 11 14:02:24 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 63D0B62F; Thu, 11 Jun 2015 14:02:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 37D4116C1; Thu, 11 Jun 2015 14:02:24 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t5BE2Ovr084292; Thu, 11 Jun 2015 14:02:24 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t5BE2OZA084291; Thu, 11 Jun 2015 14:02:24 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201506111402.t5BE2OZA084291@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Thu, 11 Jun 2015 14:02:24 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r284266 - head/sys/boot/efi/loader/arch/arm64 X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Jun 2015 14:02:24 -0000 Author: andrew Date: Thu Jun 11 14:02:23 2015 New Revision: 284266 URL: https://svnweb.freebsd.org/changeset/base/284266 Log: Pass the ACPI table pointer to the arm64 kernel from loader.efi. Sponsored by: The FreeBSD Foundation Modified: head/sys/boot/efi/loader/arch/arm64/exec.c Modified: head/sys/boot/efi/loader/arch/arm64/exec.c ============================================================================== --- head/sys/boot/efi/loader/arch/arm64/exec.c Thu Jun 11 13:58:40 2015 (r284265) +++ head/sys/boot/efi/loader/arch/arm64/exec.c Thu Jun 11 14:02:23 2015 (r284266) @@ -42,6 +42,15 @@ __FBSDID("$FreeBSD$"); #include "loader_efi.h" #include "cache.h" +#include "platform/acfreebsd.h" +#include "acconfig.h" +#define ACPI_SYSTEM_XFACE +#include "actypes.h" +#include "actbl.h" + +static EFI_GUID acpi_guid = ACPI_TABLE_GUID; +static EFI_GUID acpi20_guid = ACPI_20_TABLE_GUID; + static int elf64_exec(struct preloaded_file *amp); static int elf64_obj_exec(struct preloaded_file *amp); @@ -64,12 +73,41 @@ elf64_exec(struct preloaded_file *fp) vm_offset_t clean_addr; size_t clean_size; struct file_metadata *md; + ACPI_TABLE_RSDP *rsdp; EFI_STATUS status; EFI_PHYSICAL_ADDRESS addr; Elf_Ehdr *ehdr; - int err; + char buf[24]; + int err, revision; void (*entry)(vm_offset_t); + rsdp = efi_get_table(&acpi20_guid); + if (rsdp == NULL) { + rsdp = efi_get_table(&acpi_guid); + } + if (rsdp != NULL) { + sprintf(buf, "0x%016llx", (unsigned long long)rsdp); + setenv("hint.acpi.0.rsdp", buf, 1); + revision = rsdp->Revision; + if (revision == 0) + revision = 1; + sprintf(buf, "%d", revision); + setenv("hint.acpi.0.revision", buf, 1); + strncpy(buf, rsdp->OemId, sizeof(rsdp->OemId)); + buf[sizeof(rsdp->OemId)] = '\0'; + setenv("hint.acpi.0.oem", buf, 1); + sprintf(buf, "0x%016x", rsdp->RsdtPhysicalAddress); + setenv("hint.acpi.0.rsdt", buf, 1); + if (revision >= 2) { + /* XXX extended checksum? */ + sprintf(buf, "0x%016llx", + (unsigned long long)rsdp->XsdtPhysicalAddress); + setenv("hint.acpi.0.xsdt", buf, 1); + sprintf(buf, "%d", rsdp->Length); + setenv("hint.acpi.0.xsdt_length", buf, 1); + } + } + if ((md = file_findmetadata(fp, MODINFOMD_ELFHDR)) == NULL) return(EFTYPE);