xref: /netbsd-src/sys/arch/hpcmips/include/loadfile_machdep.h (revision eb6cc7528a5a7cb93a1d37aa9d3b5a814f13bc58)
1*eb6cc752Sjoerg /* $NetBSD: loadfile_machdep.h,v 1.4 2014/08/06 21:57:49 joerg Exp $ */
2f8bc0014Sigy 
3f8bc0014Sigy /*
4f8bc0014Sigy  * Copyright (c) 2002 The NetBSD Foundation, Inc.
5f8bc0014Sigy  * All rights reserved.
6f8bc0014Sigy  *
7f8bc0014Sigy  * Redistribution and use in source and binary forms, with or without
8f8bc0014Sigy  * modification, are permitted provided that the following conditions
9f8bc0014Sigy  * are met:
10f8bc0014Sigy  * 1. Redistributions of source code must retain the above copyright
11f8bc0014Sigy  *    notice, this list of conditions and the following disclaimer.
12f8bc0014Sigy  * 2. Redistributions in binary form must reproduce the above copyright
13f8bc0014Sigy  *    notice, this list of conditions and the following disclaimer in the
14f8bc0014Sigy  *    documentation and/or other materials provided with the distribution.
15f8bc0014Sigy  *
16f8bc0014Sigy  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
17f8bc0014Sigy  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
18f8bc0014Sigy  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
19f8bc0014Sigy  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
20f8bc0014Sigy  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21f8bc0014Sigy  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22f8bc0014Sigy  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23f8bc0014Sigy  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24f8bc0014Sigy  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25f8bc0014Sigy  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26f8bc0014Sigy  * POSSIBILITY OF SUCH DAMAGE.
27f8bc0014Sigy  */
28f8bc0014Sigy 
29f8bc0014Sigy #define BOOT_ELF32
30f8bc0014Sigy 
31f8bc0014Sigy #define LOAD_KERNEL	(LOAD_ALL & ~LOAD_TEXTA)
32f8bc0014Sigy #define COUNT_KERNEL	(COUNT_ALL & ~COUNT_TEXTA)
33f8bc0014Sigy 
34f8bc0014Sigy #ifdef _STANDALONE
35f8bc0014Sigy 
36f8bc0014Sigy #define LOADADDR(a)		((a) + offset)
37f8bc0014Sigy #define ALIGNENTRY(a)		Error! hpcmips supports ELF only!
38f8bc0014Sigy #define READ(f, b, c)		pread((f), (void *)LOADADDR(b), (c))
39f8bc0014Sigy #define BCOPY(s, d, c)		vpbcopy((s), (void *)LOADADDR(d), (c))
40f8bc0014Sigy #define BZERO(d, c)		pbzero((void *)LOADADDR(d), (c))
41*eb6cc752Sjoerg #define	WARN(a)			do { \
42*eb6cc752Sjoerg 					(void)printf a; \
43*eb6cc752Sjoerg 					if (errno) \
44*eb6cc752Sjoerg 						(void)printf(": %s\n", \
45*eb6cc752Sjoerg 						             strerror(errno)); \
46*eb6cc752Sjoerg 					else \
47*eb6cc752Sjoerg 						(void)printf("\n"); \
48*eb6cc752Sjoerg 				} while(/* CONSTCOND */0)
49f8bc0014Sigy #define PROGRESS(a)		(void) printf a
50f8bc0014Sigy #define ALLOC(a)		alloc(a)
51606bb2caSchristos #define DEALLOC(a, b)		dealloc(a, b)
52f8bc0014Sigy #define OKMAGIC(a)		Error! hpcmips supports ELF only!
53f8bc0014Sigy 
54f8bc0014Sigy #define	vpbcopy bcopy
55f8bc0014Sigy #define	pbzero  bzero
56f8bc0014Sigy #define pread   read
57f8bc0014Sigy 
58f8bc0014Sigy #endif
59