1*eb6cc752Sjoerg /* $NetBSD: loadfile_machdep.h,v 1.8 2014/08/06 21:57:51 joerg Exp $ */ 237be92c0Smatt 337be92c0Smatt /*- 437be92c0Smatt * Copyright (c) 1999 The NetBSD Foundation, Inc. 537be92c0Smatt * All rights reserved. 637be92c0Smatt * 737be92c0Smatt * This code is derived from software contributed to The NetBSD Foundation 837be92c0Smatt * by Christos Zoulas. 937be92c0Smatt * 1037be92c0Smatt * Redistribution and use in source and binary forms, with or without 1137be92c0Smatt * modification, are permitted provided that the following conditions 1237be92c0Smatt * are met: 1337be92c0Smatt * 1. Redistributions of source code must retain the above copyright 1437be92c0Smatt * notice, this list of conditions and the following disclaimer. 1537be92c0Smatt * 2. Redistributions in binary form must reproduce the above copyright 1637be92c0Smatt * notice, this list of conditions and the following disclaimer in the 1737be92c0Smatt * documentation and/or other materials provided with the distribution. 1837be92c0Smatt * 1937be92c0Smatt * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 2037be92c0Smatt * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 2137be92c0Smatt * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 2237be92c0Smatt * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 2337be92c0Smatt * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 2437be92c0Smatt * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 2537be92c0Smatt * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 2637be92c0Smatt * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 2737be92c0Smatt * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 2837be92c0Smatt * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 2937be92c0Smatt * POSSIBILITY OF SUCH DAMAGE. 3037be92c0Smatt */ 3137be92c0Smatt 3237be92c0Smatt #ifndef _VAX_LOADFILE_MACHDEP_H_ 3337be92c0Smatt #define _VAX_LOADFILE_MACHDEP_H_ 3437be92c0Smatt 3537be92c0Smatt #define BOOT_AOUT 36e727e3f1Sthorpej #define BOOT_ELF32 3737be92c0Smatt 38015bf594Smatt #define LOAD_KERNEL LOAD_ALL 39015bf594Smatt #define COUNT_KERNEL COUNT_ALL 4037be92c0Smatt 4137be92c0Smatt #define LOADADDR(a) (((u_long)(a)) + offset) 42787f3adbSragge #define ALIGNENTRY(a) (0) 4337be92c0Smatt #define READ(f, b, c) read((f), (void *)LOADADDR(b), (c)) 4437be92c0Smatt #define BCOPY(s, d, c) memcpy((void *)LOADADDR(d), (void *)(s), (c)) 4537be92c0Smatt #define BZERO(d, c) memset((void *)LOADADDR(d), 0, (c)) 46*eb6cc752Sjoerg #define WARN(a) do { \ 47*eb6cc752Sjoerg (void)printf a; \ 48*eb6cc752Sjoerg if (errno) \ 49*eb6cc752Sjoerg (void)printf(": %s\n", \ 50*eb6cc752Sjoerg strerror(errno)); \ 51*eb6cc752Sjoerg else \ 52*eb6cc752Sjoerg (void)printf("\n"); \ 53*eb6cc752Sjoerg } while(/* CONSTCOND */0) 5437be92c0Smatt #define PROGRESS(a) (void) printf a 5537be92c0Smatt #define ALLOC(a) alloc(a) 56606bb2caSchristos #define DEALLOC(a, b) dealloc(a, b) 578e9ff581Smatt #define OKMAGIC(a) ((a) == OMAGIC || (a) == NMAGIC) 5837be92c0Smatt 5937be92c0Smatt #endif /* !_VAX_LOADFILE_MACHDEP_H_ */ 60