1*569905a9Sclaudio /* $OpenBSD: param.h,v 1.37 2023/12/14 13:26:49 claudio Exp $ */ 2f58c7388Spefo 3f58c7388Spefo /* 4f58c7388Spefo * Copyright (c) 1988 University of Utah. 5f58c7388Spefo * Copyright (c) 1992, 1993 6f58c7388Spefo * The Regents of the University of California. All rights reserved. 7f58c7388Spefo * 8f58c7388Spefo * This code is derived from software contributed to Berkeley by 9f58c7388Spefo * the Systems Programming Group of the University of Utah Computer 10f58c7388Spefo * Science Department and Ralph Campbell. 11f58c7388Spefo * 12f58c7388Spefo * Redistribution and use in source and binary forms, with or without 13f58c7388Spefo * modification, are permitted provided that the following conditions 14f58c7388Spefo * are met: 15f58c7388Spefo * 1. Redistributions of source code must retain the above copyright 16f58c7388Spefo * notice, this list of conditions and the following disclaimer. 17f58c7388Spefo * 2. Redistributions in binary form must reproduce the above copyright 18f58c7388Spefo * notice, this list of conditions and the following disclaimer in the 19f58c7388Spefo * documentation and/or other materials provided with the distribution. 2053aa784aSmiod * 3. Neither the name of the University nor the names of its contributors 21f58c7388Spefo * may be used to endorse or promote products derived from this software 22f58c7388Spefo * without specific prior written permission. 23f58c7388Spefo * 24f58c7388Spefo * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND 25f58c7388Spefo * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 26f58c7388Spefo * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 27f58c7388Spefo * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE 28f58c7388Spefo * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 29f58c7388Spefo * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 30f58c7388Spefo * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 31f58c7388Spefo * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 32f58c7388Spefo * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 33f58c7388Spefo * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 34f58c7388Spefo * SUCH DAMAGE. 35f58c7388Spefo */ 36f58c7388Spefo 372fa72412Spirofti #ifndef _MIPS64_PARAM_H_ 382fa72412Spirofti #define _MIPS64_PARAM_H_ 39f58c7388Spefo 40f58c7388Spefo #ifdef _KERNEL 41f58c7388Spefo #include <machine/cpu.h> 42f58c7388Spefo #endif 43f58c7388Spefo 44f58c7388Spefo #define PAGE_SIZE (1 << PAGE_SHIFT) 45f58c7388Spefo #define PAGE_MASK (PAGE_SIZE - 1) 46f58c7388Spefo 47146b49dfSmiod #ifdef _KERNEL 48184e2458Sderaadt 498d365b1eSmiod #ifndef KERNBASE 508d365b1eSmiod #define KERNBASE 0xffffffff80000000L /* start of kernel virtual */ 518d365b1eSmiod #endif 528d365b1eSmiod 53184e2458Sderaadt #define NBPG PAGE_SIZE 5412595cf0Sderaadt #define PGSHIFT PAGE_SHIFT 5512595cf0Sderaadt #define PGOFSET PAGE_MASK 56184e2458Sderaadt 57184e2458Sderaadt #define USPACE 16384 58f1bb116bSmiod #define UPAGES (USPACE >> PAGE_SHIFT) 59f1bb116bSmiod #if PAGE_SHIFT > 12 60f1bb116bSmiod #define USPACE_ALIGN 0 61f58c7388Spefo #else 62f1bb116bSmiod #define USPACE_ALIGN (2 * PAGE_SIZE) /* align to an even TLB boundary */ 63f58c7388Spefo #endif 64f58c7388Spefo 65965127f8Sclaudio #define NMBCLUSTERS (64 * 1024) /* max cluster allocation */ 66f58c7388Spefo 67184e2458Sderaadt #ifndef MSGBUFSIZE 682abb778bSmiod #if PAGE_SHIFT > 12 692abb778bSmiod #define MSGBUFSIZE PAGE_SIZE 702abb778bSmiod #else 71f58c7388Spefo #define MSGBUFSIZE 8192 722abb778bSmiod #endif 73184e2458Sderaadt #endif 74f58c7388Spefo 75f58c7388Spefo #ifndef _LOCORE 76f58c7388Spefo #define DELAY(n) delay(n) 7799ca9df2Sgrange void delay(int); 78f58c7388Spefo #endif 79184e2458Sderaadt 80146b49dfSmiod #endif /* _KERNEL */ 81f58c7388Spefo 82184e2458Sderaadt #endif /* _MIPS64_PARAM_H_ */ 83