1217044Snwhitehorn/*- 2224106Snwhitehorn * Copyright (C) 1999 Michael Smith <msmith@freebsd.org> 3217044Snwhitehorn * All rights reserved. 4217044Snwhitehorn * 5217044Snwhitehorn * Redistribution and use in source and binary forms, with or without 6217044Snwhitehorn * modification, are permitted provided that the following conditions 7217044Snwhitehorn * are met: 8217044Snwhitehorn * 1. Redistributions of source code must retain the above copyright 9217044Snwhitehorn * notice, this list of conditions and the following disclaimer. 10217044Snwhitehorn * 2. Redistributions in binary form must reproduce the above copyright 11217044Snwhitehorn * notice, this list of conditions and the following disclaimer in the 12217044Snwhitehorn * documentation and/or other materials provided with the distribution. 13217044Snwhitehorn * 14217044Snwhitehorn * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 15217044Snwhitehorn * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 16217044Snwhitehorn * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 17217044Snwhitehorn * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 18217044Snwhitehorn * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 19217044Snwhitehorn * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 20217044Snwhitehorn * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 21217044Snwhitehorn * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 22217044Snwhitehorn * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 23217044Snwhitehorn * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 24217044Snwhitehorn * SUCH DAMAGE. 25217044Snwhitehorn */ 26217044Snwhitehorn 27217044Snwhitehorn#include <sys/cdefs.h> 28217044Snwhitehorn__FBSDID("$FreeBSD$"); 29217044Snwhitehorn 30217044Snwhitehorn#include <stand.h> 31217044Snwhitehorn#include "bootstrap.h" 32217044Snwhitehorn 33217044Snwhitehorn#if defined(LOADER_NET_SUPPORT) 34217044Snwhitehorn#include "dev_net.h" 35217044Snwhitehorn#endif 36217044Snwhitehorn 37224106Snwhitehornextern struct devsw ps3disk; 38224857Snwhitehornextern struct devsw ps3cdrom; 39224106Snwhitehorn 40217044Snwhitehorn/* 41217044Snwhitehorn * We could use linker sets for some or all of these, but 42217044Snwhitehorn * then we would have to control what ended up linked into 43217044Snwhitehorn * the bootstrap. So it's easier to conditionalise things 44217044Snwhitehorn * here. 45217044Snwhitehorn * 46217044Snwhitehorn * XXX rename these arrays to be consistent and less namespace-hostile 47217044Snwhitehorn */ 48217044Snwhitehorn 49217044Snwhitehorn/* Exported for libstand */ 50217044Snwhitehornstruct devsw *devsw[] = { 51224857Snwhitehorn#if defined(LOADER_CD9660_SUPPORT) 52224857Snwhitehorn &ps3cdrom, 53224857Snwhitehorn#endif 54224857Snwhitehorn#if defined(LOADER_DISK_SUPPORT) 55217044Snwhitehorn &ps3disk, 56217044Snwhitehorn#endif 57217044Snwhitehorn#if defined(LOADER_NET_SUPPORT) 58217044Snwhitehorn &netdev, 59217044Snwhitehorn#endif 60217044Snwhitehorn NULL 61217044Snwhitehorn}; 62217044Snwhitehorn 63217044Snwhitehornstruct fs_ops *file_system[] = { 64217044Snwhitehorn#if defined(LOADER_UFS_SUPPORT) 65217044Snwhitehorn &ufs_fsops, 66217044Snwhitehorn#endif 67217044Snwhitehorn#if defined(LOADER_CD9660_SUPPORT) 68217044Snwhitehorn &cd9660_fsops, 69217044Snwhitehorn#endif 70217044Snwhitehorn#if defined(LOADER_EXT2FS_SUPPORT) 71217044Snwhitehorn &ext2fs_fsops, 72217044Snwhitehorn#endif 73217044Snwhitehorn#if defined(LOADER_NFS_SUPPORT) 74217044Snwhitehorn &nfs_fsops, 75217044Snwhitehorn#endif 76217044Snwhitehorn#if defined(LOADER_TFTP_SUPPORT) 77217044Snwhitehorn &tftp_fsops, 78217044Snwhitehorn#endif 79217044Snwhitehorn#if defined(LOADER_GZIP_SUPPORT) 80217044Snwhitehorn &gzipfs_fsops, 81217044Snwhitehorn#endif 82217044Snwhitehorn#if defined(LOADER_BZIP2_SUPPORT) 83217044Snwhitehorn &bzipfs_fsops, 84217044Snwhitehorn#endif 85217044Snwhitehorn NULL 86217044Snwhitehorn}; 87217044Snwhitehorn 88217044Snwhitehornextern struct netif_driver ps3net; 89217044Snwhitehorn 90217044Snwhitehornstruct netif_driver *netif_drivers[] = { 91217044Snwhitehorn#if defined(LOADER_NET_SUPPORT) 92217044Snwhitehorn &ps3net, 93217044Snwhitehorn#endif 94217044Snwhitehorn NULL, 95217044Snwhitehorn}; 96217044Snwhitehorn 97217044Snwhitehorn/* Exported for PowerPC only */ 98217044Snwhitehorn/* 99217044Snwhitehorn * Sort formats so that those that can detect based on arguments 100217044Snwhitehorn * rather than reading the file go first. 101217044Snwhitehorn */ 102217044Snwhitehorn 103217044Snwhitehornextern struct file_format ppc_elf64; 104217044Snwhitehorn 105217044Snwhitehornstruct file_format *file_formats[] = { 106217044Snwhitehorn &ppc_elf64, 107217044Snwhitehorn NULL 108217044Snwhitehorn}; 109217044Snwhitehorn 110217044Snwhitehorn/* 111217044Snwhitehorn * Consoles 112217044Snwhitehorn */ 113217044Snwhitehornextern struct console ps3console; 114217044Snwhitehorn 115217044Snwhitehornstruct console *consoles[] = { 116217044Snwhitehorn &ps3console, 117217044Snwhitehorn NULL 118217044Snwhitehorn}; 119217044Snwhitehorn 120217044Snwhitehorn/* 121217044Snwhitehorn * reloc - our load address 122217044Snwhitehorn */ 123217044Snwhitehornvm_offset_t reloc = RELOC; 124