libofw.h revision 67204
1/* 2 * Copyright (C) 2000 Benno Rice. 3 * All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. 10 * 2. Redistributions in binary form must reproduce the above copyright 11 * notice, this list of conditions and the following disclaimer in the 12 * documentation and/or other materials provided with the distribution. 13 * 14 * THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 17 * IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 18 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 19 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 20 * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 21 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 22 * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 23 * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 24 * 25 * $FreeBSD: head/sys/boot/ofw/libofw/libofw.h 67204 2000-10-16 10:46:22Z obrien $ 26 */ 27 28/* Note: Must match the 'struct devdesc' in bootstrap.h */ 29struct ofw_devdesc { 30 struct devsw *d_dev; 31 int d_type; 32 union { 33 struct { 34 int unit; 35 int partition; 36 int slice; 37 int bsize; 38 void *dmabuf; 39 } ofwdisk; 40 struct { 41 int unit; 42 void *dmabuf; 43 } netif; 44 } d_kind; 45/* 46 * Keeping this around so I know what came from the NetBSD stuff. 47 * I've made a wild guess as to what goes where, but I have no idea if it's 48 * right. 49 * 50 * u_long partoff; 51 * int bsize; 52 * void *dmabuf; 53 */ 54}; 55 56#define MAXDEV 31 /* Maximum number of devices. */ 57 58/* Known types. Use the same as alpha for consistancy. */ 59#define DEVT_NONE 0 60#define DEVT_DISK 1 61#define DEVT_NET 2 62 63extern int ofw_getdev(void **vdev, const char *devspec, const char **path); 64extern char *ofw_fmtdev(void *vdev); 65extern int ofw_setcurrdev(struct env_var *ev, int flags, void *value); 66 67extern struct devsw ofwdisk; 68extern struct devsw ofwnet; 69 70ssize_t ofw_copyin(const void *src, vm_offset_t dest, const size_t len); 71ssize_t ofw_copyout(const vm_offset_t src, void *dest, const size_t len); 72ssize_t ofw_readin(const int fd, vm_offset_t dest, const size_t len); 73 74extern int ofw_boot(void); 75extern int ofw_autoload(void); 76 77extern void reboot(void); 78 79extern int main(int (*openfirm)(void *)); 80