Home | History | Annotate | Line # | Download | only in include
cpuconf.h revision 1.8
      1  1.8  thorpej /*	$NetBSD: cpuconf.h,v 1.8 1998/06/06 20:18:50 thorpej Exp $	*/
      2  1.8  thorpej 
      3  1.1      cgd /*
      4  1.1      cgd  * Copyright (c) 1996 Christopher G. Demetriou.  All rights reserved.
      5  1.1      cgd  *
      6  1.1      cgd  * Redistribution and use in source and binary forms, with or without
      7  1.1      cgd  * modification, are permitted provided that the following conditions
      8  1.1      cgd  * are met:
      9  1.1      cgd  * 1. Redistributions of source code must retain the above copyright
     10  1.1      cgd  *    notice, this list of conditions and the following disclaimer.
     11  1.1      cgd  * 2. Redistributions in binary form must reproduce the above copyright
     12  1.1      cgd  *    notice, this list of conditions and the following disclaimer in the
     13  1.1      cgd  *    documentation and/or other materials provided with the distribution.
     14  1.1      cgd  * 3. All advertising materials mentioning features or use of this software
     15  1.1      cgd  *    must display the following acknowledgement:
     16  1.1      cgd  *      This product includes software developed by Christopher G. Demetriou
     17  1.1      cgd  *	for the NetBSD Project.
     18  1.1      cgd  * 4. The name of the author may not be used to endorse or promote products
     19  1.1      cgd  *    derived from this software without specific prior written permission
     20  1.1      cgd  *
     21  1.1      cgd  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     22  1.1      cgd  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     23  1.1      cgd  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     24  1.1      cgd  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     25  1.1      cgd  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     26  1.1      cgd  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     27  1.1      cgd  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     28  1.1      cgd  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     29  1.1      cgd  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     30  1.1      cgd  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     31  1.1      cgd  */
     32  1.6   mjacob /*
     33  1.6   mjacob  * Additional reworking by Matthew Jacob for NASA/Ames Research Center.
     34  1.6   mjacob  * Copyright (c) 1997
     35  1.6   mjacob  */
     36  1.8  thorpej 
     37  1.8  thorpej #ifndef	_ALPHA_CPUCONF_H_
     38  1.8  thorpej #define	_ALPHA_CPUCONF_H_
     39  1.8  thorpej 
     40  1.6   mjacob /*
     41  1.6   mjacob  * Platform Specific Information and Function Hooks.
     42  1.6   mjacob  *
     43  1.6   mjacob  * The tags family and model information are strings describing the platform.
     44  1.6   mjacob  *
     45  1.6   mjacob  * The tag iobus describes the primary iobus for the platform- primarily
     46  1.6   mjacob  * to give a hint as to where to start configuring. The likely choices
     47  1.6   mjacob  * are one of tcasic, lca, apecs, cia, or tlsb.
     48  1.6   mjacob  */
     49  1.1      cgd 
     50  1.8  thorpej struct platform {
     51  1.6   mjacob 	/*
     52  1.6   mjacob 	 * Platform Information.
     53  1.6   mjacob 	 */
     54  1.6   mjacob 	const char	*family;	/* Family Name */
     55  1.6   mjacob 	const char	*model;		/* Model (variant) Name */
     56  1.6   mjacob 	const char	*iobus;		/* Primary iobus name */
     57  1.6   mjacob 
     58  1.6   mjacob 	/*
     59  1.6   mjacob 	 * Platform Specific Function Hooks
     60  1.6   mjacob 	 *	cons_init 	-	console initialization
     61  1.6   mjacob 	 *	device_register	-	boot configuration aid
     62  1.6   mjacob 	 *	iointr		-	I/O interrupt handler
     63  1.6   mjacob 	 *	clockintr	-	Clock Interrupt Handler
     64  1.6   mjacob 	 *	mcheck_handler	-	Platform Specific Machine Check Handler
     65  1.6   mjacob 	 */
     66  1.6   mjacob 	void	(*cons_init) __P((void));
     67  1.6   mjacob 	void	(*device_register) __P((struct device *, void *));
     68  1.6   mjacob 	void	(*iointr) __P((void *, unsigned long));
     69  1.6   mjacob 	void	(*clockintr) __P((void *));
     70  1.6   mjacob 	void	(*mcheck_handler) __P((unsigned long, struct trapframe *,
     71  1.6   mjacob 		unsigned long, unsigned long));
     72  1.8  thorpej 	void	(*powerdown) __P((void));
     73  1.6   mjacob } platform;
     74  1.1      cgd 
     75  1.6   mjacob /*
     76  1.6   mjacob  * There is an array of functions to initialize the platform structure.
     77  1.6   mjacob  *
     78  1.6   mjacob  * It's responsible for filling in the family, model_name and iobus
     79  1.6   mjacob  * tags. It may optionally fill in the cons_init, device_register and
     80  1.6   mjacob  * mcheck_handler tags.
     81  1.6   mjacob  *
     82  1.6   mjacob  * The iointr tag is filled in by set_iointr (in interrupt.c).
     83  1.6   mjacob  * The clockintr tag is filled in by cpu_initclocks (in clock.c).
     84  1.6   mjacob  *
     85  1.6   mjacob  * nocpu is function to call when you can't figure what platform you're on.
     86  1.6   mjacob  * There's no return from this function.
     87  1.6   mjacob  */
     88  1.6   mjacob 
     89  1.7  thorpej struct cpuinit {
     90  1.7  thorpej 	void	(*init) __P((void));
     91  1.7  thorpej 	const char *option;
     92  1.7  thorpej };
     93  1.7  thorpej 
     94  1.8  thorpej #ifdef _KERNEL
     95  1.7  thorpej #define	cpu_notsupp(st)		{ platform_not_supported, st }
     96  1.7  thorpej #define	cpu_init(fn, opt)	{ fn, opt }
     97  1.7  thorpej 
     98  1.8  thorpej extern struct platform platform;
     99  1.7  thorpej extern struct cpuinit cpuinit[];
    100  1.6   mjacob extern int ncpuinit;
    101  1.7  thorpej extern void platform_not_configured __P((void));
    102  1.7  thorpej extern void platform_not_supported __P((void));
    103  1.5  thorpej #endif /* _KERNEL */
    104  1.8  thorpej #endif /* ! _ALPHA_CPUCONF_H_ */
    105