copy.c revision 77943
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 *
2677943Sdfr * $FreeBSD: head/sys/boot/ia64/common/copy.c 77943 2001-06-09 16:49:51Z dfr $
2777943Sdfr */
2877943Sdfr/*
2977943Sdfr * MD primitives supporting placement of module data
3077943Sdfr *
3177943Sdfr * XXX should check load address/size against memory top.
3277943Sdfr */
3377943Sdfr#include <stand.h>
3477943Sdfr
3577943Sdfr#include <efi.h>
3677943Sdfr#include <efilib.h>
3777943Sdfr#include <machine/ia64_cpu.h>
3877943Sdfr
3977943Sdfrint
4077943Sdfrefi_copyin(void *src, vm_offset_t dest, size_t len)
4177943Sdfr{
4277943Sdfr    bcopy(src, (void*) dest, len);
4377943Sdfr    return(len);
4477943Sdfr}
4577943Sdfr
4677943Sdfrint
4777943Sdfrefi_copyout(vm_offset_t src, void *dest, size_t len)
4877943Sdfr{
4977943Sdfr    bcopy((void*) src, dest, len);
5077943Sdfr    return(len);
5177943Sdfr}
5277943Sdfr
5377943Sdfrint
5477943Sdfrefi_readin(int fd, vm_offset_t dest, size_t len)
5577943Sdfr{
5677943Sdfr    return(read(fd, (void*) dest, len));
5777943Sdfr}
5877943Sdfr
5977943Sdfr
60