diff options
author | marcel <marcel@FreeBSD.org> | 2013-08-07 00:00:48 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2013-08-07 00:00:48 +0000 |
commit | 9f2f2e171a6de4c6d713a50366f3572946665fb5 (patch) | |
tree | b8704cff2de99c4cf2da972288c8d1271ec33598 /sys/boot/pc98 | |
parent | f5fd32bca5d6cadbe86d031375653c183adce356 (diff) | |
download | FreeBSD-src-9f2f2e171a6de4c6d713a50366f3572946665fb5.zip FreeBSD-src-9f2f2e171a6de4c6d713a50366f3572946665fb5.tar.gz |
Change <sys/diskpc98.h> to not redefine the same symbols that are
being defined in <sys/diskmbr.h>. Instead give the symbols here a
"PC98_" prefix. This way, both <sys/diskmbr.h> and <sys/diskpc98.h>
can be included in the same C source file.
The renaming is trivial. The only gotcha is that DOSBBSECTOR is
also redefined from 0 to 1. This because DOSBBSECTOR was always
used in conjunction with an addition of 1. The PC98_BBSECTOR symbol
is defined as 1 and the expression is simplified.
Note: it is not believed that ports are seriously impacted; or at
all for that matter.
Approved by: nyan@
Diffstat (limited to 'sys/boot/pc98')
-rw-r--r-- | sys/boot/pc98/boot2/boot2.c | 14 | ||||
-rw-r--r-- | sys/boot/pc98/libpc98/biosdisk.c | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/sys/boot/pc98/boot2/boot2.c b/sys/boot/pc98/boot2/boot2.c index 296ca55..3d3e5d2 100644 --- a/sys/boot/pc98/boot2/boot2.c +++ b/sys/boot/pc98/boot2/boot2.c @@ -330,10 +330,10 @@ check_slice(void) if (dsk.type == TYPE_FD) return (WHOLE_DISK_SLICE); - if (drvread(sec, DOSBBSECTOR + 1)) + if (drvread(sec, PC98_BBSECTOR)) return (WHOLE_DISK_SLICE); /* Read error */ - dp = (void *)(sec + DOSPARTOFF); - for (i = 0; i < NDOSPART; i++) { + dp = (void *)(sec + PC98_PARTOFF); + for (i = 0; i < PC98_NPARTS; i++) { if (dp[i].dp_mid == DOSMID_386BSD) { if (dp[i].dp_scyl <= cyl && cyl <= dp[i].dp_ecyl) return (BASE_SLICE + i); @@ -583,7 +583,7 @@ parse() dsk.slice = WHOLE_DISK_SLICE; if (arg[1] == ',') { dsk.slice = *arg - '0' + 1; - if (dsk.slice > NDOSPART + 1) + if (dsk.slice > PC98_NPARTS + 1) return -1; arg += 2; } @@ -626,12 +626,12 @@ dskread(void *buf, unsigned lba, unsigned nblk) set_dsk(); if (dsk.type == TYPE_FD) goto unsliced; - if (drvread(sec, DOSBBSECTOR + 1)) + if (drvread(sec, PC98_BBSECTOR)) return -1; - dp = (void *)(sec + DOSPARTOFF); + dp = (void *)(sec + PC98_PARTOFF); sl = dsk.slice; if (sl < BASE_SLICE) { - for (i = 0; i < NDOSPART; i++) + for (i = 0; i < PC98_NPARTS; i++) if (dp[i].dp_mid == DOSMID_386BSD) { sl = BASE_SLICE + i; break; diff --git a/sys/boot/pc98/libpc98/biosdisk.c b/sys/boot/pc98/libpc98/biosdisk.c index 572e90c..96dbd1f 100644 --- a/sys/boot/pc98/libpc98/biosdisk.c +++ b/sys/boot/pc98/libpc98/biosdisk.c @@ -83,7 +83,7 @@ struct open_disk { #define BD_OPTICAL 0x0020 struct disklabel od_disklabel; int od_nslices; /* slice count */ - struct pc98_partition od_slicetab[NDOSPART]; + struct pc98_partition od_slicetab[PC98_NPARTS]; }; /* @@ -528,9 +528,9 @@ bd_open_pc98(struct open_disk *od, struct i386_devdesc *dev) /* * copy the partition table, then pick up any extended partitions. */ - bcopy(buf + DOSPARTOFF, &od->od_slicetab, - sizeof(struct pc98_partition) * NDOSPART); - od->od_nslices = NDOSPART; /* extended slices start here */ + bcopy(buf + PC98_PARTOFF, &od->od_slicetab, + sizeof(struct pc98_partition) * PC98_NPARTS); + od->od_nslices = PC98_NPARTS; /* extended slices start here */ od->od_flags |= BD_PARTTABOK; dptr = &od->od_slicetab[0]; @@ -647,7 +647,7 @@ bd_open_pc98(struct open_disk *od, struct i386_devdesc *dev) #define PREF_NONE 7 /* - * slicelimit is in the range 0 .. NDOSPART + * slicelimit is in the range 0 .. PC98_NPARTS */ static int bd_bestslice(struct open_disk *od) |