/*-
* Copyright (c) 2013 The NetBSD Foundation, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
/*
* Userland code should be using uname/sysctl to get MACHINE so simply
* export a generic MACHINE of "mips"
*/
#ifndef _KERNEL
#undef MACHINE
#define MACHINE "mips"
#endif
/*
* Most MIPS have a cache line size of 32 bytes, but Cavium chips
* have a line size 128 bytes and we need to cover the larger size.
*/
#define COHERENCY_UNIT 128
#define CACHE_LINE_SIZE 128
#ifdef _LP64
#define __MIN_USPACE 16384 /* LP64 needs a 16kB stack */
#else
/*
* Note for the non-LP64 case, cpu_switch_resume has the assumption
* that UPAGES == 2. For MIPS-I we wire USPACE in TLB #0 and #1.
* For MIPS3+ we wire USPACE in the TLB #0 pair.
*/
#define __MIN_USPACE 8192 /* otherwise use an 8kB stack */
#endif
#define USPACE MAX(__MIN_USPACE, PAGE_SIZE)
#define UPAGES (USPACE / PAGE_SIZE) /* number of pages for u-area */
#define USPACE_ALIGN USPACE /* make sure it starts on a even VA */
#define UPAGES_MAX 8 /* a (constant) max for userland use */
/*
* Minimum and maximum sizes of the kernel malloc arena in PAGE_SIZE-sized
* logical pages.
*/
#define NKMEMPAGES_MIN_DEFAULT ((8 * 1024 * 1024) >> PAGE_SHIFT)
#define NKMEMPAGES_MAX_DEFAULT ((128 * 1024 * 1024) >> PAGE_SHIFT)
/*
* Constants related to network buffer management.
* MCLBYTES must be no larger than NBPG (the software page size), and,
* on machines that exchange pages of input or output buffers with mbuf
* clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
* of the hardware page size.
*/
#ifndef MSIZE
#ifdef _LP64
#define MSIZE 512 /* size of an mbuf */
#else
#define MSIZE 256 /* size of an mbuf */
#endif