cputypes.h revision 1.9
191586Smarkm/*	$NetBSD: cputypes.h,v 1.9 2005/12/11 12:18:58 christos Exp $	*/
291586Smarkm
391586Smarkm/*-
491586Smarkm * Copyright (c) 2002 The NetBSD Foundation, Inc.
591586Smarkm * All rights reserved.
691586Smarkm *
791586Smarkm * Redistribution and use in source and binary forms, with or without
891586Smarkm * modification, are permitted provided that the following conditions
991586Smarkm * are met:
1091586Smarkm * 1. Redistributions of source code must retain the above copyright
1191586Smarkm *    notice, this list of conditions and the following disclaimer.
1291586Smarkm * 2. Redistributions in binary form must reproduce the above copyright
1391586Smarkm *    notice, this list of conditions and the following disclaimer in the
1491586Smarkm *    documentation and/or other materials provided with the distribution.
1591586Smarkm * 3. All advertising materials mentioning features or use of this software
1691586Smarkm *    must display the following acknowledgement:
1791586Smarkm *        This product includes software developed by the NetBSD
1891586Smarkm *        Foundation, Inc. and its contributors.
1991586Smarkm * 4. Neither the name of The NetBSD Foundation nor the names of its
2091586Smarkm *    contributors may be used to endorse or promote products derived
2191586Smarkm *    from this software without specific prior written permission.
2291586Smarkm *
2391586Smarkm * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
2491586Smarkm * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
2591586Smarkm * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2691586Smarkm * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
2791586Smarkm * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
2891586Smarkm * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
2991586Smarkm * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
3091586Smarkm * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
3191586Smarkm * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
3291586Smarkm * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
3391586Smarkm * POSSIBILITY OF SUCH DAMAGE.
3491586Smarkm */
3591586Smarkm
3691586Smarkm#ifndef _SH3_CPUTYPES_H_
3791586Smarkm#define	_SH3_CPUTYPES_H_
3891586Smarkm
3991586Smarkm#ifdef _KERNEL
4091586Smarkm
4191586Smarkm#if defined(_KERNEL_OPT)
4291586Smarkm#include "opt_cputype.h"
4391586Smarkm#elif defined(_LKM)
4491586Smarkm/* If building an LKM, include both SH3 and SH4 support. */
4591586Smarkm#define	SH3
4691586Smarkm#define	SH4
4791586Smarkm#endif
4891586Smarkm
4991586Smarkm#define	CPU_ARCH_SH3		3
5091586Smarkm#define	CPU_ARCH_SH4		4
5191586Smarkm
5291586Smarkm/* SH3 series */
5391586Smarkm#define	CPU_PRODUCT_7708	1
54#define	CPU_PRODUCT_7708S	2
55#define	CPU_PRODUCT_7708R	3
56#define	CPU_PRODUCT_7709	4
57#define	CPU_PRODUCT_7709A	5
58
59/* SH4 series */
60#define	CPU_PRODUCT_7750	6
61#define	CPU_PRODUCT_7750S	7
62#define	CPU_PRODUCT_7750R	8
63#define	CPU_PRODUCT_7751	9
64#define	CPU_PRODUCT_7751R	10
65
66
67#ifndef _LOCORE
68extern int cpu_arch;
69extern int cpu_product;
70#if defined(SH3) && defined(SH4)
71#define	CPU_IS_SH3		(cpu_arch == CPU_ARCH_SH3)
72#define	CPU_IS_SH4		(cpu_arch == CPU_ARCH_SH4)
73#elif defined(SH3)
74#define	CPU_IS_SH3		1
75#define	CPU_IS_SH4		0
76#elif defined(SH4)
77#define	CPU_IS_SH3		0
78#define	CPU_IS_SH4		1
79#else
80#error "define SH3 and/or SH4"
81#endif
82#endif /* !_LOCORE */
83
84#endif /* _KERNEL */
85
86#endif /* !_SH3_CPUTYPES_H_ */
87