Deleted Added
full compact
libofw.h (96423) libofw.h (106738)
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

--- 8 unchanged lines hidden (view full) ---

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 *
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

--- 8 unchanged lines hidden (view full) ---

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 96423 2002-05-11 21:30:46Z jake $
25 * $FreeBSD: head/sys/boot/ofw/libofw/libofw.h 106738 2002-11-10 19:17:36Z jake $
26 */
27
28#include "openfirm.h"
29
30/* Note: Must match the 'struct devdesc' in bootstrap.h */
31struct ofw_devdesc {
32 struct devsw *d_dev;
33 int d_type;
26 */
27
28#include "openfirm.h"
29
30/* Note: Must match the 'struct devdesc' in bootstrap.h */
31struct ofw_devdesc {
32 struct devsw *d_dev;
33 int d_type;
34 union {
35 struct {
36 phandle_t handle; /* OFW handle */
37 unsigned long partoff; /* sector offset */
38 int unit; /* disk number */
39 char path[64]; /* OFW path */
40 int slice; /* slice# */
41 int partition; /* partition in slice */
42 int bsize; /* block size */
43 } ofwdisk;
44 struct {
45 int unit;
46 char path[64];
47 void *dmabuf;
48 } netif;
49 } d_kind;
50/*
51 * Keeping this around so I know what came from the NetBSD stuff.
52 * I've made a wild guess as to what goes where, but I have no idea if it's
53 * right.
54 *
55 * void *dmabuf;
56 */
34 phandle_t d_handle;
35 char d_path[256];
57};
58
36};
37
59#define MAXDEV 31 /* Maximum number of devices. */
60
61/* Known types. Use the same as alpha for consistancy. */
62#define DEVT_NONE 0
63#define DEVT_DISK 1
64#define DEVT_NET 2
65
66extern int ofw_getdev(void **vdev, const char *devspec, const char **path);
38extern int ofw_getdev(void **vdev, const char *devspec, const char **path);
67extern char *ofw_fmtdev(void *vdev);
68extern int ofw_parseofwdev(struct ofw_devdesc *, const char *devspec);
69extern int ofw_setcurrdev(struct env_var *ev, int flags, void *value);
70
71extern struct devsw ofwdisk;
72extern struct netif_driver ofwnet;
73
39extern int ofw_setcurrdev(struct env_var *ev, int flags, void *value);
40
41extern struct devsw ofwdisk;
42extern struct netif_driver ofwnet;
43
74void ofwd_enter_dev(const char *);
75int ofwn_getunit(const char *);
76
77ssize_t ofw_copyin(const void *src, vm_offset_t dest, const size_t len);
78ssize_t ofw_copyout(const vm_offset_t src, void *dest, const size_t len);
79ssize_t ofw_readin(const int fd, vm_offset_t dest, const size_t len);
80
44int ofwn_getunit(const char *);
45
46ssize_t ofw_copyin(const void *src, vm_offset_t dest, const size_t len);
47ssize_t ofw_copyout(const vm_offset_t src, void *dest, const size_t len);
48ssize_t ofw_readin(const int fd, vm_offset_t dest, const size_t len);
49
81void ofw_devsearch_init(void);
82int ofw_devsearch(const char *, char *);
83int ofw_devicetype(char *);
84
85extern int ofw_boot(void);
86extern int ofw_autoload(void);
87
88void ofw_memmap(void);
89void *ofw_alloc_heap(unsigned int);
90void ofw_release_heap(void);
91
92struct preloaded_file;
93struct file_format;
94
95int ofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **);
96int ofw_elf_exec(struct preloaded_file *);
97
98extern struct file_format ofw_elf;
99
100extern void reboot(void);
101
50extern int ofw_boot(void);
51extern int ofw_autoload(void);
52
53void ofw_memmap(void);
54void *ofw_alloc_heap(unsigned int);
55void ofw_release_heap(void);
56
57struct preloaded_file;
58struct file_format;
59
60int ofw_elf_loadfile(char *, vm_offset_t, struct preloaded_file **);
61int ofw_elf_exec(struct preloaded_file *);
62
63extern struct file_format ofw_elf;
64
65extern void reboot(void);
66
102extern int main(int (*openfirm)(void *));
103
104struct ofw_reg
105{
106 cell_t base;
107 cell_t size;
108};
67struct ofw_reg
68{
69 cell_t base;
70 cell_t size;
71};
72
73extern int (*openfirmware)(void *);