conf.c revision 108100
151053Smsmith/*- 251053Smsmith * Copyright (c) 1999 Michael Smith <msmith@freebsd.org> 351053Smsmith * All rights reserved. 451053Smsmith * 551053Smsmith * Redistribution and use in source and binary forms, with or without 651053Smsmith * modification, are permitted provided that the following conditions 751053Smsmith * are met: 851053Smsmith * 1. Redistributions of source code must retain the above copyright 951053Smsmith * notice, this list of conditions and the following disclaimer. 1051053Smsmith * 2. Redistributions in binary form must reproduce the above copyright 1151053Smsmith * notice, this list of conditions and the following disclaimer in the 1251053Smsmith * documentation and/or other materials provided with the distribution. 1351053Smsmith * 1451053Smsmith * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1551053Smsmith * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1651053Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1751053Smsmith * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1851053Smsmith * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1951053Smsmith * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2051053Smsmith * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2151053Smsmith * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2251053Smsmith * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2351053Smsmith * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2451053Smsmith * SUCH DAMAGE. 2551053Smsmith * 2651053Smsmith * $FreeBSD: head/sys/boot/powerpc/ofw/conf.c 108100 2002-12-19 19:34:59Z jake $ 2751053Smsmith */ 2851053Smsmith 2951053Smsmith#include <stand.h> 3084617Sbenno#include "bootstrap.h" 3167227Sobrien#include "libofw.h" 3284617Sbenno#include "openfirm.h" 3367227Sobrien 3467227Sobrien#if defined(LOADER_NET_SUPPORT) 3551053Smsmith#include "dev_net.h" 3651053Smsmith#endif 3751053Smsmith 3851053Smsmith/* 3951053Smsmith * We could use linker sets for some or all of these, but 4051053Smsmith * then we would have to control what ended up linked into 4151053Smsmith * the bootstrap. So it's easier to conditionalise things 4251053Smsmith * here. 4351053Smsmith * 4451053Smsmith * XXX rename these arrays to be consistent and less namespace-hostile 4551053Smsmith */ 4651053Smsmith 4751053Smsmith/* Exported for libstand */ 4851053Smsmithstruct devsw *devsw[] = { 4951053Smsmith#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CDROM_SUPPORT) 5067227Sobrien &ofwdisk, 5151053Smsmith#endif 5267227Sobrien#if defined(LOADER_NET_SUPPORT) 5368548Sbenno &netdev, 5451053Smsmith#endif 5551053Smsmith NULL 5651053Smsmith}; 5751053Smsmith 5851053Smsmithstruct fs_ops *file_system[] = { 5967227Sobrien#ifdef LOADER_UFS_SUPPORT 6051053Smsmith &ufs_fsops, 6151053Smsmith#endif 6251053Smsmith#ifdef LOADER_CDROM_SUPPORT 6351053Smsmith &cd9660_fsops, 6451053Smsmith#endif 6559767Sjlemon#ifdef LOADER_EXT2FS_SUPPORT 6659767Sjlemon &ext2fs_fsops, 6759767Sjlemon#endif 6851053Smsmith#ifdef LOADER_NET_SUPPORT 6951053Smsmith &nfs_fsops, 7051053Smsmith#endif 71108100Sjake &gzipfs_fsops, 7251053Smsmith NULL 7351053Smsmith}; 7451053Smsmith 7567227Sobrienstruct netif_driver *netif_drivers[] = { 7651053Smsmith#ifdef LOADER_NET_SUPPORT 7768548Sbenno &ofwnet, 7867227Sobrien#endif 7968548Sbenno NULL, 8051053Smsmith}; 8151053Smsmith 8267227Sobrien/* Exported for PowerPC only */ 8351053Smsmith/* 8451053Smsmith * Sort formats so that those that can detect based on arguments 8551053Smsmith * rather than reading the file go first. 8651053Smsmith */ 8751053Smsmith 8859854Sbpstruct file_format *file_formats[] = { 8984617Sbenno &ofw_elf, 9051053Smsmith NULL 9151053Smsmith}; 9251053Smsmith 9351053Smsmith/* 9451053Smsmith * Consoles 9551053Smsmith * 9651053Smsmith * We don't prototype these in libalpha.h because they require 9751053Smsmith * data structures from bootstrap.h as well. 9851053Smsmith */ 9967227Sobrienextern struct console ofwconsole; 10051053Smsmith 10151053Smsmithstruct console *consoles[] = { 10267227Sobrien &ofwconsole, 10351053Smsmith NULL 10451053Smsmith}; 10584617Sbenno 10684617Sbenno/* 10784617Sbenno * reloc - our load address 10884617Sbenno */ 10984617Sbennovm_offset_t reloc = RELOC; 110