cpu.c revision 1.6
11.6Slukem/*	$NetBSD: cpu.c,v 1.6 2003/07/15 02:43:42 lukem 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.6Slukem
301.6Slukem#include <sys/cdefs.h>
311.6Slukem__KERNEL_RCSID(0, "$NetBSD: cpu.c,v 1.6 2003/07/15 02:43:42 lukem Exp $");
321.1Swdk
331.1Swdk#include <sys/param.h>
341.1Swdk#include <sys/device.h>
351.1Swdk#include <sys/systm.h>
361.1Swdk
371.1Swdk#include <machine/cpu.h>
381.1Swdk#include <machine/autoconf.h>
391.1Swdk
401.2Snisimura#include <mips/locore.h>
411.2Snisimura
421.1Swdk/* Definition of the driver for autoconfig. */
431.1Swdkstatic int	cpumatch(struct device *, struct cfdata *, void *);
441.1Swdkstatic void	cpuattach(struct device *, struct device *, void *);
451.1Swdk
461.5SthorpejCFATTACH_DECL(cpu, sizeof(struct device),
471.5Sthorpej    cpumatch, cpuattach, NULL, NULL);
481.1Swdk
491.1Swdkextern struct cfdriver cpu_cd;
501.1Swdk
511.1Swdkextern void cpu_identify __P((void));
521.1Swdk
531.1Swdkstatic int
541.1Swdkcpumatch(parent, cfdata, aux)
551.1Swdk	struct device *parent;
561.1Swdk	struct cfdata *cfdata;
571.1Swdk	void *aux;
581.1Swdk{
591.1Swdk	struct confargs *ca = aux;
601.1Swdk
611.1Swdk	/* make sure that we're looking for a CPU. */
621.1Swdk	if (strcmp(ca->ca_name, cpu_cd.cd_name) != 0) {
631.1Swdk		return 0;
641.1Swdk	}
651.1Swdk	return 1;
661.1Swdk}
671.1Swdk
681.1Swdkstatic void
691.1Swdkcpuattach(parent, dev, aux)
701.1Swdk	struct device *parent;
711.1Swdk	struct device *dev;
721.1Swdk	void *aux;
731.1Swdk{
741.1Swdk
751.3Sthorpej	printf(": ");
761.3Sthorpej	cpu_identify();
771.1Swdk}
78