copy.c revision 138141
177943Sdfr/*-
277943Sdfr * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
377943Sdfr * All rights reserved.
477943Sdfr *
577943Sdfr * Redistribution and use in source and binary forms, with or without
677943Sdfr * modification, are permitted provided that the following conditions
777943Sdfr * are met:
877943Sdfr * 1. Redistributions of source code must retain the above copyright
977943Sdfr *    notice, this list of conditions and the following disclaimer.
1077943Sdfr * 2. Redistributions in binary form must reproduce the above copyright
1177943Sdfr *    notice, this list of conditions and the following disclaimer in the
1277943Sdfr *    documentation and/or other materials provided with the distribution.
1377943Sdfr *
1477943Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1577943Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1677943Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1777943Sdfr * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1877943Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1977943Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2077943Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2177943Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2277943Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2377943Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2477943Sdfr * SUCH DAMAGE.
2577943Sdfr */
2678320Sobrien
27113038Sobrien#include <sys/cdefs.h>
28113038Sobrien__FBSDID("$FreeBSD: head/sys/boot/ia64/common/copy.c 138141 2004-11-28 00:30:22Z marcel $");
2978320Sobrien
3077943Sdfr#include <efi.h>
3177943Sdfr#include <efilib.h>
32138141Smarcel#include <stand.h>
3377943Sdfr
3477943Sdfrint
35138141Smarcelefi_copyin(void *src, vm_offset_t va, size_t len)
3677943Sdfr{
37138141Smarcel
38138141Smarcel	bcopy(src, (void *)efimd_va2pa(va), len);
3978320Sobrien	return (len);
4077943Sdfr}
4177943Sdfr
4277943Sdfrint
43138141Smarcelefi_copyout(vm_offset_t va, void *dst, size_t len)
4477943Sdfr{
45138141Smarcel
46138141Smarcel	bcopy((void *)efimd_va2pa(va), dst, len);
4778320Sobrien	return (len);
4877943Sdfr}
4977943Sdfr
5077943Sdfrint
51138141Smarcelefi_readin(int fd, vm_offset_t va, size_t len)
5277943Sdfr{
53138141Smarcel
54138141Smarcel	return (read(fd, (void *)efimd_va2pa(va), len));
5577943Sdfr}
56