Mon Jul 19 10:28:58 2021 UTC ()
Remove definitions for CACHE_LINE_SIZE and COHERENCY_UNIT which are the same
as the default.


(christos)
diff -r1.49 -r1.50 src/sys/arch/alpha/include/param.h
diff -r1.23 -r1.24 src/sys/arch/arm/include/param.h
diff -r1.5 -r1.6 src/sys/arch/riscv/include/param.h

cvs diff -r1.49 -r1.50 src/sys/arch/alpha/include/param.h (switch to unified diff)

--- src/sys/arch/alpha/include/param.h 2021/07/06 12:20:52 1.49
+++ src/sys/arch/alpha/include/param.h 2021/07/19 10:28:58 1.50
@@ -1,131 +1,129 @@ @@ -1,131 +1,129 @@
1/* $NetBSD: param.h,v 1.49 2021/07/06 12:20:52 thorpej Exp $ */ 1/* $NetBSD: param.h,v 1.50 2021/07/19 10:28:58 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1992, 1993 5 * Copyright (c) 1992, 1993
6 * The Regents of the University of California. All rights reserved. 6 * The Regents of the University of California. All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department and Ralph Campbell. 10 * Science Department and Ralph Campbell.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
15 * 1. Redistributions of source code must retain the above copyright 15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions and the following disclaimer. 16 * notice, this list of conditions and the following disclaimer.
17 * 2. Redistributions in binary form must reproduce the above copyright 17 * 2. Redistributions in binary form must reproduce the above copyright
18 * notice, this list of conditions and the following disclaimer in the 18 * notice, this list of conditions and the following disclaimer in the
19 * documentation and/or other materials provided with the distribution. 19 * documentation and/or other materials provided with the distribution.
20 * 3. Neither the name of the University nor the names of its contributors 20 * 3. Neither the name of the University nor the names of its contributors
21 * may be used to endorse or promote products derived from this software 21 * may be used to endorse or promote products derived from this software
22 * without specific prior written permission. 22 * without specific prior written permission.
23 * 23 *
24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 24 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 25 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 27 * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 28 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 29 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 30 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 31 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 32 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 33 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 * SUCH DAMAGE. 34 * SUCH DAMAGE.
35 * 35 *
36 * from: Utah $Hdr: machparam.h 1.11 89/08/14$ 36 * from: Utah $Hdr: machparam.h 1.11 89/08/14$
37 * 37 *
38 * @(#)param.h 8.1 (Berkeley) 6/10/93 38 * @(#)param.h 8.1 (Berkeley) 6/10/93
39 */ 39 */
40 40
41#ifdef _KERNEL_OPT 41#ifdef _KERNEL_OPT
42#include "opt_param.h" 42#include "opt_param.h"
43#endif 43#endif
44 44
45/* 45/*
46 * Machine dependent constants for the Alpha. 46 * Machine dependent constants for the Alpha.
47 */ 47 */
48#define _MACHINE alpha 48#define _MACHINE alpha
49#define MACHINE "alpha" 49#define MACHINE "alpha"
50#define _MACHINE_ARCH alpha 50#define _MACHINE_ARCH alpha
51#define MACHINE_ARCH "alpha" 51#define MACHINE_ARCH "alpha"
52#define MID_MACHINE MID_ALPHA 52#define MID_MACHINE MID_ALPHA
53 53
54#ifdef _KERNEL 54#ifdef _KERNEL
55#include <machine/cpu.h> 55#include <machine/cpu.h>
56#else 56#else
57#define ALPHA_PGSHIFT 13 57#define ALPHA_PGSHIFT 13
58#endif 58#endif
59 59
60/* 60/*
61 * Compiler assumes 16 byte stack alignment, per recommendation of 61 * Compiler assumes 16 byte stack alignment, per recommendation of
62 * Alpha Architecture Handbook. 62 * Alpha Architecture Handbook.
63 */ 63 */
64#define STACK_ALIGNBYTES (16 - 1) 64#define STACK_ALIGNBYTES (16 - 1)
65 65
66#define NBPG (1 << ALPHA_PGSHIFT) /* bytes/page */ 66#define NBPG (1 << ALPHA_PGSHIFT) /* bytes/page */
67#define PGOFSET (NBPG-1) /* byte off. into pg */ 67#define PGOFSET (NBPG-1) /* byte off. into pg */
68#define PGSHIFT ALPHA_PGSHIFT /* LOG2(NBPG) */ 68#define PGSHIFT ALPHA_PGSHIFT /* LOG2(NBPG) */
69 69
70#define KERNBASE 0xfffffc0000a00000 /* start of kernel virtual */ 70#define KERNBASE 0xfffffc0000a00000 /* start of kernel virtual */
71#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT) 71#define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
72 72
73#define SSIZE 1 /* initial stack size/NBPG */ 73#define SSIZE 1 /* initial stack size/NBPG */
74#define SINCR 1 /* increment of stack/NBPG */ 74#define SINCR 1 /* increment of stack/NBPG */
75 75
76#define UPAGES 2 /* pages of u-area */ 76#define UPAGES 2 /* pages of u-area */
77#define USPACE (UPAGES * NBPG) /* total size of u-area */ 77#define USPACE (UPAGES * NBPG) /* total size of u-area */
78 78
79#ifndef MSGBUFSIZE 79#ifndef MSGBUFSIZE
80#define MSGBUFSIZE NBPG /* default message buffer size */ 80#define MSGBUFSIZE NBPG /* default message buffer size */
81#endif 81#endif
82 82
83/* 83/*
84 * EV4 (21064) and EV5 (21164) have a 32-byte cache line size. 84 * EV4 (21064) and EV5 (21164) have a 32-byte cache line size.
85 * EV6 (21264) and EV7 (21364) have a 64-byte cache line size. 85 * EV6 (21264) and EV7 (21364) have a 64-byte cache line size.
86 */ 86 */
87#define COHERENCY_UNIT 64 
88#define CACHE_LINE_SIZE 64 
89 87
90/* 88/*
91 * Constants related to network buffer management. 89 * Constants related to network buffer management.
92 * MCLBYTES must be no larger than NBPG (the software page size), and, 90 * MCLBYTES must be no larger than NBPG (the software page size), and,
93 * on machines that exchange pages of input or output buffers with mbuf 91 * on machines that exchange pages of input or output buffers with mbuf
94 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 92 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
95 * of the hardware page size. 93 * of the hardware page size.
96 */ 94 */
97#define MSIZE 256 /* size of an mbuf */ 95#define MSIZE 256 /* size of an mbuf */
98 96
99#ifndef MCLSHIFT 97#ifndef MCLSHIFT
100#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 98#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
101 /* 2K cluster can hold Ether frame */ 99 /* 2K cluster can hold Ether frame */
102#endif /* MCLSHIFT */ 100#endif /* MCLSHIFT */
103 101
104#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 102#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
105 103
106/* 104/*
107 * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized 105 * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
108 * logical pages. 106 * logical pages.
109 * No enforced maximum on alpha 107 * No enforced maximum on alpha
110 */ 108 */
111#define NKMEMPAGES_MIN_DEFAULT ((16 * 1024 * 1024) >> PAGE_SHIFT) 109#define NKMEMPAGES_MIN_DEFAULT ((16 * 1024 * 1024) >> PAGE_SHIFT)
112#define NKMEMPAGES_MAX_UNLIMITED 1 110#define NKMEMPAGES_MAX_UNLIMITED 1
113 111
114/* 112/*
115 * Mach derived conversion macros 113 * Mach derived conversion macros
116 */ 114 */
117#define alpha_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG-1)) 115#define alpha_round_page(x) ((((unsigned long)(x)) + NBPG - 1) & ~(NBPG-1))
118#define alpha_trunc_page(x) ((unsigned long)(x) & ~(NBPG-1)) 116#define alpha_trunc_page(x) ((unsigned long)(x) & ~(NBPG-1))
119#define alpha_btop(x) ((unsigned long)(x) >> PGSHIFT) 117#define alpha_btop(x) ((unsigned long)(x) >> PGSHIFT)
120#define alpha_ptob(x) ((unsigned long)(x) << PGSHIFT) 118#define alpha_ptob(x) ((unsigned long)(x) << PGSHIFT)
121 119
122#ifdef _KERNEL 120#ifdef _KERNEL
123#ifndef _LOCORE 121#ifndef _LOCORE
124 122
125#include <machine/intr.h> 123#include <machine/intr.h>
126 124
127void delay(unsigned long); 125void delay(unsigned long);
128#define DELAY(n) delay(n) 126#define DELAY(n) delay(n)
129 127
130#endif 128#endif
131#endif /* !_KERNEL */ 129#endif /* !_KERNEL */

