autoconf.c revision 1.3
11.3Slukem/* $NetBSD: autoconf.c,v 1.3 2003/07/15 01:37:36 lukem Exp $ */ 21.1Shannken 31.1Shannken/*- 41.1Shannken * Copyright (c) 2003 The NetBSD Foundation, Inc. 51.1Shannken * All rights reserved. 61.1Shannken * 71.1Shannken * This code is derived from software contributed to The NetBSD Foundation 81.1Shannken * by Juergen Hannken-Illjes. 91.1Shannken * 101.1Shannken * Redistribution and use in source and binary forms, with or without 111.1Shannken * modification, are permitted provided that the following conditions 121.1Shannken * are met: 131.1Shannken * 1. Redistributions of source code must retain the above copyright 141.1Shannken * notice, this list of conditions and the following disclaimer. 151.1Shannken * 2. Redistributions in binary form must reproduce the above copyright 161.1Shannken * notice, this list of conditions and the following disclaimer in the 171.1Shannken * documentation and/or other materials provided with the distribution. 181.1Shannken * 3. All advertising materials mentioning features or use of this software 191.1Shannken * must display the following acknowledgement: 201.1Shannken * This product includes software developed by the NetBSD 211.1Shannken * Foundation, Inc. and its contributors. 221.1Shannken * 4. Neither the name of The NetBSD Foundation nor the names of its 231.1Shannken * contributors may be used to endorse or promote products derived 241.1Shannken * from this software without specific prior written permission. 251.1Shannken * 261.1Shannken * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 271.1Shannken * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 281.1Shannken * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 291.1Shannken * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 301.1Shannken * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 311.1Shannken * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 321.1Shannken * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 331.1Shannken * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 341.1Shannken * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 351.1Shannken * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 361.1Shannken * POSSIBILITY OF SUCH DAMAGE. 371.1Shannken */ 381.3Slukem 391.3Slukem#include <sys/cdefs.h> 401.3Slukem__KERNEL_RCSID(0, "$NetBSD: autoconf.c,v 1.3 2003/07/15 01:37:36 lukem Exp $"); 411.1Shannken 421.1Shannken#include <sys/param.h> 431.1Shannken#include <sys/conf.h> 441.1Shannken#include <sys/device.h> 451.1Shannken#include <sys/systm.h> 461.1Shannken 471.1Shannkenstruct device *booted_device; 481.1Shannkenint booted_partition; 491.1Shannken 501.1Shannkenvoid 511.1Shannkencpu_configure(void) 521.1Shannken{ 531.1Shannken intr_init(); 541.1Shannken calc_delayconst(); 551.1Shannken 561.1Shannken if (config_rootfound("elb", NULL) == NULL) 571.1Shannken panic("configure: elb not configured"); 581.1Shannken 591.1Shannken printf("biomask %x netmask %x ttymask %x\n", (u_short)imask[IPL_BIO], 601.1Shannken (u_short)imask[IPL_NET], (u_short)imask[IPL_TTY]); 611.1Shannken 621.1Shannken (void)spl0(); 631.1Shannken 641.1Shannken /* 651.1Shannken * Now allow hardware interrupts. 661.1Shannken */ 671.1Shannken asm volatile ("wrteei 1"); 681.1Shannken} 691.1Shannken 701.1Shannkenvoid 711.1Shannkencpu_rootconf(void) 721.1Shannken{ 731.1Shannken setroot(booted_device, booted_partition); 741.2Sthorpej} 751.2Sthorpej 761.2Sthorpejvoid 771.2Sthorpejdevice_register(struct device *dev, void *aux) 781.2Sthorpej{ 791.1Shannken} 80