2008-02-16 22:13:11 +00:00
|
|
|
/*-
|
|
|
|
* Copyright (C) 2000 Benno Rice.
|
|
|
|
* Copyright (C) 2007 Semihalf, Rafal Jaworowski <raj@semihalf.com>
|
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* Redistribution and use in source and binary forms, with or without
|
|
|
|
* modification, are permitted provided that the following conditions
|
|
|
|
* are met:
|
|
|
|
* 1. Redistributions of source code must retain the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer.
|
|
|
|
* 2. Redistributions in binary form must reproduce the above copyright
|
|
|
|
* notice, this list of conditions and the following disclaimer in the
|
|
|
|
* documentation and/or other materials provided with the distribution.
|
|
|
|
*
|
|
|
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
|
|
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
|
|
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
|
|
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
|
|
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
|
|
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
|
|
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
|
|
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
|
|
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
|
|
|
* SUCH DAMAGE.
|
|
|
|
*
|
|
|
|
* $FreeBSD$
|
|
|
|
*/
|
|
|
|
|
|
|
|
struct uboot_devdesc
|
|
|
|
{
|
2008-03-12 16:01:34 +00:00
|
|
|
struct devsw *d_dev;
|
|
|
|
int d_type;
|
|
|
|
int d_unit;
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
void *data;
|
2009-05-05 16:29:08 +00:00
|
|
|
int pnum;
|
|
|
|
int ptype;
|
2008-03-12 16:01:34 +00:00
|
|
|
} disk;
|
|
|
|
} d_kind;
|
2008-02-16 22:13:11 +00:00
|
|
|
};
|
|
|
|
|
2008-11-19 17:34:28 +00:00
|
|
|
#define d_disk d_kind.disk
|
|
|
|
|
2009-05-05 16:29:08 +00:00
|
|
|
#define PTYPE_BSDLABEL 1
|
|
|
|
#define PTYPE_GPT 2
|
|
|
|
|
2008-02-16 22:13:11 +00:00
|
|
|
/*
|
|
|
|
* Default network packet alignment in memory
|
|
|
|
*/
|
2008-03-13 17:54:21 +00:00
|
|
|
#define PKTALIGN 32
|
2008-02-16 22:13:11 +00:00
|
|
|
|
2008-11-19 17:34:28 +00:00
|
|
|
int uboot_getdev(void **vdev, const char *devspec, const char **path);
|
|
|
|
char *uboot_fmtdev(void *vdev);
|
|
|
|
int uboot_setcurrdev(struct env_var *ev, int flags, const void *value);
|
2008-02-16 22:13:11 +00:00
|
|
|
|
2008-11-19 17:34:28 +00:00
|
|
|
extern int devs_no;
|
2008-03-13 17:54:21 +00:00
|
|
|
extern struct netif_driver uboot_net;
|
2008-11-19 17:34:28 +00:00
|
|
|
extern struct devsw uboot_storage;
|
2008-02-16 22:13:11 +00:00
|
|
|
|
|
|
|
ssize_t uboot_copyin(const void *src, vm_offset_t dest, const size_t len);
|
2008-03-13 17:54:21 +00:00
|
|
|
ssize_t uboot_copyout(const vm_offset_t src, void *dest, const size_t len);
|
|
|
|
ssize_t uboot_readin(const int fd, vm_offset_t dest, const size_t len);
|
2008-02-16 22:13:11 +00:00
|
|
|
extern int uboot_autoload(void);
|
|
|
|
|
|
|
|
struct preloaded_file;
|
|
|
|
struct file_format;
|
|
|
|
|
2008-03-13 17:54:21 +00:00
|
|
|
extern struct file_format uboot_elf;
|
2008-02-16 22:13:11 +00:00
|
|
|
|
2008-11-19 17:34:28 +00:00
|
|
|
void reboot(void);
|