cpu.c revision 1.5
11.5Sthorpej/*	$NetBSD: cpu.c,v 1.5 2002/10/02 05:38:10 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.5SthorpejCFATTACH_DECL(cpu, sizeof(struct device),
441.5Sthorpej    cpumatch, cpuattach, NULL, NULL);
451.1Swdk
461.1Swdkextern struct cfdriver cpu_cd;
471.1Swdk
481.1Swdkextern void cpu_identify __P((void));
491.1Swdk
501.1Swdkstatic int
511.1Swdkcpumatch(parent, cfdata, aux)
521.1Swdk	struct device *parent;
531.1Swdk	struct cfdata *cfdata;
541.1Swdk	void *aux;
551.1Swdk{
561.1Swdk	struct confargs *ca = aux;
571.1Swdk
581.1Swdk	/* make sure that we're looking for a CPU. */
591.1Swdk	if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) {
601.1Swdk		return 0;
611.1Swdk	}
621.1Swdk	return 1;
631.1Swdk}
641.1Swdk
651.1Swdkstatic void
661.1Swdkcpuattach(parent, dev, aux)
671.1Swdk	struct device *parent;
681.1Swdk	struct device *dev;
691.1Swdk	void *aux;
701.1Swdk{
711.1Swdk
721.3Sthorpej	printf(": ");
731.3Sthorpej	cpu_identify();
741.1Swdk}
75