loadfile_machdep.h revision 1.3
11.3Schristos/*	$NetBSD: loadfile_machdep.h,v 1.3 2006/01/25 18:28:26 christos Exp $	*/
21.1Ssakamoto
31.1Ssakamoto/*-
41.1Ssakamoto * Copyright (c) 1999 The NetBSD Foundation, Inc.
51.1Ssakamoto * All rights reserved.
61.1Ssakamoto *
71.1Ssakamoto * This code is derived from software contributed to The NetBSD Foundation
81.1Ssakamoto * by Christos Zoulas.
91.1Ssakamoto *
101.1Ssakamoto * Redistribution and use in source and binary forms, with or without
111.1Ssakamoto * modification, are permitted provided that the following conditions
121.1Ssakamoto * are met:
131.1Ssakamoto * 1. Redistributions of source code must retain the above copyright
141.1Ssakamoto *    notice, this list of conditions and the following disclaimer.
151.1Ssakamoto * 2. Redistributions in binary form must reproduce the above copyright
161.1Ssakamoto *    notice, this list of conditions and the following disclaimer in the
171.1Ssakamoto *    documentation and/or other materials provided with the distribution.
181.1Ssakamoto * 3. All advertising materials mentioning features or use of this software
191.1Ssakamoto *    must display the following acknowledgement:
201.1Ssakamoto *        This product includes software developed by the NetBSD
211.1Ssakamoto *        Foundation, Inc. and its contributors.
221.1Ssakamoto * 4. Neither the name of The NetBSD Foundation nor the names of its
231.1Ssakamoto *    contributors may be used to endorse or promote products derived
241.1Ssakamoto *    from this software without specific prior written permission.
251.1Ssakamoto *
261.1Ssakamoto * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
271.1Ssakamoto * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
281.1Ssakamoto * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
291.1Ssakamoto * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
301.1Ssakamoto * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
311.1Ssakamoto * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
321.1Ssakamoto * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
331.1Ssakamoto * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
341.1Ssakamoto * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
351.1Ssakamoto * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
361.1Ssakamoto * POSSIBILITY OF SUCH DAMAGE.
371.1Ssakamoto */
381.1Ssakamoto
391.2Sthorpej#define BOOT_ELF32
401.1Ssakamoto
411.1Ssakamoto#define LOAD_KERNEL	(LOAD_ALL & ~LOAD_TEXTA)
421.1Ssakamoto#define COUNT_KERNEL	(COUNT_ALL & ~COUNT_TEXTA)
431.1Ssakamoto
441.1Ssakamoto#define LOADADDR(a)		(((u_long)(a)) + offset)
451.1Ssakamoto#define ALIGNENTRY(a)		((u_long)(a))
461.1Ssakamoto#define READ(f, b, c)		read((f), (void *)LOADADDR(b), (c))
471.1Ssakamoto#define BCOPY(s, d, c)		memcpy((void *)LOADADDR(d), (void *)(s), (c))
481.1Ssakamoto#define BZERO(d, c)		memset((void *)LOADADDR(d), 0, (c))
491.1Ssakamoto#define	WARN(a)			(void)(printf a, \
501.1Ssakamoto				    printf((errno ? ": %s\n" : "\n"), \
511.1Ssakamoto				    strerror(errno)))
521.1Ssakamoto#define PROGRESS(a)		(void) printf a
531.1Ssakamoto#define ALLOC(a)		alloc(a)
541.3Schristos#define DEALLOC(a, b)		dealloc(a, b)
55