xref: /netbsd-src/sys/arch/sh3/include/param.h (revision b1b36fc1a10b1078c497878e46e52f63a262628f)
1*b1b36fc1Ssimonb /*	$NetBSD: param.h,v 1.26 2021/05/31 14:38:55 simonb Exp $	*/
2aad01611Sagc 
3aad01611Sagc /*-
4f0d2889eSwiz  * Copyright (c) 2002 The NetBSD Foundation, Inc. All rights reserved.
5aad01611Sagc  * Copyright (c) 1990 The Regents of the University of California.
6aad01611Sagc  * All rights reserved.
7aad01611Sagc  *
8aad01611Sagc  * This code is derived from software contributed to Berkeley by
9aad01611Sagc  * William Jolitz.
10aad01611Sagc  *
11aad01611Sagc  * Redistribution and use in source and binary forms, with or without
12aad01611Sagc  * modification, are permitted provided that the following conditions
13aad01611Sagc  * are met:
14aad01611Sagc  * 1. Redistributions of source code must retain the above copyright
15aad01611Sagc  *    notice, this list of conditions and the following disclaimer.
16aad01611Sagc  * 2. Redistributions in binary form must reproduce the above copyright
17aad01611Sagc  *    notice, this list of conditions and the following disclaimer in the
18aad01611Sagc  *    documentation and/or other materials provided with the distribution.
19aad01611Sagc  * 3. Neither the name of the University nor the names of its contributors
20aad01611Sagc  *    may be used to endorse or promote products derived from this software
21aad01611Sagc  *    without specific prior written permission.
22aad01611Sagc  *
23aad01611Sagc  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24aad01611Sagc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25aad01611Sagc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26aad01611Sagc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27aad01611Sagc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28aad01611Sagc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29aad01611Sagc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30aad01611Sagc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31aad01611Sagc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32aad01611Sagc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
33aad01611Sagc  * SUCH DAMAGE.
34aad01611Sagc  *
35aad01611Sagc  *	@(#)param.h	5.8 (Berkeley) 6/28/91
36aad01611Sagc  */
3765363da2Sitojun 
3865363da2Sitojun /*
39f9201a16Such  * SuperH dependent constants.
4065363da2Sitojun  */
4165363da2Sitojun 
425cf2727aSuch #ifndef _SH3_PARAM_H_
435cf2727aSuch #define	_SH3_PARAM_H_
445cf2727aSuch 
45f9201a16Such #if defined(_KERNEL) && !defined(_LOCORE)
461c1e708cSpooka #include <machine/cpu.h>
4765363da2Sitojun #endif
48*b1b36fc1Ssimonb #ifdef _KERNEL_OPT
49*b1b36fc1Ssimonb #include "opt_param.h"
50*b1b36fc1Ssimonb #endif
5165363da2Sitojun 
525cf2727aSuch /* NetBSD/sh3 is 4KB page */
535cf2727aSuch #define	PGSHIFT			12
545cf2727aSuch #define	NBPG			(1 << PGSHIFT)
555cf2727aSuch #define	PGOFSET			(NBPG - 1)
565cf2727aSuch 
57f9201a16Such /*
58f9201a16Such  * u-space.
59f9201a16Such  */
604c6260b9Such #define	UPAGES		3		/* pages of u-area */
6165363da2Sitojun #define	USPACE		(UPAGES * NBPG)	/* total size of u-area */
624c6260b9Such #if UPAGES == 1
634c6260b9Such #error "too small u-area"
644c6260b9Such #elif UPAGES == 2
654c6260b9Such #define	P1_STACK	/* kernel stack is P1-area */
664c6260b9Such #else
674c6260b9Such #undef	P1_STACK	/* kernel stack is P3-area */
684c6260b9Such #endif
6965363da2Sitojun 
7065363da2Sitojun #ifndef MSGBUFSIZE
7165363da2Sitojun #define	MSGBUFSIZE	NBPG		/* default message buffer size */
7265363da2Sitojun #endif
7365363da2Sitojun 
7465363da2Sitojun /*
7565363da2Sitojun  * Constants related to network buffer management.
7605132683Sragge  * MCLBYTES must be no larger than NBPG (the software page size), and,
7765363da2Sitojun  * on machines that exchange pages of input or output buffers with mbuf
7865363da2Sitojun  * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
7965363da2Sitojun  * of the hardware page size.
8065363da2Sitojun  */
81d738f90fSitojun #define	MSIZE		256		/* size of an mbuf */
8265363da2Sitojun 
8365363da2Sitojun #ifndef MCLSHIFT
8465363da2Sitojun #define	MCLSHIFT	11		/* convert bytes to m_buf clusters */
85d9ab16baSsimonb 					/* 2K cluster can hold Ether frame */
8665363da2Sitojun #endif	/* MCLSHIFT */
8765363da2Sitojun 
8865363da2Sitojun #define	MCLBYTES	(1 << MCLSHIFT)	/* size of a m_buf cluster */
8965363da2Sitojun 
9065363da2Sitojun /*
91dded044fSthorpej  * Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
92dded044fSthorpej  * logical pages.
9365363da2Sitojun  */
944c23b30cSpara #define	NKMEMPAGES_MIN_DEFAULT	((16 * 1024 * 1024) >> PAGE_SHIFT)
954c23b30cSpara #define	NKMEMPAGES_MAX_DEFAULT	((128 * 1024 * 1024) >> PAGE_SHIFT)
9665363da2Sitojun 
9723a77a73Sisaki /* Default audio blocksize in msec.  See sys/dev/audio/audio.c */
9823a77a73Sisaki #if defined(_KERNEL)
9923a77a73Sisaki #define	__AUDIO_BLK_MS (40)
10023a77a73Sisaki #endif
10123a77a73Sisaki 
1025cf2727aSuch #endif /* !_SH3_PARAM_H_ */
103