File: [cvs.NetBSD.org] / src / sys / arch / hpcmips / hpcmips / cpu.c (download)
Revision 1.5, Fri May 12 04:43:21 2000 UTC (20 years, 8 months ago) by shin
Branch: MAIN
CVS Tags: netbsd-1-5-base, netbsd-1-5-RELEASE, netbsd-1-5-PATCH003, netbsd-1-5-PATCH002, netbsd-1-5-PATCH001, netbsd-1-5-BETA2, netbsd-1-5-BETA, netbsd-1-5-ALPHA2, netbsd-1-5, minoura-xpg4dl-base, minoura-xpg4dl Changes since 1.4: +2 -2
lines
make it compile again with '-Werror'.
|
/* $NetBSD: cpu.c,v 1.5 2000/05/12 04:43:21 shin Exp $ */
/*
* Copyright (c) 1994, 1995 Carnegie-Mellon University.
* All rights reserved.
*
* Author: Chris G. Demetriou
*
* Permission to use, copy, modify and distribute this software and
* its documentation is hereby granted, provided that both the copyright
* notice and this permission notice appear in all copies of the
* software, derivative works or modified versions, and any portions
* thereof, and that both notices appear in supporting documentation.
*
* CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
* CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
* FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
*
* Carnegie Mellon requests users of this software to return to
*
* Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
* School of Computer Science
* Carnegie Mellon University
* Pittsburgh PA 15213-3890
*
* any improvements or extensions that they make and grant Carnegie the
* rights to redistribute these changes.
*/
#include <sys/param.h>
#include <sys/device.h>
#include <sys/systm.h>
#include <mips/locore.h>
#include <machine/cpu.h>
#include <machine/bus.h>
#include <machine/autoconf.h>
#include <machine/platid.h>
#include <machine/platid_mask.h>
#include "opt_vr41x1.h"
/* Definition of the driver for autoconfig. */
static int cpumatch(struct device *, struct cfdata *, void *);
static void cpuattach(struct device *, struct device *, void *);
struct cfattach cpu_ca = {
sizeof (struct device), cpumatch, cpuattach
};
extern struct cfdriver cpu_cd;
extern void cpu_identify __P((void));
extern void vr_idle __P((void));
static int
cpumatch(parent, cf, aux)
struct device *parent;
struct cfdata *cf;
void *aux;
{
struct mainbus_attach_args *ma = aux;
/* make sure that we're looking for a CPU. */
if (strcmp(ma->ma_name, cpu_cd.cd_name) != 0) {
return (0);
}
return (1);
}
static void
cpuattach(parent, dev, aux)
struct device *parent;
struct device *dev;
void *aux;
{
printf(": ");
cpu_identify();
#ifdef VR41X1
if (platid_match(&platid, &platid_mask_CPU_MIPS_VR_41XX)) {
printf("cpu0: install VR specific idle routine\n");
CPU_IDLE = (long *)vr_idle;
}
#endif
}