From owner-svn-src-stable@freebsd.org Sun Sep 25 17:58:56 2016 Return-Path: Delivered-To: svn-src-stable@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id CF4FCBDE494; Sun, 25 Sep 2016 17:58:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 8F0461F36; Sun, 25 Sep 2016 17:58:56 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u8PHwtou035197; Sun, 25 Sep 2016 17:58:55 GMT (envelope-from kib@FreeBSD.org) Received: (from kib@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u8PHwtMo035196; Sun, 25 Sep 2016 17:58:55 GMT (envelope-from kib@FreeBSD.org) Message-Id: <201609251758.u8PHwtMo035196@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kib set sender to kib@FreeBSD.org using -f From: Konstantin Belousov Date: Sun, 25 Sep 2016 17:58:55 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org Subject: svn commit: r306317 - stable/11/sys/boot/efi/loader/arch/amd64 X-SVN-Group: stable-11 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for all the -stable branches of the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 25 Sep 2016 17:58:56 -0000 Author: kib Date: Sun Sep 25 17:58:55 2016 New Revision: 306317 URL: https://svnweb.freebsd.org/changeset/base/306317 Log: MFC r305943: Utilize pmap.h names. Modified: stable/11/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Directory Properties: stable/11/ (props changed) Modified: stable/11/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c ============================================================================== --- stable/11/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Sun Sep 25 17:57:52 2016 (r306316) +++ stable/11/sys/boot/efi/loader/arch/amd64/elf64_freebsd.c Sun Sep 25 17:58:55 2016 (r306317) @@ -35,6 +35,8 @@ __FBSDID("$FreeBSD$"); #include #include #include +#include +#include #include #include @@ -57,8 +59,14 @@ extern int bi_load(char *args, vm_offset static int elf64_exec(struct preloaded_file *amp); static int elf64_obj_exec(struct preloaded_file *amp); -static struct file_format amd64_elf = { elf64_loadfile, elf64_exec }; -static struct file_format amd64_elf_obj = { elf64_obj_loadfile, elf64_obj_exec }; +static struct file_format amd64_elf = { + .l_load = elf64_loadfile, + .l_exec = elf64_exec, +}; +static struct file_format amd64_elf_obj = { + .l_load = elf64_obj_loadfile, + .l_exec = elf64_obj_exec, +}; struct file_format *file_formats[] = { &amd64_elf, @@ -66,21 +74,12 @@ struct file_format *file_formats[] = { NULL }; -#define PG_V 0x001 -#define PG_RW 0x002 -#define PG_U 0x004 -#define PG_PS 0x080 - -typedef u_int64_t p4_entry_t; -typedef u_int64_t p3_entry_t; -typedef u_int64_t p2_entry_t; -static p4_entry_t *PT4; -static p3_entry_t *PT3; -static p2_entry_t *PT2; +static pml4_entry_t *PT4; +static pdp_entry_t *PT3; +static pd_entry_t *PT2; static void (*trampoline)(uint64_t stack, void *copy_finish, uint64_t kernend, - uint64_t modulep, p4_entry_t *pagetable, - uint64_t entry); + uint64_t modulep, pml4_entry_t *pagetable, uint64_t entry); extern uintptr_t amd64_tramp; extern uint32_t amd64_tramp_size; @@ -157,7 +156,7 @@ elf64_exec(struct preloaded_file *fp) bcopy((void *)&amd64_tramp, (void *)trampcode, amd64_tramp_size); trampoline = (void *)trampcode; - PT4 = (p4_entry_t *)0x0000000040000000; + PT4 = (pml4_entry_t *)0x0000000040000000; err = BS->AllocatePages(AllocateMaxAddress, EfiLoaderData, 3, (EFI_PHYSICAL_ADDRESS *)&PT4); bzero(PT4, 3 * EFI_PAGE_SIZE); @@ -172,11 +171,11 @@ elf64_exec(struct preloaded_file *fp) */ for (i = 0; i < 512; i++) { /* Each slot of the L4 pages points to the same L3 page. */ - PT4[i] = (p4_entry_t)PT3; + PT4[i] = (pml4_entry_t)PT3; PT4[i] |= PG_V | PG_RW | PG_U; /* Each slot of the L3 pages points to the same L2 page. */ - PT3[i] = (p3_entry_t)PT2; + PT3[i] = (pdp_entry_t)PT2; PT3[i] |= PG_V | PG_RW | PG_U; /* The L2 page slots are mapped with 2MB pages for 1GB. */ @@ -204,5 +203,6 @@ elf64_exec(struct preloaded_file *fp) static int elf64_obj_exec(struct preloaded_file *fp) { + return (EFTYPE); }