199767f8919635c4928607450d9e0abb932109ceToomas Soome/*-
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Copyright (c) 1997
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Matthias Drochner. All rights reserved.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Redistribution and use in source and binary forms, with or without
199767f8919635c4928607450d9e0abb932109ceToomas Soome * modification, are permitted provided that the following conditions
199767f8919635c4928607450d9e0abb932109ceToomas Soome * are met:
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 1. Redistributions of source code must retain the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 2. Redistributions in binary form must reproduce the above copyright
199767f8919635c4928607450d9e0abb932109ceToomas Soome * notice, this list of conditions and the following disclaimer in the
199767f8919635c4928607450d9e0abb932109ceToomas Soome * documentation and/or other materials provided with the distribution.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 3. All advertising materials mentioning features or use of this software
199767f8919635c4928607450d9e0abb932109ceToomas Soome * must display the following acknowledgement:
199767f8919635c4928607450d9e0abb932109ceToomas Soome * This product includes software developed for the NetBSD Project
199767f8919635c4928607450d9e0abb932109ceToomas Soome * by Matthias Drochner.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * 4. The name of the author may not be used to endorse or promote products
199767f8919635c4928607450d9e0abb932109ceToomas Soome * derived from this software without specific prior written permission.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
199767f8919635c4928607450d9e0abb932109ceToomas Soome * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
199767f8919635c4928607450d9e0abb932109ceToomas Soome * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
199767f8919635c4928607450d9e0abb932109ceToomas Soome * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
199767f8919635c4928607450d9e0abb932109ceToomas Soome * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
199767f8919635c4928607450d9e0abb932109ceToomas Soome * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * $NetBSD: conf.c,v 1.2 1997/03/22 09:03:29 thorpej Exp $
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <sys/cdefs.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome__FBSDID("$FreeBSD$");
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include <stand.h>
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "libuserboot.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(USERBOOT_ZFS_SUPPORT)
199767f8919635c4928607450d9e0abb932109ceToomas Soome#include "../zfs/libzfs.h"
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*
199767f8919635c4928607450d9e0abb932109ceToomas Soome * We could use linker sets for some or all of these, but
199767f8919635c4928607450d9e0abb932109ceToomas Soome * then we would have to control what ended up linked into
199767f8919635c4928607450d9e0abb932109ceToomas Soome * the bootstrap. So it's easier to conditionalise things
199767f8919635c4928607450d9e0abb932109ceToomas Soome * here.
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * XXX rename these arrays to be consistent and less namespace-hostile
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Exported for libstand */
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct devsw *devsw[] = {
199767f8919635c4928607450d9e0abb932109ceToomas Soome &host_dev,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &userboot_disk,
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(USERBOOT_ZFS_SUPPORT)
199767f8919635c4928607450d9e0abb932109ceToomas Soome &zfs_dev,
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome NULL
199767f8919635c4928607450d9e0abb932109ceToomas Soome};
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct fs_ops *file_system[] = {
199767f8919635c4928607450d9e0abb932109ceToomas Soome &host_fsops,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &ufs_fsops,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &cd9660_fsops,
199767f8919635c4928607450d9e0abb932109ceToomas Soome#if defined(USERBOOT_ZFS_SUPPORT)
199767f8919635c4928607450d9e0abb932109ceToomas Soome &zfs_fsops,
199767f8919635c4928607450d9e0abb932109ceToomas Soome#endif
199767f8919635c4928607450d9e0abb932109ceToomas Soome &gzipfs_fsops,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &bzipfs_fsops,
199767f8919635c4928607450d9e0abb932109ceToomas Soome NULL
199767f8919635c4928607450d9e0abb932109ceToomas Soome};
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/* Exported for i386 only */
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Sort formats so that those that can detect based on arguments
199767f8919635c4928607450d9e0abb932109ceToomas Soome * rather than reading the file go first.
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern struct file_format i386_elf;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern struct file_format i386_elf_obj;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern struct file_format amd64_elf;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern struct file_format amd64_elf_obj;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct file_format *file_formats[] = {
199767f8919635c4928607450d9e0abb932109ceToomas Soome &i386_elf,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &i386_elf_obj,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &amd64_elf,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &amd64_elf_obj,
199767f8919635c4928607450d9e0abb932109ceToomas Soome NULL
199767f8919635c4928607450d9e0abb932109ceToomas Soome};
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soome/*
199767f8919635c4928607450d9e0abb932109ceToomas Soome * Consoles
199767f8919635c4928607450d9e0abb932109ceToomas Soome *
199767f8919635c4928607450d9e0abb932109ceToomas Soome * We don't prototype these in libuserboot.h because they require
199767f8919635c4928607450d9e0abb932109ceToomas Soome * data structures from bootstrap.h as well.
199767f8919635c4928607450d9e0abb932109ceToomas Soome */
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern struct console userboot_console;
199767f8919635c4928607450d9e0abb932109ceToomas Soomeextern struct console userboot_comconsole;
199767f8919635c4928607450d9e0abb932109ceToomas Soome
199767f8919635c4928607450d9e0abb932109ceToomas Soomestruct console *consoles[] = {
199767f8919635c4928607450d9e0abb932109ceToomas Soome &userboot_console,
199767f8919635c4928607450d9e0abb932109ceToomas Soome &userboot_comconsole,
199767f8919635c4928607450d9e0abb932109ceToomas Soome NULL
199767f8919635c4928607450d9e0abb932109ceToomas Soome};