summaryrefslogtreecommitdiff
path: root/lib/libdisk/write_disk.c
diff options
context:
space:
mode:
authorDavid E. O'Brien <obrien@FreeBSD.org>2001-04-01 11:37:31 +0000
committerDavid E. O'Brien <obrien@FreeBSD.org>2001-04-01 11:37:31 +0000
commit8c32a31fd24ce9983d604fe95cbc45db4ad7889d (patch)
tree00e1a16e9894c0fd9556d1b2fe462e7c52501afc /lib/libdisk/write_disk.c
parentad6d7cd03ff8efab3e47801daf4d42605f3f60a0 (diff)
Try to untangle some of the #ifdef spaghetti.
Also, looking to the future, don't assume all the world is an i386 and all its disk layout brain damage will be repeated by other platforms. So all the diking out if we are an Alpha, becomes adding in if we are an i386.
Notes
svn path=/head/; revision=75067
Diffstat (limited to 'lib/libdisk/write_disk.c')
-rw-r--r--lib/libdisk/write_disk.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/lib/libdisk/write_disk.c b/lib/libdisk/write_disk.c
index 2511e3d0b6dd..cf75d7f6770c 100644
--- a/lib/libdisk/write_disk.c
+++ b/lib/libdisk/write_disk.c
@@ -137,7 +137,7 @@ Write_FreeBSD(int fd, struct disk *new, struct disk *old, struct chunk *c1)
for (lp = (u_long *)buf, i = 0, sum = 0; i < 63; i++)
sum += lp[i];
lp[63] = sum;
-#endif
+#endif /*__alpha__*/
for(i=0;i<BBSIZE/512;i++) {
write_block(fd,WHERE(i + c1->offset,new),buf+512*i);
@@ -152,7 +152,7 @@ Write_Extended(int fd, struct disk *new, struct disk *old, struct chunk *c1)
return 0;
}
-#ifndef PC98
+#if defined(__i386__) && !defined(PC98)
static void
Write_Int32(u_int32_t *p, u_int32_t v)
{
@@ -162,8 +162,9 @@ Write_Int32(u_int32_t *p, u_int32_t v)
bp[2] = (v >> 16) & 0xff;
bp[3] = (v >> 24) & 0xff;
}
+#endif
-#ifndef __alpha__
+#if defined(__i386__) && !defined(PC98)
/*
* Special install-time configuration for the i386 boot0 boot manager.
*/
@@ -178,7 +179,6 @@ Cfg_Boot_Mgr(u_char *mbr, int edd)
}
}
#endif
-#endif
int
Write_Disk(struct disk *d1)
@@ -198,7 +198,7 @@ Write_Disk(struct disk *d1)
int PC98_EntireDisk = 0;
#else
int s[4];
-#ifndef __alpha__
+#ifdef __i386__
int need_edd = 0; /* Need EDD (packet interface) */
#endif
#endif
@@ -238,7 +238,7 @@ Write_Disk(struct disk *d1)
for (c1=d1->chunks->part; c1 ; c1 = c1->next) {
if (c1->type == unused) continue;
if (!strcmp(c1->name,"X")) continue;
-#ifndef __alpha__
+#ifdef __i386__
j = c1->name[4] - '1';
j = c1->name[strlen(d1->name) + 1] - '1';
#ifdef PC98
@@ -256,7 +256,7 @@ Write_Disk(struct disk *d1)
if (c1->type == freebsd)
ret += Write_FreeBSD(fd, d1,old,c1);
-#ifndef __alpha__
+#ifdef __i386__
#ifndef PC98
Write_Int32(&dp[j].dp_start, c1->offset);
Write_Int32(&dp[j].dp_size, c1->size);
@@ -288,7 +288,7 @@ Write_Disk(struct disk *d1)
i -= dp[j].dp_scyl;
dp[j].dp_ssect |= i >> 2;
}
-#endif
+#endif /* PC98 */
#ifdef DEBUG
printf("S:%lu = (%x/%x/%x)",
@@ -343,7 +343,7 @@ Write_Disk(struct disk *d1)
#endif
#endif
}
-#ifndef __alpha__
+#ifdef __i386__
j = 0;
for(i=0;i<NDOSPART;i++) {
if (!s[i])