Expand PMF_FN_* macros.
[netbsd-mini2440.git] / sys / arch / shark / ofw / cpu_ofbus.c
blob0e7a24c8a6f1a441901351c231fccb23711ff2b0
1 /* $NetBSD: cpu_ofbus.c,v 1.6 2005/12/11 12:19:04 christos Exp $ */
3 #include <sys/cdefs.h>
4 __KERNEL_RCSID(0, "$NetBSD: cpu_ofbus.c,v 1.6 2005/12/11 12:19:04 christos Exp $");
6 #include <sys/param.h>
7 #include <sys/systm.h>
8 #include <sys/device.h>
10 #include <machine/cpu.h>
12 #include <dev/ofw/openfirm.h>
15 * int cpu_ofbus_match(struct device *parent, struct cfdata *cf, void *aux)
17 * Probe for the main cpu. Currently all this does is return 1 to
18 * indicate that the cpu was found.
19 */
21 static int
22 cpu_ofbus_match(struct device *parent, struct cfdata *cf, void *aux)
24 struct ofbus_attach_args *aa = aux;
25 char buf[32];
27 if (OF_getprop(aa->oba_phandle, "device_type", buf, sizeof(buf)) < 0)
28 return (0);
29 if (strcmp("cpu", buf))
30 return (0);
31 return(1);
35 * void cpu_ofbus_attach(struct device *parent, struct device *dev, void *aux)
37 * Attach the main cpu
40 static void
41 cpu_ofbus_attach(struct device *parent, struct device *self, void *aux)
43 cpu_attach(self);
46 CFATTACH_DECL(cpu_ofbus, sizeof(struct device),
47 cpu_ofbus_match, cpu_ofbus_attach, NULL, NULL);