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