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