Home | History | Annotate | Line # | Download | only in ski
      1 /*	$NetBSD: conf.c,v 1.3 2016/08/04 16:22:40 scole Exp $	*/
      2 
      3 /*-
      4  * Copyright (c) 1997
      5  *	Matthias Drochner.  All rights reserved.
      6  *
      7  * Redistribution and use in source and binary forms, with or without
      8  * modification, are permitted provided that the following conditions
      9  * are met:
     10  * 1. Redistributions of source code must retain the above copyright
     11  *    notice, this list of conditions and the following disclaimer.
     12  * 2. Redistributions in binary form must reproduce the above copyright
     13  *    notice, this list of conditions and the following disclaimer in the
     14  *    documentation and/or other materials provided with the distribution.
     15  * 3. All advertising materials mentioning features or use of this software
     16  *    must display the following acknowledgement:
     17  *	This product includes software developed for the NetBSD Project
     18  *	by Matthias Drochner.
     19  * 4. The name of the author may not be used to endorse or promote products
     20  *    derived from this software without specific prior written permission.
     21  *
     22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
     23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
     24  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
     25  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
     26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
     27  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
     28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
     29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
     30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
     31  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
     32  *
     33  *	$NetBSD: conf.c,v 1.3 2016/08/04 16:22:40 scole Exp $
     34  */
     35 
     36 #include <sys/cdefs.h>
     37 
     38 #include <lib/libsa/stand.h>
     39 #include <lib/libsa/loadfile.h>
     40 
     41 #include <bootstrap.h>
     42 
     43 #include "libski.h"
     44 
     45 
     46 /* skifs related prototypes. Should move into a header file if this bloats. */
     47 
     48 extern int skifs_dev_strategy(void *, int, daddr_t, size_t, void *, size_t *);
     49 extern int skifs_dev_open(struct open_file *, ...);
     50 extern int skifs_dev_close(struct open_file *);
     51 
     52 extern int skifs_open(const char *, struct open_file *);
     53 extern int skifs_close(struct open_file *);
     54 extern int skifs_read(struct open_file *, void *, size_t, size_t *);
     55 
     56 #define skifs_write null_write
     57 
     58 extern off_t skifs_seek(struct open_file *, off_t, int);
     59 extern int skifs_stat(struct open_file *, struct stat *);
     60 
     61 extern struct devsw devsw[];
     62 
     63 
     64 /*
     65  * We could use linker sets for some or all of these, but
     66  * then we would have to control what ended up linked into
     67  * the bootstrap.  So it's easier to conditionalise things
     68  * here.
     69  *
     70  * XXX rename these arrays to be consistent and less namespace-hostile
     71  */
     72 
     73 struct devsw devsw[] = {
     74 	{"skidisk", skifs_dev_strategy, skifs_dev_open, skifs_dev_close, noioctl},
     75 };
     76 
     77 int ndevs = sizeof(devsw) / sizeof(struct devsw);
     78 
     79 /* XXX fix netif for ski if needed */
     80 struct netif_drvier *netif_drivers[] = {};
     81 int n_netif_drivers = 0;
     82 
     83 struct fs_ops file_system[] = {
     84 	FS_OPS(skifs),
     85 };
     86 
     87 int nfsys = sizeof(file_system) / sizeof(struct fs_ops);
     88 
     89 /* Exported for ia64 only */
     90 /*
     91  * Sort formats so that those that can detect based on arguments
     92  * rather than reading the file go first.
     93  */
     94 extern struct file_format ia64_elf;
     95 
     96 struct file_format *file_formats[] = {
     97 	&ia64_elf,
     98 	NULL
     99 };
    100 
    101 /*
    102  * Consoles
    103  *
    104  * We don't prototype these in libalpha.h because they require
    105  * data structures from bootstrap.h as well.
    106  */
    107 extern struct console ski_console;
    108 
    109 struct console *consoles[] = {
    110 	&ski_console,
    111 	NULL
    112 };
    113