1 1.16 christos /* $NetBSD: promdev.h,v 1.16 2010/08/25 20:16:49 christos 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 * 19 1.3 pk * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 20 1.3 pk * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 21 1.3 pk * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 22 1.3 pk * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 23 1.3 pk * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 24 1.3 pk * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 25 1.3 pk * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26 1.3 pk * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 27 1.3 pk * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 28 1.3 pk * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 29 1.3 pk * POSSIBILITY OF SUCH DAMAGE. 30 1.1 mrg */ 31 1.1 mrg 32 1.1 mrg #include <machine/bsd_openprom.h> 33 1.1 mrg 34 1.1 mrg struct promdata { 35 1.1 mrg int fd; /* Openboot descriptor */ 36 1.1 mrg struct saioreq *si; /* Oldmon IO request */ 37 1.1 mrg int devtype; /* Kind of device we're booting from */ 38 1.1 mrg #define DT_BLOCK 1 39 1.1 mrg #define DT_NET 2 40 1.1 mrg #define DT_BYTE 3 41 1.1 mrg /* Hooks for netif.c */ 42 1.12 uwe ssize_t (*xmit)(struct promdata *, void *, size_t); 43 1.12 uwe ssize_t (*recv)(struct promdata *, void *, size_t); 44 1.1 mrg }; 45 1.1 mrg 46 1.2 pk #define DDB_MAGIC0 ( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('0') ) 47 1.2 pk #define DDB_MAGIC1 ( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('1') ) 48 1.6 christos #define DDB_MAGIC2 ( ('D'<<24) | ('D'<<16) | ('B'<<8) | ('2') ) 49 1.2 pk 50 1.10 martin #define MAX_PROM_PATH 128 51 1.10 martin 52 1.10 martin extern char prom_bootdevice[MAX_PROM_PATH]; 53 1.1 mrg extern int cputyp, nbpg, pgofset, pgshift; 54 1.1 mrg extern int debug; 55 1.1 mrg 56 1.1 mrg /* Note: dvma_*() routines are for "oldmon" machines only */ 57 1.12 uwe extern void dvma_init(void); 58 1.12 uwe extern char *dvma_mapin(char *, size_t); 59 1.12 uwe extern char *dvma_mapout(char *, size_t); 60 1.12 uwe extern char *dvma_alloc(int); 61 1.12 uwe extern void dvma_free(char *, int); 62 1.5 pk 63 1.5 pk /* In net.c: */ 64 1.12 uwe extern int net_open(struct promdata *); 65 1.12 uwe extern int net_close(struct promdata *); 66 1.12 uwe extern int net_mountroot(void); 67 1.9 pk 68 1.9 pk /* In mmu.c */ 69 1.9 pk extern int mmu_init(void); 70 1.9 pk extern int (*pmap_map)(vaddr_t, paddr_t, psize_t); 71 1.9 pk extern int (*pmap_extract)(vaddr_t, paddr_t *); 72 1.5 pk 73 1.5 pk /* In str0.S: */ 74 1.12 uwe extern void sparc_noop(void); 75 1.5 pk extern void *romp; 76