mainbus.c revision 1.4
11.4Sthorpej/* $NetBSD: mainbus.c,v 1.4 2002/10/02 05:32:58 thorpej 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.4SthorpejCFATTACH_DECL(mainbus, sizeof(struct device), 521.4Sthorpej mainbus_match, mainbus_attach, NULL, NULL); 531.1Such 541.1Suchint 551.2Suchmainbus_match(struct device *parent, struct cfdata *cf, void *aux) 561.1Such{ 571.1Such 581.2Such return (1); 591.1Such} 601.1Such 611.1Suchvoid 621.2Suchmainbus_attach(struct device *parent, struct device *self, void *aux) 631.1Such{ 641.2Such struct mainbus_attach_args *ma; 651.1Such 661.1Such printf("\n"); 671.1Such 681.2Such for (ma = mainbusdevs; ma->ma_name != NULL; ma++) 691.2Such config_found(self, ma, mainbus_print); 701.1Such} 711.1Such 721.1Suchint 731.2Suchmainbus_print(void *aux, const char *pnp) 741.1Such{ 751.1Such 761.2Such return (pnp ? QUIET : UNCONF); 771.1Such} 78