1*569905a9Sclaudio /* $OpenBSD: param.h,v 1.7 2023/12/14 13:26:49 claudio Exp $ */ 2f24071e5Spatrick 3f24071e5Spatrick /*- 4f24071e5Spatrick * Copyright (c) 1990 The Regents of the University of California. 5f24071e5Spatrick * All rights reserved. 6f24071e5Spatrick * 7f24071e5Spatrick * This code is derived from software contributed to Berkeley by 8f24071e5Spatrick * William Jolitz. 9f24071e5Spatrick * 10f24071e5Spatrick * Redistribution and use in source and binary forms, with or without 11f24071e5Spatrick * modification, are permitted provided that the following conditions 12f24071e5Spatrick * are met: 13f24071e5Spatrick * 1. Redistributions of source code must retain the above copyright 14f24071e5Spatrick * notice, this list of conditions and the following disclaimer. 15f24071e5Spatrick * 2. Redistributions in binary form must reproduce the above copyright 16f24071e5Spatrick * notice, this list of conditions and the following disclaimer in the 17f24071e5Spatrick * documentation and/or other materials provided with the distribution. 18f24071e5Spatrick * 3. Neither the name of the University nor the names of its contributors 19f24071e5Spatrick * may be used to endorse or promote products derived from this software 20f24071e5Spatrick * without specific prior written permission. 21f24071e5Spatrick * 22f24071e5Spatrick * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 23f24071e5Spatrick * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 24f24071e5Spatrick * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 25f24071e5Spatrick * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 26f24071e5Spatrick * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 27f24071e5Spatrick * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 28f24071e5Spatrick * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 29f24071e5Spatrick * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 30f24071e5Spatrick * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 31f24071e5Spatrick * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 32f24071e5Spatrick * SUCH DAMAGE. 33f24071e5Spatrick */ 34f24071e5Spatrick 35f24071e5Spatrick #ifndef _MACHINE_PARAM_H_ 36f24071e5Spatrick #define _MACHINE_PARAM_H_ 37f24071e5Spatrick 38f24071e5Spatrick #ifdef _KERNEL 39823a97b9Skettenis #ifndef _LOCORE 40f24071e5Spatrick #include <machine/cpu.h> 41f24071e5Spatrick #endif 42823a97b9Skettenis #endif 43f24071e5Spatrick 44f24071e5Spatrick #define _MACHINE arm64 45f24071e5Spatrick #define MACHINE "arm64" 46f24071e5Spatrick #define _MACHINE_ARCH aarch64 47f24071e5Spatrick #define MACHINE_ARCH "aarch64" 48f24071e5Spatrick #define MID_MACHINE MID_ARM64 49f24071e5Spatrick 50f24071e5Spatrick #define PAGE_SHIFT 12 51758a1a53Sjsg #define PAGE_SIZE (1 << PAGE_SHIFT) 52758a1a53Sjsg #define PAGE_MASK (PAGE_SIZE - 1) 53f24071e5Spatrick 54f24071e5Spatrick #define KERNBASE 0xffffff8000000000ULL /* start of kernel virtual space */ 55f24071e5Spatrick 56f24071e5Spatrick #ifdef _KERNEL 57f24071e5Spatrick 58f24071e5Spatrick #define NBPG PAGE_SIZE /* bytes/page */ 59f24071e5Spatrick #define PGSHIFT PAGE_SHIFT /* LOG2(PAGE_SIZE) */ 60f24071e5Spatrick #define PGOFSET PAGE_MASK /* byte offset into page */ 61f24071e5Spatrick 62f24071e5Spatrick #define UPAGES 5 /* pages of u-area */ 63f24071e5Spatrick #define USPACE (UPAGES * PAGE_SIZE) /* total size of u-area */ 64f24071e5Spatrick #define USPACE_ALIGN 0 /* u-area alignment 0-none */ 65f24071e5Spatrick 66965127f8Sclaudio #define NMBCLUSTERS (64 * 1024) /* max cluster allocation */ 67f24071e5Spatrick 68f24071e5Spatrick #ifndef MSGBUFSIZE 69f24071e5Spatrick #define MSGBUFSIZE (16 * PAGE_SIZE) /* default message buffer size */ 70f24071e5Spatrick #endif 71f24071e5Spatrick 72f24071e5Spatrick #define STACKALIGNBYTES (16 - 1) 73f24071e5Spatrick #define STACKALIGN(p) ((u_long)(p) &~ STACKALIGNBYTES) 74f24071e5Spatrick 755483bc56Spatrick #define __HAVE_ACPI 765483bc56Spatrick #define __HAVE_FDT 775483bc56Spatrick 78f24071e5Spatrick #endif /* _KERNEL */ 79f24071e5Spatrick 80f24071e5Spatrick #endif /* _MACHINE_PARAM_H_ */ 81