xref: /freebsd/stand/efi/gptboot/drv.h (revision b3e7694832e81d7a904a10f525f8797b753bf0d3)
1*f61f5a0bSWarner Losh /*-
2*f61f5a0bSWarner Losh  * Copyright (c) 2019 Netflix, Inc
3*f61f5a0bSWarner Losh  *
4*f61f5a0bSWarner Losh  * Redistribution and use in source and binary forms, with or without
5*f61f5a0bSWarner Losh  * modification, are permitted provided that the following conditions
6*f61f5a0bSWarner Losh  * are met:
7*f61f5a0bSWarner Losh  * 1. Redistributions of source code must retain the above copyright
8*f61f5a0bSWarner Losh  *    notice, this list of conditions and the following disclaimer.
9*f61f5a0bSWarner Losh  * 2. Redistributions in binary form must reproduce the above copyright
10*f61f5a0bSWarner Losh  *    notice, this list of conditions and the following disclaimer in the
11*f61f5a0bSWarner Losh  *    documentation and/or other materials provided with the distribution.
12*f61f5a0bSWarner Losh  *
13*f61f5a0bSWarner Losh  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14*f61f5a0bSWarner Losh  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15*f61f5a0bSWarner Losh  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16*f61f5a0bSWarner Losh  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17*f61f5a0bSWarner Losh  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18*f61f5a0bSWarner Losh  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19*f61f5a0bSWarner Losh  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20*f61f5a0bSWarner Losh  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21*f61f5a0bSWarner Losh  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22*f61f5a0bSWarner Losh  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23*f61f5a0bSWarner Losh  * SUCH DAMAGE.
24*f61f5a0bSWarner Losh  */
25*f61f5a0bSWarner Losh 
26*f61f5a0bSWarner Losh #ifndef _DRV_H_
27*f61f5a0bSWarner Losh #define _DRV_H_
28*f61f5a0bSWarner Losh 
29*f61f5a0bSWarner Losh struct dsk {
30*f61f5a0bSWarner Losh 	int part;
31*f61f5a0bSWarner Losh 	daddr_t start;
32*f61f5a0bSWarner Losh 	void *devinfo;		/* Really a dev_into_t *, but that's not in scope */
33*f61f5a0bSWarner Losh };
34*f61f5a0bSWarner Losh 
35*f61f5a0bSWarner Losh int drvread(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk);
36*f61f5a0bSWarner Losh int drvwrite(struct dsk *dskp, void *buf, daddr_t lba, unsigned nblk);
37*f61f5a0bSWarner Losh uint64_t drvsize(struct dsk *dskp);
38*f61f5a0bSWarner Losh 
39*f61f5a0bSWarner Losh #endif	/* !_DRV_H_ */
40