cpu.c revision 1.3
11.3Sthorpej/*	$NetBSD: cpu.c,v 1.3 2001/11/14 18:15:29 thorpej Exp $	*/
21.1Swdk
31.1Swdk/*
41.1Swdk * Copyright (c) 1994, 1995 Carnegie-Mellon University.
51.1Swdk * All rights reserved.
61.1Swdk *
71.1Swdk * Author: Chris G. Demetriou
81.1Swdk *
91.1Swdk * Permission to use, copy, modify and distribute this software and
101.1Swdk * its documentation is hereby granted, provided that both the copyright
111.1Swdk * notice and this permission notice appear in all copies of the
121.1Swdk * software, derivative works or modified versions, and any portions
131.1Swdk * thereof, and that both notices appear in supporting documentation.
141.1Swdk *
151.1Swdk * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
161.1Swdk * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
171.1Swdk * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
181.1Swdk *
191.1Swdk * Carnegie Mellon requests users of this software to return to
201.1Swdk *
211.1Swdk *  Software Distribution Coordinator  or  Software.Distribution@CS.CMU.EDU
221.1Swdk *  School of Computer Science
231.1Swdk *  Carnegie Mellon University
241.1Swdk *  Pittsburgh PA 15213-3890
251.1Swdk *
261.1Swdk * any improvements or extensions that they make and grant Carnegie the
271.1Swdk * rights to redistribute these changes.
281.1Swdk */
291.1Swdk
301.1Swdk#include <sys/param.h>
311.1Swdk#include <sys/device.h>
321.1Swdk#include <sys/systm.h>
331.1Swdk
341.1Swdk#include <machine/cpu.h>
351.1Swdk#include <machine/autoconf.h>
361.1Swdk
371.2Snisimura#include <mips/locore.h>
381.2Snisimura
391.1Swdk/* Definition of the driver for autoconfig. */
401.1Swdkstatic int	cpumatch(struct device *, struct cfdata *, void *);
411.1Swdkstatic void	cpuattach(struct device *, struct device *, void *);
421.1Swdk
431.1Swdkstruct cfattach cpu_ca = {
441.1Swdk	sizeof(struct device), cpumatch, cpuattach
451.1Swdk};
461.1Swdk
471.1Swdkextern struct cfdriver cpu_cd;
481.1Swdk
491.1Swdkextern void cpu_identify __P((void));
501.1Swdk
511.1Swdkstatic int
521.1Swdkcpumatch(parent, cfdata, aux)
531.1Swdk	struct device *parent;
541.1Swdk	struct cfdata *cfdata;
551.1Swdk	void *aux;
561.1Swdk{
571.1Swdk	struct confargs *ca = aux;
581.1Swdk
591.1Swdk	/* make sure that we're looking for a CPU. */
601.1Swdk	if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) {
611.1Swdk		return 0;
621.1Swdk	}
631.1Swdk	return 1;
641.1Swdk}
651.1Swdk
661.1Swdkstatic void
671.1Swdkcpuattach(parent, dev, aux)
681.1Swdk	struct device *parent;
691.1Swdk	struct device *dev;
701.1Swdk	void *aux;
711.1Swdk{
721.1Swdk
731.3Sthorpej	printf(": ");
741.3Sthorpej	cpu_identify();
751.1Swdk}
76