Home | History | Annotate | Line # | Download | only in common
promdev.h revision 1.5.4.1
      1  1.5.4.1  thorpej /*	$NetBSD: promdev.h,v 1.5.4.1 1999/06/21 01:01:55 thorpej Exp $ */
      2      1.1      mrg 
      3      1.3       pk /*-
      4      1.3       pk  * Copyright (c) 1998 The NetBSD Foundation, Inc.
      5      1.1      mrg  * All rights reserved.
      6      1.1      mrg  *
      7      1.3       pk  * This code is derived from software contributed to The NetBSD Foundation
      8      1.3       pk  * by Paul Kranenburg.
      9      1.3       pk  *
     10      1.1      mrg  * Redistribution and use in source and binary forms, with or without
     11      1.1      mrg  * modification, are permitted provided that the following conditions
     12      1.1      mrg  * are met:
     13      1.1      mrg  * 1. Redistributions of source code must retain the above copyright
     14      1.1      mrg  *    notice, this list of conditions and the following disclaimer.
     15      1.1      mrg  * 2. Redistributions in binary form must reproduce the above copyright
     16      1.1      mrg  *    notice, this list of conditions and the following disclaimer in the
     17      1.1      mrg  *    documentation and/or other materials provided with the distribution.
     18      1.1      mrg  * 3. All advertising materials mentioning features or use of this software
     19      1.1      mrg  *    must display the following acknowledgement:
     20      1.3       pk  *        This product includes software developed by the NetBSD
     21      1.3       pk  *        Foundation, Inc. and its contributors.
     22      1.3       pk  * 4. Neither the name of The NetBSD Foundation nor the names of its
     23      1.3       pk  *    contributors may be used to endorse or promote products derived
     24      1.3       pk  *    from this software without specific prior written permission.
     25      1.1      mrg  *
     26      1.3       pk  * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
     27      1.3       pk  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
     28      1.3       pk  * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
     29      1.3       pk  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
     30      1.3       pk  * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
     31      1.3       pk  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
     32      1.3       pk  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
     33      1.3       pk  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
     34      1.3       pk  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
     35      1.3       pk  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     36      1.3       pk  * POSSIBILITY OF SUCH DAMAGE.
     37      1.1      mrg  */
     38      1.1      mrg 
     39      1.1      mrg #include <machine/bsd_openprom.h>
     40      1.1      mrg 
     41      1.1      mrg struct promdata {
     42      1.1      mrg 	int	fd;			/* Openboot descriptor */
     43      1.1      mrg 	struct	saioreq *si;		/* Oldmon IO request */
     44      1.1      mrg 	int	devtype;		/* Kind of device we're booting from */
     45      1.1      mrg #define DT_BLOCK	1
     46      1.1      mrg #define DT_NET		2
     47      1.1      mrg #define DT_BYTE		3
     48      1.1      mrg 	/* Hooks for netif.c */
     49  1.5.4.1  thorpej 	ssize_t	(*xmit) __P((struct promdata *, void *, size_t));
     50  1.5.4.1  thorpej 	ssize_t	(*recv) __P((struct promdata *, void *, size_t));
     51      1.1      mrg };
     52      1.1      mrg 
     53      1.2       pk #define DDB_MAGIC0	( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('0') )
     54      1.2       pk #define DDB_MAGIC1	( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('1') )
     55  1.5.4.1  thorpej #define DDB_MAGIC2	( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('2') )
     56      1.2       pk 
     57      1.5       pk extern time_t	getsecs __P((void));
     58      1.5       pk extern void	prom_getether __P((int, u_char *));
     59      1.1      mrg extern char	*prom_bootdevice;
     60      1.1      mrg extern int	cputyp, nbpg, pgofset, pgshift;
     61      1.1      mrg extern int	debug;
     62      1.1      mrg 
     63      1.1      mrg /* Note: dvma_*() routines are for "oldmon" machines only */
     64      1.5       pk extern void	dvma_init __P((void));
     65      1.1      mrg extern char	*dvma_mapin __P((char *, size_t));
     66      1.1      mrg extern char	*dvma_mapout __P((char *, size_t));
     67      1.1      mrg extern char	*dvma_alloc __P((int));
     68      1.5       pk extern void	dvma_free __P((char *, int));
     69      1.5       pk 
     70      1.5       pk /* In net.c: */
     71      1.5       pk extern int	net_open __P((struct promdata *));
     72      1.5       pk extern int	net_close __P((struct promdata *));
     73      1.5       pk extern int	net_mountroot __P((void));
     74      1.5       pk 
     75      1.5       pk /* In str0.S: */
     76      1.5       pk extern void	sparc_noop __P((void));
     77      1.5       pk extern void	*romp;
     78