xref: /openbsd-src/sys/arch/powerpc64/include/param.h (revision 569905a93af9a15cee7b4700af2b6e98927b2179)
1*569905a9Sclaudio /*	$OpenBSD: param.h,v 1.2 2023/12/14 13:26:49 claudio Exp $	*/
213861200Skettenis 
313861200Skettenis /*-
413861200Skettenis  * Copyright (c) 1990 The Regents of the University of California.
513861200Skettenis  * All rights reserved.
613861200Skettenis  *
713861200Skettenis  * This code is derived from software contributed to Berkeley by
813861200Skettenis  * William Jolitz.
913861200Skettenis  *
1013861200Skettenis  * Redistribution and use in source and binary forms, with or without
1113861200Skettenis  * modification, are permitted provided that the following conditions
1213861200Skettenis  * are met:
1313861200Skettenis  * 1. Redistributions of source code must retain the above copyright
1413861200Skettenis  *    notice, this list of conditions and the following disclaimer.
1513861200Skettenis  * 2. Redistributions in binary form must reproduce the above copyright
1613861200Skettenis  *    notice, this list of conditions and the following disclaimer in the
1713861200Skettenis  *    documentation and/or other materials provided with the distribution.
1813861200Skettenis  * 3. Neither the name of the University nor the names of its contributors
1913861200Skettenis  *    may be used to endorse or promote products derived from this software
2013861200Skettenis  *    without specific prior written permission.
2113861200Skettenis  *
2213861200Skettenis  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
2313861200Skettenis  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
2413861200Skettenis  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
2513861200Skettenis  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
2613861200Skettenis  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
2713861200Skettenis  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2813861200Skettenis  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2913861200Skettenis  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
3013861200Skettenis  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
3113861200Skettenis  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
3213861200Skettenis  * SUCH DAMAGE.
3313861200Skettenis  */
3413861200Skettenis 
3513861200Skettenis #ifndef	_MACHINE_PARAM_H_
3613861200Skettenis #define	_MACHINE_PARAM_H_
3713861200Skettenis 
3813861200Skettenis #ifdef _KERNEL
3913861200Skettenis #ifndef _LOCORE
4013861200Skettenis #include <machine/cpu.h>
4113861200Skettenis #endif
4213861200Skettenis #endif
4313861200Skettenis 
4413861200Skettenis #define	_MACHINE	powerpc64
4513861200Skettenis #define	MACHINE		"powerpc64"
4613861200Skettenis #define	_MACHINE_ARCH	powerpc64
4713861200Skettenis #define	MACHINE_ARCH	"powerpc64"
4813861200Skettenis #define	MID_MACHINE	MID_POWERPC64
4913861200Skettenis 
5013861200Skettenis #define	PAGE_SHIFT	12
5113861200Skettenis #define	PAGE_SIZE	(1 << PAGE_SHIFT)
5213861200Skettenis #define	PAGE_MASK	(PAGE_SIZE - 1)
5313861200Skettenis 
5413861200Skettenis #define	KERNBASE	0xffffff8000000000ULL	/* start of kernel virtual space */
5513861200Skettenis 
5613861200Skettenis #ifdef _KERNEL
5713861200Skettenis 
5813861200Skettenis #define	NBPG		PAGE_SIZE		/* bytes/page */
5913861200Skettenis #define	PGSHIFT		PAGE_SHIFT		/* LOG2(PAGE_SIZE) */
6013861200Skettenis #define	PGOFSET		PAGE_MASK		/* byte offset into page */
6113861200Skettenis 
6213861200Skettenis #define	UPAGES		5			/* pages of u-area */
6313861200Skettenis #define	USPACE		(UPAGES * PAGE_SIZE)	/* total size of u-area */
6413861200Skettenis #define	USPACE_ALIGN	0			/* u-area alignment 0-none */
6513861200Skettenis 
6613861200Skettenis #define	NMBCLUSTERS	(64 * 1024)		/* max cluster allocation */
6713861200Skettenis 
6813861200Skettenis #ifndef	MSGBUFSIZE
6913861200Skettenis #define	MSGBUFSIZE	(16 * PAGE_SIZE)	/* default message buffer size */
7013861200Skettenis #endif
7113861200Skettenis 
7213861200Skettenis #define	STACKALIGNBYTES		(32 - 1)
7313861200Skettenis #define	STACKALIGN(p)		((u_long)(p) &~ STACKALIGNBYTES)
7413861200Skettenis 
7513861200Skettenis #define __HAVE_FDT
7613861200Skettenis 
7713861200Skettenis #endif /* _KERNEL */
7813861200Skettenis 
7913861200Skettenis #endif /* _MACHINE_PARAM_H_ */
80