1*072aa173Sjdolecek /* from $NetBSD: param.h,v 1.22 2019/01/07 22:00:32 jdolecek Exp $ */
2117df8f7Stsubai
3117df8f7Stsubai /*
49b6bd2d9Srmind * Copyright (c) 1988 University of Utah.
5117df8f7Stsubai * Copyright (c) 1992, 1993
6117df8f7Stsubai * The Regents of the University of California. All rights reserved.
7117df8f7Stsubai *
8117df8f7Stsubai * This code is derived from software contributed to Berkeley by
9117df8f7Stsubai * the Systems Programming Group of the University of Utah Computer
10117df8f7Stsubai * Science Department and Ralph Campbell.
11117df8f7Stsubai *
12117df8f7Stsubai * Redistribution and use in source and binary forms, with or without
13117df8f7Stsubai * modification, are permitted provided that the following conditions
14117df8f7Stsubai * are met:
15117df8f7Stsubai * 1. Redistributions of source code must retain the above copyright
16117df8f7Stsubai * notice, this list of conditions and the following disclaimer.
17117df8f7Stsubai * 2. Redistributions in binary form must reproduce the above copyright
18117df8f7Stsubai * notice, this list of conditions and the following disclaimer in the
19117df8f7Stsubai * documentation and/or other materials provided with the distribution.
20aad01611Sagc * 3. Neither the name of the University nor the names of its contributors
21aad01611Sagc * may be used to endorse or promote products derived from this software
22aad01611Sagc * without specific prior written permission.
23aad01611Sagc *
24aad01611Sagc * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
25aad01611Sagc * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26aad01611Sagc * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27aad01611Sagc * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
28aad01611Sagc * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29aad01611Sagc * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30aad01611Sagc * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31aad01611Sagc * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32aad01611Sagc * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33aad01611Sagc * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34aad01611Sagc * SUCH DAMAGE.
35aad01611Sagc *
36aad01611Sagc * from: Utah Hdr: machparam.h 1.11 89/08/14
37aad01611Sagc *
38aad01611Sagc * @(#)param.h 8.1 (Berkeley) 6/10/93
39aad01611Sagc */
40117df8f7Stsubai
41afb7d3cbStsutsui #ifndef _NEWSMIPS_PARAM_H_
42afb7d3cbStsutsui #define _NEWSMIPS_PARAM_H_
43afb7d3cbStsutsui
44117df8f7Stsubai /*
45117df8f7Stsubai * Machine dependent constants for mips-based NEWS.
46117df8f7Stsubai */
47117df8f7Stsubai
48157b7121Sthorpej #define _MACHINE newsmips
49157b7121Sthorpej #define MACHINE "newsmips"
5098e6fe41Stsutsui
5198e6fe41Stsutsui #include <mips/mips_param.h>
52117df8f7Stsubai
53117df8f7Stsubai #define KERNBASE 0x80000000 /* start of kernel virtual */
54117df8f7Stsubai #define KERNTEXTOFF 0x80001000 /* start of kernel text for kvm_mkdb */
55117df8f7Stsubai #define BTOPKERNBASE ((u_long)KERNBASE >> PGSHIFT)
56117df8f7Stsubai
57a890d2ddStsubai #ifdef _KERNEL
58a890d2ddStsubai #ifndef _LOCORE
59a890d2ddStsubai
608f6c85abShe #include <machine/intr.h>
618f6c85abShe
62521796afStsutsui extern void delay(int n);
63a890d2ddStsubai extern int cpuspeed;
6435038ef5Stsutsui
6535038ef5Stsutsui static __inline void __attribute__((__unused__))
DELAY(int n)6635038ef5Stsutsui DELAY(int n)
6735038ef5Stsutsui {
6835038ef5Stsutsui register int __N = cpuspeed * n;
6935038ef5Stsutsui
7035038ef5Stsutsui do {
7135038ef5Stsutsui __asm("addiu %0,%1,-1" : "=r" (__N) : "0" (__N));
7235038ef5Stsutsui } while (__N > 0);
7335038ef5Stsutsui }
74a890d2ddStsubai
75a890d2ddStsubai #endif /* !_LOCORE */
76a890d2ddStsubai #endif /* _KERNEL */
77afb7d3cbStsutsui
78afb7d3cbStsutsui #endif /* !_NEWSMIPS_PARAM_H_ */
79