+++ /dev/null
-/* $NetBSD: loadfile_machdep.h,v 1.1 2006/04/07 14:21:18 cherry Exp $ */\r
-\r
-/*-\r
- * Copyright (c) 1998 The NetBSD Foundation, Inc.\r
- * All rights reserved.\r
- *\r
- * This code is derived from software contributed to The NetBSD Foundation\r
- * by Christos Zoulas and Ross Harvey.\r
- *\r
- * Redistribution and use in source and binary forms, with or without\r
- * modification, are permitted provided that the following conditions\r
- * are met:\r
- * 1. Redistributions of source code must retain the above copyright\r
- * notice, this list of conditions and the following disclaimer.\r
- * 2. Redistributions in binary form must reproduce the above copyright\r
- * notice, this list of conditions and the following disclaimer in the\r
- * documentation and/or other materials provided with the distribution.\r
- * 3. All advertising materials mentioning features or use of this software\r
- * must display the following acknowledgement:\r
- * This product includes software developed by the NetBSD\r
- * Foundation, Inc. and its contributors.\r
- * 4. Neither the name of The NetBSD Foundation nor the names of its\r
- * contributors may be used to endorse or promote products derived\r
- * from this software without specific prior written permission.\r
- *\r
- * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS\r
- * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED\r
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\r
- * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS\r
- * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\r
- * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
- * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
- * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\r
- * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\r
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\r
- * POSSIBILITY OF SUCH DAMAGE.\r
- */\r
-\r
-#define BOOT_ELF64\r
-\r
-#define LOAD_KERNEL (LOAD_ALL & ~LOAD_TEXTA)\r
-#define COUNT_KERNEL (COUNT_ALL & ~COUNT_TEXTA)\r
-\r
-#ifndef MD_LOADSEG\r
-/* XXX: Multiple unwind sections are ignored, and the last one found returned... Fixme! */\r
-extern vaddr_t ia64_unwindtab;\r
-extern vsize_t ia64_unwindtablen;\r
-#define MD_LOADSEG(phdr) ((phdr)->p_type == PT_IA_64_UNWIND ? ia64_unwindtab = (phdr)->p_vaddr, ia64_unwindtablen = (phdr)->p_filesz, 1 : 0)\r
-#endif\r
-\r
-#ifdef _STANDALONE\r
-\r
-/* XXX: cherry: This whole thing is glue between the NetBSD pread/vpbcopy etc. etc\r
- * and the FreeBSD kern_pread/bzero etc. etc. Needs to be cleaned up \r
- * after discussion.\r
- */\r
-\r
-#include "bootstrap.h"\r
-\r
-#define LOADADDR(a) ((a) + offset)\r
-#define ALIGNENTRY(a) Error! alpha supports ECOFF and ELF only! /* Fixme: for ia64 */\r
-#define READ(f, b, c) pread((f), LOADADDR(b), (c))\r
-#define BCOPY(s, d, c) vpbcopy((s), LOADADDR(d), (c))\r
-#define BZERO(d, c) pbzero(LOADADDR(d), (c))\r
-#define WARN(a) (void)(printf a, \\r
- printf((errno ? ": %s\n" : "\n"), \\r
- strerror(errno)))\r
-#define PROGRESS(a) (void) printf a\r
-#define ALLOC(a) alloc(a)\r
-#define DEALLOC(a, b) dealloc(a, b)\r
-#define OKMAGIC(a) Error! ia64 supports ELF only!\r
-\r
-\r
-/* XXX: defines below glues NetBSD conventions with bootstrap.h. */\r
-\r
-#define vpbcopy archsw.arch_copyin\r
-#define pbzero kern_bzero\r
-#define pread archsw.arch_readin\r
-\r
-#else\r
-\r
-#define LOADADDR(a) (((u_long)(a)) + offset)\r
-#define ALIGNENTRY(a) ((u_long)(a))\r
-#define READ(f, b, c) read((f), (void *)LOADADDR(b), (c))\r
-#define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c))\r
-#define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c))\r
-#define WARN(a) warn a\r
-#define PROGRESS(a) /* nothing */\r
-#define ALLOC(a) malloc(a)\r
-#define DEALLOC(a, b) free(a)\r
-#define OKMAGIC(a) ((a) == OMAGIC)\r
-\r
-ssize_t vread(int, u_long, u_long *, size_t);\r
-void vcopy(u_long, u_long, u_long *, size_t);\r
-void vzero(u_long, u_long *, size_t);\r
-\r
-#endif\r