copy.c revision 78320
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
2778320Sobrien#ifndef lint
2878320Sobrienstatic const char rcsid[] =
2978320Sobrien  "$FreeBSD: head/sys/boot/ia64/common/copy.c 78320 2001-06-16 02:12:36Z obrien $";
3078320Sobrien#endif /* not lint */
3178320Sobrien
3277943Sdfr/*
3377943Sdfr * MD primitives supporting placement of module data
3477943Sdfr *
3577943Sdfr * XXX should check load address/size against memory top.
3677943Sdfr */
3777943Sdfr#include <stand.h>
3877943Sdfr
3977943Sdfr#include <efi.h>
4077943Sdfr#include <efilib.h>
4177943Sdfr#include <machine/ia64_cpu.h>
4277943Sdfr
4377943Sdfrint
4477943Sdfrefi_copyin(void *src, vm_offset_t dest, size_t len)
4577943Sdfr{
4678320Sobrien	bcopy(src, (void*) dest, len);
4778320Sobrien	return (len);
4877943Sdfr}
4977943Sdfr
5077943Sdfrint
5177943Sdfrefi_copyout(vm_offset_t src, void *dest, size_t len)
5277943Sdfr{
5378320Sobrien	bcopy((void*) src, dest, len);
5478320Sobrien	return (len);
5577943Sdfr}
5677943Sdfr
5777943Sdfrint
5877943Sdfrefi_readin(int fd, vm_offset_t dest, size_t len)
5977943Sdfr{
6078320Sobrien	return (read(fd, (void*) dest, len));
6177943Sdfr}
62