mainbus.c revision 1.2
11.2Such/* $NetBSD: mainbus.c,v 1.2 2002/03/24 18:14:28 uch Exp $ */ 21.1Such 31.2Such/*- 41.2Such * Copyright (c) 2002 The NetBSD Foundation, Inc. 51.2Such * All rights reserved. 61.1Such * 71.1Such * Redistribution and use in source and binary forms, with or without 81.1Such * modification, are permitted provided that the following conditions 91.1Such * are met: 101.1Such * 1. Redistributions of source code must retain the above copyright 111.1Such * notice, this list of conditions and the following disclaimer. 121.1Such * 2. Redistributions in binary form must reproduce the above copyright 131.1Such * notice, this list of conditions and the following disclaimer in the 141.1Such * documentation and/or other materials provided with the distribution. 151.1Such * 3. All advertising materials mentioning features or use of this software 161.1Such * must display the following acknowledgement: 171.2Such * This product includes software developed by the NetBSD 181.2Such * Foundation, Inc. and its contributors. 191.2Such * 4. Neither the name of The NetBSD Foundation nor the names of its 201.2Such * contributors may be used to endorse or promote products derived 211.2Such * from this software without specific prior written permission. 221.1Such * 231.2Such * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 241.2Such * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 251.2Such * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 261.2Such * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 271.2Such * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 281.2Such * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 291.2Such * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 301.2Such * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 311.2Such * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 321.2Such * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 331.2Such * POSSIBILITY OF SUCH DAMAGE. 341.1Such */ 351.1Such 361.1Such#include <sys/param.h> 371.1Such#include <sys/systm.h> 381.1Such#include <sys/device.h> 391.2Such#include <machine/autoconf.h> 401.1Such 411.2Suchint mainbus_match(struct device *, struct cfdata *, void *); 421.2Suchvoid mainbus_attach(struct device *, struct device *, void *); 431.2Suchint mainbus_print(void *, const char *); 441.2Such 451.2Suchstruct mainbus_attach_args mainbusdevs[] = { 461.2Such { "cpu" }, 471.2Such { "shb" }, 481.2Such { NULL } /* terminator */ 491.2Such}; 501.1Such 511.1Suchstruct cfattach mainbus_ca = { 521.1Such sizeof(struct device), mainbus_match, mainbus_attach 531.1Such}; 541.1Such 551.1Suchint 561.2Suchmainbus_match(struct device *parent, struct cfdata *cf, void *aux) 571.1Such{ 581.1Such 591.2Such return (1); 601.1Such} 611.1Such 621.1Suchvoid 631.2Suchmainbus_attach(struct device *parent, struct device *self, void *aux) 641.1Such{ 651.2Such struct mainbus_attach_args *ma; 661.1Such 671.1Such printf("\n"); 681.1Such 691.2Such for (ma = mainbusdevs; ma->ma_name != NULL; ma++) 701.2Such config_found(self, ma, mainbus_print); 711.1Such} 721.1Such 731.1Suchint 741.2Suchmainbus_print(void *aux, const char *pnp) 751.1Such{ 761.1Such 771.2Such return (pnp ? QUIET : UNCONF); 781.1Such} 79