From owner-svn-src-all@FreeBSD.ORG Sun Mar 22 18:17:56 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id D506E4AA; Sun, 22 Mar 2015 18:17:56 +0000 (UTC) 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 C0F27FA4; Sun, 22 Mar 2015 18:17:56 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2MIHuWx034306; Sun, 22 Mar 2015 18:17:56 GMT (envelope-from andrew@FreeBSD.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2MIHu8v034305; Sun, 22 Mar 2015 18:17:56 GMT (envelope-from andrew@FreeBSD.org) Message-Id: <201503221817.t2MIHu8v034305@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: andrew set sender to andrew@FreeBSD.org using -f From: Andrew Turner Date: Sun, 22 Mar 2015 18:17:56 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280351 - head/sys/boot/amd64/efi X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Mar 2015 18:17:57 -0000 Author: andrew Date: Sun Mar 22 18:17:55 2015 New Revision: 280351 URL: https://svnweb.freebsd.org/changeset/base/280351 Log: Stop calling x86_efi_copyin and x86_efi_getdev directly. This is to help port loader.efi to both 32 and 64-bit ARM where we can use this file with minimal changes. Differential Revision: https://reviews.freebsd.org/D2031 Reviewed by: imp Modified: head/sys/boot/amd64/efi/bootinfo.c Modified: head/sys/boot/amd64/efi/bootinfo.c ============================================================================== --- head/sys/boot/amd64/efi/bootinfo.c Sun Mar 22 17:56:49 2015 (r280350) +++ head/sys/boot/amd64/efi/bootinfo.c Sun Mar 22 18:17:55 2015 (r280351) @@ -114,24 +114,24 @@ bi_copyenv(vm_offset_t start) /* Traverse the environment. */ for (ep = environ; ep != NULL; ep = ep->ev_next) { len = strlen(ep->ev_name); - if (x86_efi_copyin(ep->ev_name, addr, len) != len) + if (archsw.arch_copyin(ep->ev_name, addr, len) != len) break; addr += len; - if (x86_efi_copyin("=", addr, 1) != 1) + if (archsw.arch_copyin("=", addr, 1) != 1) break; addr++; if (ep->ev_value != NULL) { len = strlen(ep->ev_value); - if (x86_efi_copyin(ep->ev_value, addr, len) != len) + if (archsw.arch_copyin(ep->ev_value, addr, len) != len) break; addr += len; } - if (x86_efi_copyin("", addr, 1) != 1) + if (archsw.arch_copyin("", addr, 1) != 1) break; last = ++addr; } - if (x86_efi_copyin("", last++, 1) != 1) + if (archsw.arch_copyin("", last++, 1) != 1) last = start; return(last); } @@ -155,7 +155,7 @@ bi_copyenv(vm_offset_t start) #define COPY32(v, a, c) { \ uint32_t x = (v); \ if (c) \ - x86_efi_copyin(&x, a, sizeof(x)); \ + archsw.arch_copyin(&x, a, sizeof(x)); \ a += sizeof(x); \ } @@ -163,8 +163,8 @@ bi_copyenv(vm_offset_t start) COPY32(t, a, c); \ COPY32(strlen(s) + 1, a, c); \ if (c) \ - x86_efi_copyin(s, a, strlen(s) + 1); \ - a += roundup(strlen(s) + 1, sizeof(uint64_t)); \ + archsw.arch_copyin(s, a, strlen(s) + 1); \ + a += roundup(strlen(s) + 1, sizeof(u_long)); \ } #define MOD_NAME(a, s, c) MOD_STR(MODINFO_NAME, a, s, c) @@ -175,8 +175,8 @@ bi_copyenv(vm_offset_t start) COPY32(t, a, c); \ COPY32(sizeof(s), a, c); \ if (c) \ - x86_efi_copyin(&s, a, sizeof(s)); \ - a += roundup(sizeof(s), sizeof(uint64_t)); \ + archsw.arch_copyin(&s, a, sizeof(s)); \ + a += roundup(sizeof(s), sizeof(u_long)); \ } #define MOD_ADDR(a, s, c) MOD_VAR(MODINFO_ADDR, a, s, c) @@ -186,8 +186,8 @@ bi_copyenv(vm_offset_t start) COPY32(MODINFO_METADATA | mm->md_type, a, c); \ COPY32(mm->md_size, a, c); \ if (c) \ - x86_efi_copyin(mm->md_data, a, mm->md_size); \ - a += roundup(mm->md_size, sizeof(uint64_t)); \ + archsw.arch_copyin(mm->md_data, a, mm->md_size); \ + a += roundup(mm->md_size, sizeof(u_long)); \ } #define MOD_END(a, c) { \ @@ -326,7 +326,7 @@ bi_load(char *args, vm_offset_t *modulep * tested/set by MI code before launching the kernel. */ rootdevname = getenv("rootdev"); - x86_efi_getdev((void**)(&rootdev), rootdevname, NULL); + archsw.arch_getdev((void**)(&rootdev), rootdevname, NULL); if (rootdev == NULL) { printf("Can't determine root device.\n"); return(EINVAL);