Deleted Added
full compact
ebr.c (266176) ebr.c (271881)
1/*-
2 * Copyright (c) 2014 Juniper Networks, Inc.
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

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

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 */
26
27#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 2014 Juniper Networks, Inc.
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

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

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 */
26
27#include <sys/cdefs.h>
28__FBSDID("$FreeBSD: head/usr.bin/mkimg/ebr.c 266176 2014-05-15 19:19:57Z marcel $");
28__FBSDID("$FreeBSD: head/usr.bin/mkimg/ebr.c 271881 2014-09-19 23:16:02Z marcel $");
29
30#include <sys/types.h>
31#include <sys/diskmbr.h>
32#include <sys/endian.h>
33#include <sys/errno.h>
34#include <stdlib.h>
35#include <string.h>
36#include <unistd.h>

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

44#endif
45
46static struct mkimg_alias ebr_aliases[] = {
47 { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) },
48 { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) },
49 { ALIAS_NONE, 0 }
50};
51
29
30#include <sys/types.h>
31#include <sys/diskmbr.h>
32#include <sys/endian.h>
33#include <sys/errno.h>
34#include <stdlib.h>
35#include <string.h>
36#include <unistd.h>

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

44#endif
45
46static struct mkimg_alias ebr_aliases[] = {
47 { ALIAS_FAT32, ALIAS_INT2TYPE(DOSPTYP_FAT32) },
48 { ALIAS_FREEBSD, ALIAS_INT2TYPE(DOSPTYP_386BSD) },
49 { ALIAS_NONE, 0 }
50};
51
52static u_int
53ebr_metadata(u_int where)
52static lba_t
53ebr_metadata(u_int where, lba_t blk)
54{
54{
55 u_int secs;
56
55
57 secs = (where == SCHEME_META_PART_BEFORE) ? nsecs : 0;
58 return (secs);
56 blk += (where == SCHEME_META_PART_BEFORE) ? 1 : 0;
57 return (round_track(blk));
59}
60
61static void
62ebr_chs(u_char *cyl, u_char *hd, u_char *sec, uint32_t lba __unused)
63{
64
65 *cyl = 0xff; /* XXX */
66 *hd = 0xff; /* XXX */

--- 63 unchanged lines hidden ---
58}
59
60static void
61ebr_chs(u_char *cyl, u_char *hd, u_char *sec, uint32_t lba __unused)
62{
63
64 *cyl = 0xff; /* XXX */
65 *hd = 0xff; /* XXX */

--- 63 unchanged lines hidden ---