1*072aa173Sjdolecek /* $NetBSD: param.h,v 1.4 2019/01/07 22:00:31 jdolecek Exp $ */
25f7e80a8Spooka
35f7e80a8Spooka /*
49b6bd2d9Srmind * Copyright (c) 1988 University of Utah.
55f7e80a8Spooka * Copyright (c) 1992, 1993
65f7e80a8Spooka * The Regents of the University of California. All rights reserved.
75f7e80a8Spooka *
85f7e80a8Spooka * This code is derived from software contributed to Berkeley by
95f7e80a8Spooka * the Systems Programming Group of the University of Utah Computer
105f7e80a8Spooka * Science Department and Ralph Campbell.
115f7e80a8Spooka *
125f7e80a8Spooka * Redistribution and use in source and binary forms, with or without
135f7e80a8Spooka * modification, are permitted provided that the following conditions
145f7e80a8Spooka * are met:
155f7e80a8Spooka * 1. Redistributions of source code must retain the above copyright
165f7e80a8Spooka * notice, this list of conditions and the following disclaimer.
175f7e80a8Spooka * 2. Redistributions in binary form must reproduce the above copyright
185f7e80a8Spooka * notice, this list of conditions and the following disclaimer in the
195f7e80a8Spooka * documentation and/or other materials provided with the distribution.
205f7e80a8Spooka * 3. Neither the name of the University nor the names of its contributors
215f7e80a8Spooka * may be used to endorse or promote products derived from this software
225f7e80a8Spooka * without specific prior written permission.
235f7e80a8Spooka *
245f7e80a8Spooka * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
255f7e80a8Spooka * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
265f7e80a8Spooka * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
275f7e80a8Spooka * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
285f7e80a8Spooka * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
295f7e80a8Spooka * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
305f7e80a8Spooka * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
315f7e80a8Spooka * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
325f7e80a8Spooka * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
335f7e80a8Spooka * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
345f7e80a8Spooka * SUCH DAMAGE.
355f7e80a8Spooka *
365f7e80a8Spooka * from: Utah Hdr: machparam.h 1.11 89/08/14
375f7e80a8Spooka *
385f7e80a8Spooka * @(#)param.h 8.1 (Berkeley) 6/10/93
395f7e80a8Spooka */
405f7e80a8Spooka
415f7e80a8Spooka #ifndef _EMIPS_PARAM_H_
425f7e80a8Spooka #define _EMIPS_PARAM_H_
435f7e80a8Spooka
445f7e80a8Spooka /*
455f7e80a8Spooka * Machine dependent constants for mips-based DECstations.
465f7e80a8Spooka */
475f7e80a8Spooka
485f7e80a8Spooka #define _MACHINE emips
495f7e80a8Spooka #define MACHINE "emips"
5081a6c364Stsutsui
5181a6c364Stsutsui #include <mips/mips_param.h>
525f7e80a8Spooka
535f7e80a8Spooka /*
545f7e80a8Spooka * Constants related to network buffer management.
555f7e80a8Spooka * MCLBYTES must be no larger than NBPG (the software page size), and,
565f7e80a8Spooka * on machines that exchange pages of input or output buffers with mbuf
575f7e80a8Spooka * clusters (MAPPED_MBUFS), MCLBYTES must also be an integral multiple
585f7e80a8Spooka * of the hardware page size.
595f7e80a8Spooka */
605f7e80a8Spooka #define MSIZE 256 /* size of an mbuf */
615f7e80a8Spooka
625f7e80a8Spooka #ifndef MCLSHIFT
635f7e80a8Spooka #define MCLSHIFT 11 /* convert bytes to m_buf clusters */
645f7e80a8Spooka /* 2K cluster can hold Ether frame */
655f7e80a8Spooka #endif /* MCLSHIFT */
665f7e80a8Spooka
675f7e80a8Spooka #define MCLBYTES (1 << MCLSHIFT) /* size of a m_buf cluster */
685f7e80a8Spooka
695f7e80a8Spooka #ifndef NMBCLUSTERS
705f7e80a8Spooka #if defined(_KERNEL_OPT)
715f7e80a8Spooka #include "opt_gateway.h"
725f7e80a8Spooka #endif
735f7e80a8Spooka
745f7e80a8Spooka #ifdef GATEWAY
755f7e80a8Spooka #define NMBCLUSTERS 2048 /* map size, max cluster allocation */
765f7e80a8Spooka #else
775f7e80a8Spooka #define NMBCLUSTERS 1024 /* map size, max cluster allocation */
785f7e80a8Spooka #endif
795f7e80a8Spooka #endif
805f7e80a8Spooka
815f7e80a8Spooka #ifdef _KERNEL
825f7e80a8Spooka #ifndef _LOCORE
835f7e80a8Spooka
845f7e80a8Spooka void delay __P((int n));
855f7e80a8Spooka extern int cpuspeed;
865f7e80a8Spooka static __inline void __attribute__((__unused__))
DELAY(int n)875f7e80a8Spooka DELAY(int n)
885f7e80a8Spooka {
895f7e80a8Spooka register int __N = cpuspeed * n;
905f7e80a8Spooka
915f7e80a8Spooka do {
925f7e80a8Spooka __asm("addiu %0,%1,-1" : "=r" (__N) : "0" (__N));
935f7e80a8Spooka } while (__N > 0);
945f7e80a8Spooka }
955f7e80a8Spooka
965f7e80a8Spooka #include <machine/intr.h>
975f7e80a8Spooka
985f7e80a8Spooka #endif /* !_LOCORE */
995f7e80a8Spooka #endif /* _KERNEL */
1005f7e80a8Spooka
1015f7e80a8Spooka #endif /* !_EMIPS_PARAM_H_ */
102