Project

General

Profile

0001-sys-disklabel64.h-Define-BOOT2SIZE64-to-32-KB-for-bo.patch

liweitianux, 11/08/2017 07:07 AM

Download (3.76 KB)

View differences:

sbin/disklabel64/disklabel64.c
597 597
		return(lp);
598 598

  
599 599
	if (boot2buf == NULL) {
600
		boot2size = 32768;
600
		boot2size = BOOT2SIZE64;
601 601
		boot2buf = malloc(boot2size);
602 602
		bzero(boot2buf, boot2size);
603 603
	}
sys/kern/subr_disklabel64.c
460 460
	 *	 access to 4096 byte physical sector drives.
461 461
	 */
462 462
	lp->d_bbase = ressize;
463
	lp->d_pbase = lp->d_bbase + ((32768 + blkmask) & ~blkmask);
464 463
	lp->d_pbase = (lp->d_pbase + PALIGN_MASK) & ~(uint64_t)PALIGN_MASK;
464
	lp->d_pbase = lp->d_bbase + ((BOOT2SIZE64 + blkmask) & ~blkmask);
465 465

  
466 466
	/* adjust for slice offset so we are physically aligned */
467 467
	lp->d_pbase += 32768 - (sp->ds_offset * info->d_media_blksize) % 32768;
sys/sys/disklabel64.h
1 1
/*
2 2
 * Copyright (c) 2007 The DragonFly Project.  All rights reserved.
3
 * 
3
 *
4 4
 * This code is derived from software contributed to The DragonFly Project
5 5
 * by Matthew Dillon <dillon@backplane.com>
6
 * 
6
 *
7 7
 * Redistribution and use in source and binary forms, with or without
8 8
 * modification, are permitted provided that the following conditions
9 9
 * are met:
10
 * 
10
 *
11 11
 * 1. Redistributions of source code must retain the above copyright
12 12
 *    notice, this list of conditions and the following disclaimer.
13 13
 * 2. Redistributions in binary form must reproduce the above copyright
......
17 17
 * 3. Neither the name of The DragonFly Project nor the names of its
18 18
 *    contributors may be used to endorse or promote products derived
19 19
 *    from this software without specific, prior written permission.
20
 * 
20
 *
21 21
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22 22
 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23 23
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
......
30 30
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
31 31
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 32
 * SUCH DAMAGE.
33
 * 
34
 * $DragonFly: src/sys/sys/disklabel64.h,v 1.4 2007/06/19 06:39:10 dillon Exp $
35 33
 */
36 34

  
37 35
#ifndef _SYS_DISKLABEL64_H_
......
67 65
#define	RESPARTITIONS64	32
68 66
#endif
69 67

  
68
/*
69
 * Space within the label reserved for the stage2 boot code.
70
 */
71
#ifndef BOOT2SIZE64
72
#define BOOT2SIZE64	(1024 * 32)
73
#endif
74

  
75

  
70 76
#ifndef LOCORE
71 77

  
72 78
/*
......
91 97

  
92 98
	u_int64_t d_total_size;		/* total size incl everything (bytes) */
93 99
	u_int64_t d_bbase;		/* boot area base offset (bytes) */
94
					/* boot area is pbase - bbase */
100
					/* boot area is bbase - (pbase-1) */
95 101
	u_int64_t d_pbase;		/* first allocatable offset (bytes) */
96 102
	u_int64_t d_pstop;		/* last allocatable offset+1 (bytes) */
103
					/* pbase and pstop are physically aligned */
97 104
	u_int64_t d_abase;		/* location of backup copy if not 0 */
98 105

  
99 106
	u_char	  d_packname[64];
100
-