summaryrefslogtreecommitdiffstats
path: root/sys/geom/geom_pc98.c
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2013-08-07 00:00:48 +0000
committermarcel <marcel@FreeBSD.org>2013-08-07 00:00:48 +0000
commit9f2f2e171a6de4c6d713a50366f3572946665fb5 (patch)
treeb8704cff2de99c4cf2da972288c8d1271ec33598 /sys/geom/geom_pc98.c
parentf5fd32bca5d6cadbe86d031375653c183adce356 (diff)
downloadFreeBSD-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/geom/geom_pc98.c')
-rw-r--r--sys/geom/geom_pc98.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/geom/geom_pc98.c b/sys/geom/geom_pc98.c
index 8e14f09..42c9962 100644
--- a/sys/geom/geom_pc98.c
+++ b/sys/geom/geom_pc98.c
@@ -56,7 +56,7 @@ FEATURE(geom_pc98, "GEOM NEC PC9800 partitioning support");
struct g_pc98_softc {
u_int fwsectors, fwheads, sectorsize;
- int type[NDOSPART];
+ int type[PC98_NPARTS];
u_char sec[8192];
};
@@ -84,8 +84,8 @@ static int
g_pc98_modify(struct g_geom *gp, struct g_pc98_softc *ms, u_char *sec, int len __unused)
{
int i, error;
- off_t s[NDOSPART], l[NDOSPART];
- struct pc98_partition dp[NDOSPART];
+ off_t s[PC98_NPARTS], l[PC98_NPARTS];
+ struct pc98_partition dp[PC98_NPARTS];
g_topology_assert();
@@ -114,11 +114,11 @@ g_pc98_modify(struct g_geom *gp, struct g_pc98_softc *ms, u_char *sec, int len _
return (EBUSY);
#endif
- for (i = 0; i < NDOSPART; i++)
+ for (i = 0; i < PC98_NPARTS; i++)
pc98_partition_dec(
sec + 512 + i * sizeof(struct pc98_partition), &dp[i]);
- for (i = 0; i < NDOSPART; i++) {
+ for (i = 0; i < PC98_NPARTS; i++) {
/* If start and end are identical it's bogus */
if (dp[i].dp_ssect == dp[i].dp_esect &&
dp[i].dp_shd == dp[i].dp_ehd &&
@@ -146,7 +146,7 @@ g_pc98_modify(struct g_geom *gp, struct g_pc98_softc *ms, u_char *sec, int len _
return (error);
}
- for (i = 0; i < NDOSPART; i++) {
+ for (i = 0; i < PC98_NPARTS; i++) {
ms->type[i] = (dp[i].dp_sid << 8) | dp[i].dp_mid;
g_slice_config(gp, i, G_SLICE_CONFIG_SET, s[i], l[i],
ms->sectorsize, "%ss%d", gp->name, i + 1);
@@ -269,7 +269,8 @@ g_pc98_taste(struct g_class *mp, struct g_provider *pp, int flags)
if (flags == G_TF_NORMAL &&
!strcmp(pp->geom->class->name, PC98_CLASS_NAME))
return (NULL);
- gp = g_slice_new(mp, NDOSPART, pp, &cp, &ms, sizeof *ms, g_pc98_start);
+ gp = g_slice_new(mp, PC98_NPARTS, pp, &cp, &ms, sizeof *ms,
+ g_pc98_start);
if (gp == NULL)
return (NULL);
g_topology_unlock();
OpenPOWER on IntegriCloud