1176349Smarcel/*- 2176349Smarcel * Copyright (c) 1999 Michael Smith <msmith@freebsd.org> 3176349Smarcel * All rights reserved. 4176349Smarcel * 5176349Smarcel * Redistribution and use in source and binary forms, with or without 6176349Smarcel * modification, are permitted provided that the following conditions 7176349Smarcel * are met: 8176349Smarcel * 1. Redistributions of source code must retain the above copyright 9176349Smarcel * notice, this list of conditions and the following disclaimer. 10176349Smarcel * 2. Redistributions in binary form must reproduce the above copyright 11176349Smarcel * notice, this list of conditions and the following disclaimer in the 12176349Smarcel * documentation and/or other materials provided with the distribution. 13176349Smarcel * 14176349Smarcel * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15176349Smarcel * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16176349Smarcel * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17176349Smarcel * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18176349Smarcel * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19176349Smarcel * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20176349Smarcel * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21176349Smarcel * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22176349Smarcel * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23176349Smarcel * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24176349Smarcel * SUCH DAMAGE. 25176349Smarcel */ 26176349Smarcel 27176349Smarcel#include <sys/cdefs.h> 28176349Smarcel__FBSDID("$FreeBSD$"); 29176349Smarcel 30176349Smarcel#include <stand.h> 31176349Smarcel#include "bootstrap.h" 32176349Smarcel#include "libuboot.h" 33176349Smarcel 34176349Smarcel#if defined(LOADER_NET_SUPPORT) 35176349Smarcel#include "dev_net.h" 36176349Smarcel#endif 37176349Smarcel 38176349Smarcel/* 39176349Smarcel * We could use linker sets for some or all of these, but 40176349Smarcel * then we would have to control what ended up linked into 41176349Smarcel * the bootstrap. So it's easier to conditionalise things 42176349Smarcel * here. 43176349Smarcel * 44176349Smarcel * XXX rename these arrays to be consistent and less namespace-hostile 45176349Smarcel */ 46176349Smarcel 47176349Smarcel/* Exported for libstand */ 48176349Smarcelstruct devsw *devsw[] = { 49176349Smarcel#if defined(LOADER_DISK_SUPPORT) || defined(LOADER_CD9660_SUPPORT) 50204315Sraj &uboot_storage, 51176349Smarcel#endif 52176349Smarcel#if defined(LOADER_NET_SUPPORT) 53176349Smarcel &netdev, 54176349Smarcel#endif 55176349Smarcel NULL 56176349Smarcel}; 57176349Smarcel 58176349Smarcelstruct fs_ops *file_system[] = { 59176349Smarcel#if defined(LOADER_UFS_SUPPORT) 60176349Smarcel &ufs_fsops, 61176349Smarcel#endif 62176349Smarcel#if defined(LOADER_CD9660_SUPPORT) 63176349Smarcel &cd9660_fsops, 64176349Smarcel#endif 65176349Smarcel#if defined(LOADER_EXT2FS_SUPPORT) 66176349Smarcel &ext2fs_fsops, 67176349Smarcel#endif 68176485Smarcel#if defined(LOADER_NFS_SUPPORT) 69176349Smarcel &nfs_fsops, 70176349Smarcel#endif 71176349Smarcel#if defined(LOADER_TFTP_SUPPORT) 72176349Smarcel &tftp_fsops, 73176349Smarcel#endif 74176349Smarcel#if defined(LOADER_GZIP_SUPPORT) 75176349Smarcel &gzipfs_fsops, 76176349Smarcel#endif 77176349Smarcel#if defined(LOADER_BZIP2_SUPPORT) 78176349Smarcel &bzipfs_fsops, 79176349Smarcel#endif 80176349Smarcel NULL 81176349Smarcel}; 82176349Smarcel 83176349Smarcelstruct netif_driver *netif_drivers[] = { 84176349Smarcel#if defined(LOADER_NET_SUPPORT) 85176349Smarcel &uboot_net, 86176349Smarcel#endif 87176349Smarcel NULL, 88176349Smarcel}; 89176349Smarcel 90176349Smarcel/* Exported for PowerPC only */ 91176349Smarcel/* 92176349Smarcel * Sort formats so that those that can detect based on arguments 93176349Smarcel * rather than reading the file go first. 94176349Smarcel */ 95176349Smarcel 96176349Smarcelstruct file_format *file_formats[] = { 97186231Sraj &uboot_elf, 98186231Sraj NULL 99176349Smarcel}; 100176349Smarcel 101176349Smarcel/* 102176349Smarcel * Consoles 103176349Smarcel */ 104176349Smarcelextern struct console uboot_console; 105176349Smarcel 106176349Smarcelstruct console *consoles[] = { 107186231Sraj &uboot_console, 108186231Sraj NULL 109176349Smarcel}; 110