diff options
author | nyan <nyan@FreeBSD.org> | 2003-01-04 08:50:48 +0000 |
---|---|---|
committer | nyan <nyan@FreeBSD.org> | 2003-01-04 08:50:48 +0000 |
commit | 864080610ecb4bdf1e559a7f65f6e149c26ede85 (patch) | |
tree | 564ff0c6cce1ed927a6fa1c29c37132bcc9a33b1 /sbin | |
parent | d409ed88f5d1f0e447be9bda781b1812ae8b69b9 (diff) | |
download | FreeBSD-src-864080610ecb4bdf1e559a7f65f6e149c26ede85.zip FreeBSD-src-864080610ecb4bdf1e559a7f65f6e149c26ede85.tar.gz |
Rename the dos_partition structure for pc98 to pc98_partition.
Diffstat (limited to 'sbin')
-rw-r--r-- | sbin/bsdlabel/bsdlabel.c | 12 | ||||
-rw-r--r-- | sbin/disklabel/disklabel.c | 12 | ||||
-rw-r--r-- | sbin/fdisk_pc98/fdisk.c | 25 |
3 files changed, 35 insertions, 14 deletions
diff --git a/sbin/bsdlabel/bsdlabel.c b/sbin/bsdlabel/bsdlabel.c index 3d3139f..786ca62 100644 --- a/sbin/bsdlabel/bsdlabel.c +++ b/sbin/bsdlabel/bsdlabel.c @@ -658,7 +658,17 @@ makebootarea(char *boot, struct disklabel *dp, int f) if (read(b, boot, (int)dp->d_secsize) < 0) err(4, "%s", xxboot); (void)close(b); -#ifdef __i386__ +#ifdef PC98 + for (i = DOSPARTOFF, found = 0; + !found && i < (int)(DOSPARTOFF + NDOSPART * sizeof(struct pc98_partition)); + i++) + found = tmpbuf[i] != 0; + if (found) + memcpy((void *)&boot[DOSPARTOFF], + (void *)&tmpbuf[DOSPARTOFF], + NDOSPART * sizeof(struct pc98_partition)); + free(tmpbuf); +#elif defined(__i386__) for (i = DOSPARTOFF, found = 0; !found && i < (int)(DOSPARTOFF + NDOSPART*sizeof(struct dos_partition)); i++) diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c index 3d3139f..786ca62 100644 --- a/sbin/disklabel/disklabel.c +++ b/sbin/disklabel/disklabel.c @@ -658,7 +658,17 @@ makebootarea(char *boot, struct disklabel *dp, int f) if (read(b, boot, (int)dp->d_secsize) < 0) err(4, "%s", xxboot); (void)close(b); -#ifdef __i386__ +#ifdef PC98 + for (i = DOSPARTOFF, found = 0; + !found && i < (int)(DOSPARTOFF + NDOSPART * sizeof(struct pc98_partition)); + i++) + found = tmpbuf[i] != 0; + if (found) + memcpy((void *)&boot[DOSPARTOFF], + (void *)&tmpbuf[DOSPARTOFF], + NDOSPART * sizeof(struct pc98_partition)); + free(tmpbuf); +#elif defined(__i386__) for (i = DOSPARTOFF, found = 0; !found && i < (int)(DOSPARTOFF + NDOSPART*sizeof(struct dos_partition)); i++) diff --git a/sbin/fdisk_pc98/fdisk.c b/sbin/fdisk_pc98/fdisk.c index 4aba829..eb046f0 100644 --- a/sbin/fdisk_pc98/fdisk.c +++ b/sbin/fdisk_pc98/fdisk.c @@ -83,7 +83,7 @@ struct mboot { unsigned char padding[2]; /* force the longs to be long aligned */ unsigned char bootinst[510]; unsigned short int signature; - struct dos_partition parts[8]; + struct pc98_partition parts[8]; unsigned char large_sector_overflow[MAX_SEC_SIZE-MIN_SEC_SIZE]; }; #else /* PC98 */ @@ -219,7 +219,7 @@ main(int argc, char *argv[]) struct stat sb; int c, i; int partition = -1; - struct dos_partition *partp; + struct pc98_partition *partp; #ifdef PC98 while ((c = getopt(argc, argv, "Ba:f:istuv12345678")) != -1) @@ -319,7 +319,7 @@ main(int argc, char *argv[]) #ifdef PC98 printf("Part %11s %11s SID\n", "Start", "Size"); for (i = 0; i < NDOSPART; i++) { - partp = ((struct dos_partition *) &mboot.parts) + i; + partp = ((struct pc98_partition *) &mboot.parts) + i; if (partp->dp_sid == 0) continue; printf("%4d: %11lu %11lu 0x%02x\n", i + 1, @@ -437,17 +437,17 @@ print_s0(int which) print_part(which); } -static struct dos_partition mtpart; +static struct pc98_partition mtpart; static void print_part(int i) { - struct dos_partition *partp; + struct pc98_partition *partp; u_int64_t part_sz, part_mb; - partp = ((struct dos_partition *) &mboot.parts) + i - 1; + partp = ((struct pc98_partition *) &mboot.parts) + i - 1; - if (!bcmp(partp, &mtpart, sizeof (struct dos_partition))) { + if (!bcmp(partp, &mtpart, sizeof (struct pc98_partition))) { printf("<UNUSED>\n"); return; } @@ -522,8 +522,8 @@ static void init_sector0(unsigned long start) { #ifdef PC98 - struct dos_partition *partp = - (struct dos_partition *)(&mboot.parts[3]); + struct pc98_partition *partp = + (struct pc98_partition *)(&mboot.parts[3]); unsigned long size = disksecs - start; init_boot(); @@ -557,7 +557,8 @@ init_sector0(unsigned long start) static void change_part(int i) { - struct dos_partition *partp = ((struct dos_partition *) &mboot.parts) + i - 1; + struct pc98_partition *partp = + ((struct pc98_partition *) &mboot.parts) + i - 1; printf("The data for partition %d is:\n", i); print_part(i); @@ -566,7 +567,7 @@ change_part(int i) int tmp; if (i_flag) { - bzero((char *)partp, sizeof (struct dos_partition)); + bzero((char *)partp, sizeof (struct pc98_partition)); if (i == 4) { init_sector0(1); printf("\nThe static data for the DOS partition 4 has been reinitialized to:\n"); @@ -669,7 +670,7 @@ static void change_active(int which) { #ifdef PC98 - struct dos_partition *partp = ((struct dos_partition *) &mboot.parts); + struct pc98_partition *partp = ((struct pc98_partition *) &mboot.parts); int active, i, tmp; active = 8; |