autoconf.c revision 1.1
11.1Shannken/* $NetBSD: autoconf.c,v 1.1 2003/03/11 10:57:55 hannken 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.1Shannken 391.1Shannken#include <sys/param.h> 401.1Shannken#include <sys/conf.h> 411.1Shannken#include <sys/device.h> 421.1Shannken#include <sys/systm.h> 431.1Shannken 441.1Shannkenstruct device *booted_device; 451.1Shannkenint booted_partition; 461.1Shannken 471.1Shannkenvoid 481.1Shannkencpu_configure(void) 491.1Shannken{ 501.1Shannken intr_init(); 511.1Shannken calc_delayconst(); 521.1Shannken 531.1Shannken if (config_rootfound("elb", NULL) == NULL) 541.1Shannken panic("configure: elb not configured"); 551.1Shannken 561.1Shannken printf("biomask %x netmask %x ttymask %x\n", (u_short)imask[IPL_BIO], 571.1Shannken (u_short)imask[IPL_NET], (u_short)imask[IPL_TTY]); 581.1Shannken 591.1Shannken (void)spl0(); 601.1Shannken 611.1Shannken /* 621.1Shannken * Now allow hardware interrupts. 631.1Shannken */ 641.1Shannken asm volatile ("wrteei 1"); 651.1Shannken} 661.1Shannken 671.1Shannkenvoid 681.1Shannkencpu_rootconf(void) 691.1Shannken{ 701.1Shannken setroot(booted_device, booted_partition); 711.1Shannken} 72