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