Change the kernel dev_t, representing a pointer to a specinfo structure,
[dragonfly.git] / sys / boot / pc32 / libi386 / libi386.h
CommitLineData
984263bc
MD
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
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 THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 *
5ee58eed 26 * $FreeBSD: src/sys/boot/i386/libi386/libi386.h,v 1.16 2003/05/01 03:56:29 peter Exp $
b13267a5 27 * $DragonFly: src/sys/boot/pc32/libi386/libi386.h,v 1.5 2006/09/10 01:26:31 dillon Exp $
984263bc
MD
28 */
29
30
31/*
32 * i386 fully-qualified device descriptor.
33 * Note, this must match the 'struct devdesc' declaration
34 * in bootstrap.h.
35 */
36struct i386_devdesc
37{
38 struct devsw *d_dev;
39 int d_type;
40 union
41 {
42 struct
43 {
44 int unit;
45 int slice;
46 int partition;
47 void *data;
48 } biosdisk;
49 struct
50 {
51 int unit;
52 void *data;
53 } bioscd;
54 struct
55 {
56 int unit; /* XXX net layer lives over these? */
57 } netif;
58 } d_kind;
59};
60
61int i386_getdev(void **vdev, const char *devspec, const char **path);
62char *i386_fmtdev(void *vdev);
63int i386_setcurrdev(struct env_var *ev, int flags, void *value);
64
65extern struct devdesc currdev; /* our current device */
66
67#define MAXDEV 31 /* maximum number of distinct devices */
68
69/* exported devices XXX rename? */
70extern struct devsw bioscd;
71extern struct devsw biosdisk;
72extern struct devsw pxedisk;
73extern struct fs_ops pxe_fsops;
74
75int bc_add(int biosdev); /* Register CD booted from. */
b13267a5 76int bc_getdev(struct i386_devdesc *dev); /* return cdev_t for (dev) */
984263bc
MD
77int bc_bios2unit(int biosdev); /* xlate BIOS device -> bioscd unit */
78int bc_unit2bios(int unit); /* xlate bioscd unit -> BIOS device */
79u_int32_t bd_getbigeom(int bunit); /* return geometry in bootinfo format */
80int bd_bios2unit(int biosdev); /* xlate BIOS device -> biosdisk unit */
81int bd_unit2bios(int unit); /* xlate biosdisk unit -> BIOS device */
b13267a5 82int bd_getdev(struct i386_devdesc *dev); /* return cdev_t for (dev) */
984263bc
MD
83
84ssize_t i386_copyin(const void *src, vm_offset_t dest, const size_t len);
85ssize_t i386_copyout(const vm_offset_t src, void *dest, const size_t len);
86ssize_t i386_readin(const int fd, vm_offset_t dest, const size_t len);
87
5ee58eed
MD
88struct preloaded_file;
89void bios_addsmapdata(struct preloaded_file *);
90void bios_getsmap(void);
91
984263bc
MD
92void bios_getmem(void);
93extern u_int32_t bios_basemem; /* base memory in bytes */
94extern u_int32_t bios_extmem; /* extended memory in bytes */
95extern vm_offset_t memtop;
96
87004482 97void biosacpi_detect(void);
5ee58eed 98
984263bc
MD
99void gateA20(void);
100
101int i386_autoload(void);
102
103int bi_getboothowto(char *kargs);
104vm_offset_t bi_copyenv(vm_offset_t addr);
5ee58eed
MD
105int bi_load32(char *args, int *howtop, int *bootdevp, vm_offset_t *bip,
106 vm_offset_t *modulep, vm_offset_t *kernend);
107int bi_load64(char *args, vm_offset_t *modulep, vm_offset_t *kernend);
984263bc
MD
108
109void pxe_enable(void *pxeinfo);