mainbus.c revision 1.5
11.5Slukem/* $NetBSD: mainbus.c,v 1.5 2003/07/15 01:37:39 lukem 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.5Slukem 361.5Slukem#include <sys/cdefs.h> 371.5Slukem__KERNEL_RCSID(0, "$NetBSD: mainbus.c,v 1.5 2003/07/15 01:37:39 lukem Exp $"); 381.1Such 391.1Such#include <sys/param.h> 401.1Such#include <sys/systm.h> 411.1Such#include <sys/device.h> 421.2Such#include <machine/autoconf.h> 431.1Such 441.2Suchint mainbus_match(struct device *, struct cfdata *, void *); 451.2Suchvoid mainbus_attach(struct device *, struct device *, void *); 461.2Suchint mainbus_print(void *, const char *); 471.2Such 481.2Suchstruct mainbus_attach_args mainbusdevs[] = { 491.2Such { "cpu" }, 501.2Such { "shb" }, 511.2Such { NULL } /* terminator */ 521.2Such}; 531.1Such 541.4SthorpejCFATTACH_DECL(mainbus, sizeof(struct device), 551.4Sthorpej mainbus_match, mainbus_attach, NULL, NULL); 561.1Such 571.1Suchint 581.2Suchmainbus_match(struct device *parent, struct cfdata *cf, void *aux) 591.1Such{ 601.1Such 611.2Such return (1); 621.1Such} 631.1Such 641.1Suchvoid 651.2Suchmainbus_attach(struct device *parent, struct device *self, void *aux) 661.1Such{ 671.2Such struct mainbus_attach_args *ma; 681.1Such 691.1Such printf("\n"); 701.1Such 711.2Such for (ma = mainbusdevs; ma->ma_name != NULL; ma++) 721.2Such config_found(self, ma, mainbus_print); 731.1Such} 741.1Such 751.1Suchint 761.2Suchmainbus_print(void *aux, const char *pnp) 771.1Such{ 781.1Such 791.2Such return (pnp ? QUIET : UNCONF); 801.1Such} 81