/*-1* Copyright (c) 1999 Michael Smith <[email protected]>2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND14* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE15* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE16* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE17* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL18* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS19* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)20* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT21* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY22* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF23* SUCH DAMAGE.24*/2526#include <stand.h>27#include "bootstrap.h"28#include "libofw.h"29#include "openfirm.h"3031#if defined(LOADER_NET_SUPPORT)32#include "dev_net.h"33#endif3435/* Make sure we have an explicit reference to exit so libsa's panic pulls in the MD exit */36void (*exitfn)(int) = exit;3738/*39* We could use linker sets for some or all of these, but40* then we would have to control what ended up linked into41* the bootstrap. So it's easier to conditionalise things42* here.43*44* XXX rename these arrays to be consistent and less namespace-hostile45*/4647/* Exported for libsa */48struct devsw *devsw[] = {49#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT)50&ofwdisk,51#endif52#if defined(LOADER_NET_SUPPORT)53&ofw_netdev,54#endif55NULL56};5758struct fs_ops *file_system[] = {59#if defined(LOADER_UFS_SUPPORT)60&ufs_fsops,61#endif62#if defined(LOADER_CD9660_SUPPORT)63&cd9660_fsops,64#endif65#if defined(LOADER_EXT2FS_SUPPORT)66&ext2fs_fsops,67#endif68#if defined(LOADER_MSDOS_SUPPORT)69&dosfs_fsops,70#endif71#if defined(LOADER_NFS_SUPPORT)72&nfs_fsops,73#endif74#if defined(LOADER_TFTP_SUPPORT)75&tftp_fsops,76#endif77#if defined(LOADER_GZIP_SUPPORT)78&gzipfs_fsops,79#endif80#if defined(LOADER_BZIP2_SUPPORT)81&bzipfs_fsops,82#endif83NULL84};8586struct netif_driver *netif_drivers[] = {87#if defined(LOADER_NET_SUPPORT)88&ofwnet,89#endif90NULL,91};9293/* Exported for PowerPC only */94/*95* Sort formats so that those that can detect based on arguments96* rather than reading the file go first.97*/9899extern struct file_format ofw_elf;100extern struct file_format ofw_elf64;101102struct file_format *file_formats[] = {103&ofw_elf,104&ofw_elf64,105NULL106};107108/*109* Consoles110*111* We don't prototype these in libofw.h because they require112* data structures from bootstrap.h as well.113*/114extern struct console ofwconsole;115116struct console *consoles[] = {117&ofwconsole,118NULL119};120121/*122* reloc - our load address123*/124vm_offset_t reloc = RELOC;125126127