cvs diff -r1.23 -r1.24 src/sys/arch/arm/include/param.h (switch to unified diff)

--- src/sys/arch/arm/include/param.h 2020/08/16 09:37:30 1.23
+++ src/sys/arch/arm/include/param.h 2021/07/19 10:28:58 1.24
@@ -1,192 +1,189 @@ @@ -1,192 +1,189 @@
1/* $NetBSD: param.h,v 1.23 2020/08/16 09:37:30 skrll Exp $ */ 1/* $NetBSD: param.h,v 1.24 2021/07/19 10:28:58 christos Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1994,1995 Mark Brinicombe. 4 * Copyright (c) 1994,1995 Mark Brinicombe.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
15 * 3. All advertising materials mentioning features or use of this software 15 * 3. All advertising materials mentioning features or use of this software
16 * must display the following acknowledgement: 16 * must display the following acknowledgement:
17 * This product includes software developed by the RiscBSD team. 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 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 19 * endorse or promote products derived from this software without specific
20 * prior written permission. 20 * prior written permission.
21 * 21 *
22 * THIS SOFTWARE IS PROVIDED BY RISCBSD ``AS IS'' AND ANY EXPRESS OR IMPLIED 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 23 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 24 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
25 * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 25 * IN NO EVENT SHALL RISCBSD OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 28 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 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 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 31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE. 32 * SUCH DAMAGE.
33 */ 33 */
34 34
35#ifndef _ARM_PARAM_H_ 35#ifndef _ARM_PARAM_H_
36#define _ARM_PARAM_H_ 36#define _ARM_PARAM_H_
37 37
38/* 38/*
39 * Machine dependent constants for all ARM processors 39 * Machine dependent constants for all ARM processors
40 */ 40 */
41 41
42/* 42/*
43 * For KERNEL code: 43 * For KERNEL code:
44 * MACHINE must be defined by the individual port. This is so that 44 * MACHINE must be defined by the individual port. This is so that
45 * uname returns the correct thing, etc. 45 * uname returns the correct thing, etc.
46 * 46 *
47 * MACHINE_ARCH may be defined by individual ports as a temporary 47 * MACHINE_ARCH may be defined by individual ports as a temporary
48 * measure while we're finishing the conversion to ELF. 48 * measure while we're finishing the conversion to ELF.
49 * 49 *
50 * For non-KERNEL code: 50 * For non-KERNEL code:
51 * If ELF, MACHINE and MACHINE_ARCH are forced to "arm/armeb". 51 * If ELF, MACHINE and MACHINE_ARCH are forced to "arm/armeb".
52 */ 52 */
53 53
54#if defined(_KERNEL) 54#if defined(_KERNEL)
55# ifndef MACHINE_ARCH /* XXX For now */ 55# ifndef MACHINE_ARCH /* XXX For now */
56# ifndef __ARMEB__ 56# ifndef __ARMEB__
57# ifdef __ARM_EABI__ 57# ifdef __ARM_EABI__
58# define _MACHINE_ARCH earm 58# define _MACHINE_ARCH earm
59# define MACHINE_ARCH "earm" 59# define MACHINE_ARCH "earm"
60# else 60# else
61# define _MACHINE_ARCH arm 61# define _MACHINE_ARCH arm
62# define MACHINE_ARCH "arm" 62# define MACHINE_ARCH "arm"
63# endif 63# endif
64# else 64# else
65# ifdef __ARM_EABI__ 65# ifdef __ARM_EABI__
66# define _MACHINE_ARCH earmeb 66# define _MACHINE_ARCH earmeb
67# define MACHINE_ARCH "earmeb" 67# define MACHINE_ARCH "earmeb"
68# else 68# else
69# define _MACHINE_ARCH armeb 69# define _MACHINE_ARCH armeb
70# define MACHINE_ARCH "armeb" 70# define MACHINE_ARCH "armeb"
71# endif 71# endif
72# endif /* __ARMEB__ */ 72# endif /* __ARMEB__ */
73# endif /* MACHINE_ARCH */ 73# endif /* MACHINE_ARCH */
74#else 74#else
75# undef _MACHINE 75# undef _MACHINE
76# undef MACHINE 76# undef MACHINE
77# undef _MACHINE_ARCH 77# undef _MACHINE_ARCH
78# undef MACHINE_ARCH 78# undef MACHINE_ARCH
79# define _MACHINE arm 79# define _MACHINE arm
80# define MACHINE "arm" 80# define MACHINE "arm"
81# ifndef __ARMEB__ 81# ifndef __ARMEB__
82# ifdef __ARM_EABI__ 82# ifdef __ARM_EABI__
83# ifdef __ARM_PCS_VFP 83# ifdef __ARM_PCS_VFP
84# ifdef _ARM_ARCH_7 84# ifdef _ARM_ARCH_7
85# define _MACHINE_ARCH earmv7hf 85# define _MACHINE_ARCH earmv7hf
86# define MACHINE_ARCH "earmv7hf" 86# define MACHINE_ARCH "earmv7hf"
87# elif defined(_ARM_ARCH_6) 87# elif defined(_ARM_ARCH_6)
88# define _MACHINE_ARCH earmv6hf 88# define _MACHINE_ARCH earmv6hf
89# define MACHINE_ARCH "earmv6hf" 89# define MACHINE_ARCH "earmv6hf"
90# else 90# else
91# define _MACHINE_ARCH earmhf 91# define _MACHINE_ARCH earmhf
92# define MACHINE_ARCH "earmhf" 92# define MACHINE_ARCH "earmhf"
93# endif 93# endif
94# else 94# else
95# ifdef _ARM_ARCH_7 95# ifdef _ARM_ARCH_7
96# define _MACHINE_ARCH earmv7 96# define _MACHINE_ARCH earmv7
97# define MACHINE_ARCH "earmv7" 97# define MACHINE_ARCH "earmv7"
98# elif defined(_ARM_ARCH_6) 98# elif defined(_ARM_ARCH_6)
99# define _MACHINE_ARCH earmv6 99# define _MACHINE_ARCH earmv6
100# define MACHINE_ARCH "earmv6" 100# define MACHINE_ARCH "earmv6"
101# elif !defined(_ARM_ARCH_5T) 101# elif !defined(_ARM_ARCH_5T)
102# define _MACHINE_ARCH earmv4 102# define _MACHINE_ARCH earmv4
103# define MACHINE_ARCH "earmv4" 103# define MACHINE_ARCH "earmv4"
104# else 104# else
105# define _MACHINE_ARCH earm 105# define _MACHINE_ARCH earm
106# define MACHINE_ARCH "earm" 106# define MACHINE_ARCH "earm"
107# endif 107# endif
108# endif 108# endif
109# else 109# else
110# define _MACHINE_ARCH arm 110# define _MACHINE_ARCH arm
111# define MACHINE_ARCH "arm" 111# define MACHINE_ARCH "arm"
112# endif 112# endif
113# else 113# else
114# ifdef __ARM_EABI__ 114# ifdef __ARM_EABI__
115# ifdef __ARM_PCS_VFP 115# ifdef __ARM_PCS_VFP
116# ifdef _ARM_ARCH_7 116# ifdef _ARM_ARCH_7
117# define _MACHINE_ARCH earmv7hfeb 117# define _MACHINE_ARCH earmv7hfeb
118# define MACHINE_ARCH "earmv7hfeb" 118# define MACHINE_ARCH "earmv7hfeb"
119# elif defined(_ARM_ARCH_6) 119# elif defined(_ARM_ARCH_6)
120# define _MACHINE_ARCH earmv6hfeb 120# define _MACHINE_ARCH earmv6hfeb
121# define MACHINE_ARCH "earmv6hfeb" 121# define MACHINE_ARCH "earmv6hfeb"
122# else 122# else
123# define _MACHINE_ARCH earmhfeb 123# define _MACHINE_ARCH earmhfeb
124# define MACHINE_ARCH "earmhfeb" 124# define MACHINE_ARCH "earmhfeb"
125# endif 125# endif
126# else 126# else
127# ifdef _ARM_ARCH_7 127# ifdef _ARM_ARCH_7
128# define _MACHINE_ARCH earmv7eb 128# define _MACHINE_ARCH earmv7eb
129# define MACHINE_ARCH "earmv7eb" 129# define MACHINE_ARCH "earmv7eb"
130# elif defined(_ARM_ARCH_6) 130# elif defined(_ARM_ARCH_6)
131# define _MACHINE_ARCH earmv6eb 131# define _MACHINE_ARCH earmv6eb
132# define MACHINE_ARCH "earmv6eb" 132# define MACHINE_ARCH "earmv6eb"
133# elif !defined(_ARM_ARCH_5T) 133# elif !defined(_ARM_ARCH_5T)
134# define _MACHINE_ARCH earmv4eb 134# define _MACHINE_ARCH earmv4eb
135# define MACHINE_ARCH "earmv4eb" 135# define MACHINE_ARCH "earmv4eb"
136# else 136# else
137# define _MACHINE_ARCH earmeb 137# define _MACHINE_ARCH earmeb
138# define MACHINE_ARCH "earmeb" 138# define MACHINE_ARCH "earmeb"
139# endif 139# endif
140# endif 140# endif
141# else 141# else
142# define _MACHINE_ARCH armeb 142# define _MACHINE_ARCH armeb
143# define MACHINE_ARCH "armeb" 143# define MACHINE_ARCH "armeb"
144# endif 144# endif
145# endif /* __ARMEB__ */ 145# endif /* __ARMEB__ */
146#endif /* !_KERNEL */ 146#endif /* !_KERNEL */
147 147
148#define MAXCPUS 8 148#define MAXCPUS 8
149 149
150#define MID_MACHINE MID_ARM6 150#define MID_MACHINE MID_ARM6
151 151
152/* ARM-specific macro to align a stack pointer (downwards). */ 152/* ARM-specific macro to align a stack pointer (downwards). */
153#define STACK_ALIGNBYTES (8 - 1) 153#define STACK_ALIGNBYTES (8 - 1)
154#ifdef __ARM_EABI__ 154#ifdef __ARM_EABI__
155#define ALIGNBYTES32 3 155#define ALIGNBYTES32 3
156#else 156#else
157#define ALIGNBYTES32 7 157#define ALIGNBYTES32 7
158#endif 158#endif
159 159
160/* 160/*
161 * Constants related to network buffer management. 161 * Constants related to network buffer management.
162 * MCLBYTES must be no larger than NBPG (the software page size), and, 162 * MCLBYTES must be no larger than NBPG (the software page size), and,
163 * on machines that exchange pages of input or output buffers with mbuf 163 * on machines that exchange pages of input or output buffers with mbuf
164 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple 164 * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
165 * of the hardware page size. 165 * of the hardware page size.
166 */ 166 */
167#define MSIZE 256 /* size of an mbuf */ 167#define MSIZE 256 /* size of an mbuf */
168 168
169#ifndef MCLSHIFT 169#ifndef MCLSHIFT
170#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 170#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
171 /* 2K cluster can hold Ether frame */ 171 /* 2K cluster can hold Ether frame */
172#endif /* MCLSHIFT */ 172#endif /* MCLSHIFT */
173 173
174#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 174#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
175 175
176#ifndef NMBCLUSTERS_MAX 176#ifndef NMBCLUSTERS_MAX
177#define NMBCLUSTERS_MAX (0x4000000 / MCLBYTES) /* Limit to 64MB for clusters */ 177#define NMBCLUSTERS_MAX (0x4000000 / MCLBYTES) /* Limit to 64MB for clusters */
178#endif 178#endif
179 179
180/* 180/*
181 * Compatibility /dev/zero mapping. 181 * Compatibility /dev/zero mapping.
182 */ 182 */
183#ifdef _KERNEL 183#ifdef _KERNEL
184#ifdef COMPAT_16 184#ifdef COMPAT_16
185#define COMPAT_ZERODEV(x) (x == makedev(0, _DEV_ZERO_oARM)) 185#define COMPAT_ZERODEV(x) (x == makedev(0, _DEV_ZERO_oARM))
186#endif 186#endif
187#endif /* _KERNEL */ 187#endif /* _KERNEL */
188 188
189#define COHERENCY_UNIT 64 
190#define CACHE_LINE_SIZE 64 
191 
192#endif /* _ARM_PARAM_H_ */ 189#endif /* _ARM_PARAM_H_ */

