xref: /f-stack/freebsd/mips/include/cpuinfo.h (revision a9643ea8)
1*a9643ea8Slogwang /*	$NetBSD: cpu.h,v 1.70 2003/01/17 23:36:08 thorpej Exp $	*/
2*a9643ea8Slogwang 
3*a9643ea8Slogwang /*-
4*a9643ea8Slogwang  * Copyright (c) 1992, 1993
5*a9643ea8Slogwang  *	The Regents of the University of California.  All rights reserved.
6*a9643ea8Slogwang  *
7*a9643ea8Slogwang  * This code is derived from software contributed to Berkeley by
8*a9643ea8Slogwang  * Ralph Campbell and Rick Macklem.
9*a9643ea8Slogwang  *
10*a9643ea8Slogwang  * Redistribution and use in source and binary forms, with or without
11*a9643ea8Slogwang  * modification, are permitted provided that the following conditions
12*a9643ea8Slogwang  * are met:
13*a9643ea8Slogwang  * 1. Redistributions of source code must retain the above copyright
14*a9643ea8Slogwang  *    notice, this list of conditions and the following disclaimer.
15*a9643ea8Slogwang  * 2. Redistributions in binary form must reproduce the above copyright
16*a9643ea8Slogwang  *    notice, this list of conditions and the following disclaimer in the
17*a9643ea8Slogwang  *    documentation and/or other materials provided with the distribution.
18*a9643ea8Slogwang  * 3. All advertising materials mentioning features or use of this software
19*a9643ea8Slogwang  *    must display the following acknowledgement:
20*a9643ea8Slogwang  *	This product includes software developed by the University of
21*a9643ea8Slogwang  *	California, Berkeley and its contributors.
22*a9643ea8Slogwang  * 4. Neither the name of the University nor the names of its contributors
23*a9643ea8Slogwang  *    may be used to endorse or promote products derived from this software
24*a9643ea8Slogwang  *    without specific prior written permission.
25*a9643ea8Slogwang  *
26*a9643ea8Slogwang  * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
27*a9643ea8Slogwang  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
28*a9643ea8Slogwang  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
29*a9643ea8Slogwang  * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
30*a9643ea8Slogwang  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
31*a9643ea8Slogwang  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
32*a9643ea8Slogwang  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
33*a9643ea8Slogwang  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
34*a9643ea8Slogwang  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
35*a9643ea8Slogwang  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
36*a9643ea8Slogwang  * SUCH DAMAGE.
37*a9643ea8Slogwang  *
38*a9643ea8Slogwang  * $FreeBSD$
39*a9643ea8Slogwang  *	@(#)cpu.h	8.4 (Berkeley) 1/4/94
40*a9643ea8Slogwang  */
41*a9643ea8Slogwang 
42*a9643ea8Slogwang #ifndef _CPUINFO_H_
43*a9643ea8Slogwang #define _CPUINFO_H_
44*a9643ea8Slogwang 
45*a9643ea8Slogwang /*
46*a9643ea8Slogwang  * Exported definitions unique to NetBSD/mips cpu support.
47*a9643ea8Slogwang  */
48*a9643ea8Slogwang 
49*a9643ea8Slogwang #ifdef _KERNEL
50*a9643ea8Slogwang #ifndef LOCORE
51*a9643ea8Slogwang 
52*a9643ea8Slogwang struct mips_cpuinfo {
53*a9643ea8Slogwang 	u_int8_t	cpu_vendor;
54*a9643ea8Slogwang 	u_int8_t	cpu_rev;
55*a9643ea8Slogwang 	u_int8_t	cpu_impl;
56*a9643ea8Slogwang 	u_int8_t	tlb_type;
57*a9643ea8Slogwang 	u_int32_t	tlb_pgmask;
58*a9643ea8Slogwang 	u_int16_t	tlb_nentries;
59*a9643ea8Slogwang 	u_int8_t	icache_virtual;
60*a9643ea8Slogwang 	boolean_t	cache_coherent_dma;
61*a9643ea8Slogwang 	struct {
62*a9643ea8Slogwang 		u_int32_t	ic_size;
63*a9643ea8Slogwang 		u_int8_t	ic_linesize;
64*a9643ea8Slogwang 		u_int8_t	ic_nways;
65*a9643ea8Slogwang 		u_int16_t	ic_nsets;
66*a9643ea8Slogwang 		u_int32_t	dc_size;
67*a9643ea8Slogwang 		u_int8_t	dc_linesize;
68*a9643ea8Slogwang 		u_int8_t	dc_nways;
69*a9643ea8Slogwang 		u_int16_t	dc_nsets;
70*a9643ea8Slogwang 	} l1;
71*a9643ea8Slogwang 	struct {
72*a9643ea8Slogwang 		u_int32_t	dc_size;
73*a9643ea8Slogwang 		u_int8_t	dc_linesize;
74*a9643ea8Slogwang 		u_int8_t	dc_nways;
75*a9643ea8Slogwang 		u_int16_t	dc_nsets;
76*a9643ea8Slogwang 	} l2;
77*a9643ea8Slogwang };
78*a9643ea8Slogwang 
79*a9643ea8Slogwang extern struct mips_cpuinfo cpuinfo;
80*a9643ea8Slogwang 
81*a9643ea8Slogwang #endif /* !LOCORE */
82*a9643ea8Slogwang #endif /* _KERNEL */
83*a9643ea8Slogwang #endif /* _CPUINFO_H_ */
84