/*-1* Copyright (C) 2000 Benno Rice.2* All rights reserved.3*4* Redistribution and use in source and binary forms, with or without5* modification, are permitted provided that the following conditions6* are met:7* 1. Redistributions of source code must retain the above copyright8* notice, this list of conditions and the following disclaimer.9* 2. Redistributions in binary form must reproduce the above copyright10* notice, this list of conditions and the following disclaimer in the11* documentation and/or other materials provided with the distribution.12*13* THIS SOFTWARE IS PROVIDED BY Benno Rice ``AS IS'' AND ANY EXPRESS OR14* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES15* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.16* IN NO EVENT SHALL TOOLS GMBH BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,17* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,18* PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;19* OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,20* WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR21* OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF22* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.23*/2425#include "openfirm.h"26#include <readin.h>2728#define DEVT_OFDISK 10012930struct ofw_devdesc {31struct devdesc dd;32union {33struct {34ihandle_t d_handle;35char d_path[256];36};37struct {38uint64_t pool_guid;39uint64_t root_guid;40};41};42};4344extern int ofw_getdev(void **vdev, const char *devspec, const char **path);4546extern struct devsw ofwdisk;47extern struct devsw ofw_netdev;48extern struct netif_driver ofwnet;4950int ofwn_getunit(const char *);5152ssize_t ofw_copyin(const void *src, vm_offset_t dest, const size_t len);53ssize_t ofw_copyout(const vm_offset_t src, void *dest, const size_t len);54ssize_t ofw_readin(readin_handle_t fd, vm_offset_t dest, const size_t len);5556extern int ofw_boot(void);57extern int ofw_autoload(void);5859void ofw_memmap(int);6061phandle_t ofw_path_to_handle(const char *ofwpath, const char *want_type, const char **path);62int ofw_common_parsedev(struct devdesc **dev, const char *devspec, const char **path,63const char *ofwtype);6465struct preloaded_file;66struct file_format;6768extern void reboot(void);6970struct ofw_reg71{72cell_t base;73cell_t size;74};7576struct ofw_reg277{78cell_t base_hi;79cell_t base_lo;80cell_t size;81};8283extern int (*openfirmware)(void *);848586