Deleted Added
full compact
biosdisk.c (239243) biosdisk.c (241053)
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3 * Copyright (c) 2012 Andrey V. Elsukov <ae@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1998 Michael Smith <msmith@freebsd.org>
3 * Copyright (c) 2012 Andrey V. Elsukov <ae@FreeBSD.org>
4 * All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:

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

21 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 */
27
28#include <sys/cdefs.h>
29__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/biosdisk.c 239243 2012-08-13 21:04:01Z dim $");
29__FBSDID("$FreeBSD: head/sys/boot/i386/libi386/biosdisk.c 241053 2012-09-29 16:47:56Z ae $");
30
31/*
32 * BIOS disk device handling.
33 *
34 * Ideas and algorithms from:
35 *
36 * - NetBSD libi386/biosdisk.c
37 * - FreeBSD biosboot/disk.c

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

101static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
102 char *buf, size_t *rsize);
103static int bd_realstrategy(void *devdata, int flag, daddr_t dblk,
104 size_t size, char *buf, size_t *rsize);
105static int bd_open(struct open_file *f, ...);
106static int bd_close(struct open_file *f);
107static int bd_ioctl(struct open_file *f, u_long cmd, void *data);
108static void bd_print(int verbose);
30
31/*
32 * BIOS disk device handling.
33 *
34 * Ideas and algorithms from:
35 *
36 * - NetBSD libi386/biosdisk.c
37 * - FreeBSD biosboot/disk.c

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

101static int bd_strategy(void *devdata, int flag, daddr_t dblk, size_t size,
102 char *buf, size_t *rsize);
103static int bd_realstrategy(void *devdata, int flag, daddr_t dblk,
104 size_t size, char *buf, size_t *rsize);
105static int bd_open(struct open_file *f, ...);
106static int bd_close(struct open_file *f);
107static int bd_ioctl(struct open_file *f, u_long cmd, void *data);
108static void bd_print(int verbose);
109static void bd_cleanup(void);
109
110struct devsw biosdisk = {
111 "disk",
112 DEVT_DISK,
113 bd_init,
114 bd_strategy,
115 bd_open,
116 bd_close,
117 bd_ioctl,
118 bd_print,
110
111struct devsw biosdisk = {
112 "disk",
113 DEVT_DISK,
114 bd_init,
115 bd_strategy,
116 bd_open,
117 bd_close,
118 bd_ioctl,
119 bd_print,
119 NULL
120 bd_cleanup
120};
121
122/*
123 * Translate between BIOS device numbers and our private unit numbers.
124 */
125int
126bd_bios2unit(int biosdev)
127{

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

176 nbdinfo++;
177 if (base == 0x80)
178 nfd++;
179 }
180 }
181 return(0);
182}
183
121};
122
123/*
124 * Translate between BIOS device numbers and our private unit numbers.
125 */
126int
127bd_bios2unit(int biosdev)
128{

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

177 nbdinfo++;
178 if (base == 0x80)
179 nfd++;
180 }
181 }
182 return(0);
183}
184
185static void
186bd_cleanup(void)
187{
188
189 disk_cleanup(&biosdisk);
190}
191
184/*
185 * Try to detect a device supported by the legacy int13 BIOS
186 */
187static int
188bd_int13probe(struct bdinfo *bd)
189{
190 struct edd_params params;
191

--- 481 unchanged lines hidden ---
192/*
193 * Try to detect a device supported by the legacy int13 BIOS
194 */
195static int
196bd_int13probe(struct bdinfo *bd)
197{
198 struct edd_params params;
199

--- 481 unchanged lines hidden ---