xref: /netbsd-src/sys/arch/arm/include/param.h (revision 975a152cfcdb39ae6e496af647af0c7275ca0b61)
1 /*	$NetBSD: param.h,v 1.18 2013/04/22 07:53:29 matt Exp $	*/
2 
3 /*
4  * Copyright (c) 1994,1995 Mark Brinicombe.
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without
8  * modification, are permitted provided that the following conditions
9  * are met:
10  * 1. Redistributions of source code must retain the above copyright
11  *    notice, this list of conditions and the following disclaimer.
12  * 2. Redistributions in binary form must reproduce the above copyright
13  *    notice, this list of conditions and the following disclaimer in the
14  *    documentation and/or other materials provided with the distribution.
15  * 3. All advertising materials mentioning features or use of this software
16  *    must display the following acknowledgement:
17  *	This product includes software developed by the RiscBSD team.
18  * 4. The name "RiscBSD" nor the name of the author may be used to
19  *    endorse or promote products derived from this software without specific
20  *    prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED
23  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25  * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32  * SUCH DAMAGE.
33  */
34 
35 #ifndef	_ARM_PARAM_H_
36 #define	_ARM_PARAM_H_
37 
38 /*
39  * Machine dependent constants for all ARM processors
40  */
41 
42 /*
43  * For KERNEL code:
44  *	MACHINE must be defined by the individual port.  This is so that
45  *	uname returns the correct thing, etc.
46  *
47  *	MACHINE_ARCH may be defined by individual ports as a temporary
48  *	measure while we're finishing the conversion to ELF.
49  *
50  * For non-KERNEL code:
51  *	If ELF, MACHINE and MACHINE_ARCH are forced to "arm/armeb".
52  */
53 
54 #if defined(_KERNEL)
55 # ifndef MACHINE_ARCH			/* XXX For now */
56 #  ifndef __ARMEB__
57 #   ifdef __ARM_EABI__
58 #    define	_MACHINE_ARCH	earm
59 #    define	MACHINE_ARCH	"earm"
60 #   else
61 #    define	_MACHINE_ARCH	arm
62 #    define	MACHINE_ARCH	"arm"
63 #   endif
64 #  else
65 #   ifdef __ARM_EABI__
66 #    define	_MACHINE_ARCH	earmeb
67 #    define	MACHINE_ARCH	"earmeb"
68 #   else
69 #    define	_MACHINE_ARCH	armeb
70 #    define	MACHINE_ARCH	"armeb"
71 #   endif
72 #  endif /* __ARMEB__ */
73 # endif /* MACHINE_ARCH */
74 #else
75 # undef _MACHINE
76 # undef MACHINE
77 # undef _MACHINE_ARCH
78 # undef MACHINE_ARCH
79 # define	_MACHINE	arm
80 # define	MACHINE		"arm"
81 # ifndef __ARMEB__
82 #  ifdef __ARM_EABI__
83 #   define	_MACHINE_ARCH	earm
84 #   define	MACHINE_ARCH	"earm"
85 #  else
86 #   define	_MACHINE_ARCH	arm
87 #   define	MACHINE_ARCH	"arm"
88 #  endif
89 # else
90 #  ifdef __ARM_EABI__
91 #   define	_MACHINE_ARCH	earmeb
92 #   define	MACHINE_ARCH	"earmeb"
93 #  else
94 #   define	_MACHINE_ARCH	armeb
95 #   define	MACHINE_ARCH	"armeb"
96 #  endif
97 # endif /* __ARMEB__ */
98 #endif /* !_KERNEL */
99 
100 #define	MID_MACHINE	MID_ARM6
101 
102 /* ARM-specific macro to align a stack pointer (downwards). */
103 #define STACK_ALIGNBYTES	(8 - 1)
104 #ifdef __ARM_EABI__
105 #define	ALIGNBYTES32	3
106 #else
107 #define	ALIGNBYTES32	7
108 #endif
109 
110 #define	DEV_BSHIFT	9		/* log2(DEV_BSIZE) */
111 #define	DEV_BSIZE	(1 << DEV_BSHIFT)
112 #define	BLKDEV_IOSIZE	2048
113 
114 #ifndef MAXPHYS
115 #define	MAXPHYS		65536		/* max I/O transfer size */
116 #endif
117 
118 /*
119  * Constants related to network buffer management.
120  * MCLBYTES must be no larger than NBPG (the software page size), and,
121  * on machines that exchange pages of input or output buffers with mbuf
122  * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
123  * of the hardware page size.
124  */
125 #define	MSIZE		256		/* size of an mbuf */
126 
127 #ifndef MCLSHIFT
128 #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
129 					/* 2K cluster can hold Ether frame */
130 #endif	/* MCLSHIFT */
131 
132 #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
133 
134 #ifndef NMBCLUSTERS_MAX
135 #define	NMBCLUSTERS_MAX	(0x2000000 / MCLBYTES)	/* Limit to 64MB for clusters */
136 #endif
137 
138 /*
139  * Compatibility /dev/zero mapping.
140  */
141 #ifdef _KERNEL
142 #ifdef COMPAT_16
143 #define	COMPAT_ZERODEV(x)	(x == makedev(0, _DEV_ZERO_oARM))
144 #endif
145 #endif /* _KERNEL */
146 
147 #endif /* _ARM_PARAM_H_ */
148