cvs diff -r1.5 -r1.6 src/sys/arch/riscv/include/param.h (switch to unified diff)

--- src/sys/arch/riscv/include/param.h 2021/05/31 14:38:57 1.5
+++ src/sys/arch/riscv/include/param.h 2021/07/19 10:28:58 1.6
@@ -1,109 +1,106 @@ @@ -1,109 +1,106 @@
1/* $NetBSD: param.h,v 1.5 2021/05/31 14:38:57 simonb Exp $ */ 1/* $NetBSD: param.h,v 1.6 2021/07/19 10:28:58 christos Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2014 The NetBSD Foundation, Inc. 4 * Copyright (c) 2014 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Matt Thomas of 3am Software Foundry. 8 * by Matt Thomas of 3am Software Foundry.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without 10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions 11 * modification, are permitted provided that the following conditions
12 * are met: 12 * are met:
13 * 1. Redistributions of source code must retain the above copyright 13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer. 14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright 15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the 16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution. 17 * documentation and/or other materials provided with the distribution.
18 * 18 *
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE. 29 * POSSIBILITY OF SUCH DAMAGE.
30 */ 30 */
31 31
32#ifndef _RISCV_PARAM_H_ 32#ifndef _RISCV_PARAM_H_
33#define _RISCV_PARAM_H_ 33#define _RISCV_PARAM_H_
34 34
35#ifdef _KERNEL_OPT 35#ifdef _KERNEL_OPT
36#include "opt_param.h" 36#include "opt_param.h"
37#endif 37#endif
38 38
39/* 39/*
40 * Machine dependent constants for all OpenRISC processors 40 * Machine dependent constants for all OpenRISC processors
41 */ 41 */
42 42
43/* 43/*
44 * For KERNEL code: 44 * For KERNEL code:
45 * MACHINE must be defined by the individual port. This is so that 45 * MACHINE must be defined by the individual port. This is so that
46 * uname returns the correct thing, etc. 46 * uname returns the correct thing, etc.
47 * 47 *
48 * For non-KERNEL code: 48 * For non-KERNEL code:
49 * If ELF, MACHINE and MACHINE_ARCH are forced to "or1k/or1k". 49 * If ELF, MACHINE and MACHINE_ARCH are forced to "or1k/or1k".
50 */ 50 */
51 51
52#ifdef _LP64 52#ifdef _LP64
53#define _MACHINE_ARCH riscv64 53#define _MACHINE_ARCH riscv64
54#define MACHINE_ARCH "riscv64" 54#define MACHINE_ARCH "riscv64"
55#define _MACHINE_ARCH32 riscv32 55#define _MACHINE_ARCH32 riscv32
56#define MACHINE_ARCH32 "riscv32" 56#define MACHINE_ARCH32 "riscv32"
57#else 57#else
58#define _MACHINE_ARCH riscv32 58#define _MACHINE_ARCH riscv32
59#define MACHINE_ARCH "riscv32" 59#define MACHINE_ARCH "riscv32"
60#endif 60#endif
61#define _MACHINE riscv 61#define _MACHINE riscv
62#define MACHINE "riscv" 62#define MACHINE "riscv"
63 63
64#define MID_MACHINE MID_RISCV 64#define MID_MACHINE MID_RISCV
65 65
66/* RISCV-specific macro to align a stack pointer (downwards). */ 66/* RISCV-specific macro to align a stack pointer (downwards). */
67#define STACK_ALIGNBYTES (__BIGGEST_ALIGNMENT__ - 1) 67#define STACK_ALIGNBYTES (__BIGGEST_ALIGNMENT__ - 1)
68#define ALIGNBYTES32 __BIGGEST_ALIGNMENT__ 68#define ALIGNBYTES32 __BIGGEST_ALIGNMENT__
69 69
70#define NKMEMPAGES_MAX_DEFAULT (2048UL * 1024 * 1024) 70#define NKMEMPAGES_MAX_DEFAULT (2048UL * 1024 * 1024)
71#define NKMEMPAGES_MIN_DEFAULT (128UL * 1024 * 1024) 71#define NKMEMPAGES_MIN_DEFAULT (128UL * 1024 * 1024)
72 72
73#define PGSHIFT 12 73#define PGSHIFT 12
74#define NBPG (1 << PGSHIFT) 74#define NBPG (1 << PGSHIFT)
75#define PGOFSET (NBPG - 1) 75#define PGOFSET (NBPG - 1)
76 76
77#define UPAGES 2 77#define UPAGES 2
78#define USPACE (UPAGES << PGSHIFT) 78#define USPACE (UPAGES << PGSHIFT)
79#define USPACE_ALIGN NBPG 79#define USPACE_ALIGN NBPG
80 80
81/* 81/*
82 * Constants related to network buffer management. 82 * Constants related to network buffer management.
83 * MCLBYTES must be no larger than NBPG (the software page size), and 83 * MCLBYTES must be no larger than NBPG (the software page size), and
84 * NBPG % MCLBYTES must be zero. 84 * NBPG % MCLBYTES must be zero.
85 */ 85 */
86#define MSIZE 512 /* size of an mbuf */ 86#define MSIZE 512 /* size of an mbuf */
87 87
88#ifndef MCLSHIFT 88#ifndef MCLSHIFT
89#define MCLSHIFT 11 /* convert bytes to m_buf clusters */ 89#define MCLSHIFT 11 /* convert bytes to m_buf clusters */
90 /* 2K cluster can hold Ether frame */ 90 /* 2K cluster can hold Ether frame */
91#endif /* MCLSHIFT */ 91#endif /* MCLSHIFT */
92 92
93#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */ 93#define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
94 94
95#ifndef MSGBUFSIZE 95#ifndef MSGBUFSIZE
96#define MSGBUFSIZE 65536 /* default message buffer size */ 96#define MSGBUFSIZE 65536 /* default message buffer size */
97#endif 97#endif
98 98
99#define COHERENCY_UNIT 64 
100#define CACHE_LINE_SIZE 64 
101 
102#define MAXCPUS 32 99#define MAXCPUS 32
103 100
104#ifdef _KERNEL 101#ifdef _KERNEL
105void delay(unsigned long); 102void delay(unsigned long);
106#define DELAY(x) delay(x) 103#define DELAY(x) delay(x)
107#endif 104#endif
108 105
109#endif /* _RISCV_PARAM_H_ */ 106#endif /* _RISCV_PARAM_H_ */