Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 26 Oct 2002 17:07:05 -0700 (PDT)
From:      Peter Wemm <peter@FreeBSD.org>
To:        Perforce Change Reviews <perforce@freebsd.org>
Subject:   PERFORCE change 20210 for review
Message-ID:  <200210270007.g9R075ho048970@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=20210

Change 20210 by peter@peter_ia64 on 2002/10/26 17:06:27

	GRRR.  Put back the ifdefs that phk removed.

Affected files ...

.. //depot/projects/ia64/lib/libdisk/Makefile#4 edit
.. //depot/projects/ia64/lib/libdisk/disk.c#8 edit
.. //depot/projects/ia64/lib/libdisk/libdisk.h#6 edit
.. //depot/projects/ia64/lib/libdisk/write_ia64_disk.c#2 edit

Differences ...

==== //depot/projects/ia64/lib/libdisk/Makefile#4 (text+ko) ====

@@ -12,7 +12,7 @@
 SRCS	+=	write_pc98_disk.c
 .endif
 
-.if ${MACHINE} == "i386"
+.if ${MACHINE} == "i386" || ${MACHINE} == "ia64"
 SRCS	+=	write_i386_disk.c
 .endif
 

==== //depot/projects/ia64/lib/libdisk/disk.c#8 (text+ko) ====

@@ -778,6 +778,10 @@
 #elif defined(__alpha__)
 	printf("  boot1=%p, bootmgr=%p\n",
 		d->boot1, d->bootmgr);
+#elif defined(__ia64__)
+	printf("\n");
+#else
+#error "Debug_Disk: unknown arch";
 #endif
 	Debug_Chunk(d->chunks);
 }
@@ -791,9 +795,13 @@
 	if(d->bootipl) free(d->bootipl);
 	if(d->bootmenu) free(d->bootmenu);
 #else
+#if !defined(__ia64__)
 	if(d->bootmgr) free(d->bootmgr);
 #endif
+#endif
+#if !defined(__ia64__)
 	if(d->boot1) free(d->boot1);
+#endif
 #if defined(__i386__)
 	if(d->boot2) free(d->boot2);
 #endif
@@ -868,6 +876,7 @@
 Set_Boot_Mgr(struct disk *d, const u_char *b, const size_t s)
 #endif
 {
+#if !defined(__ia64__)
 #ifdef PC98
 	if (bootipl_size % d->sector_size != 0)
 		return;
@@ -908,6 +917,7 @@
 		memcpy(d->bootmgr, b, s);
 	}
 #endif
+#endif
 }
 
 int
@@ -927,6 +937,10 @@
 	d->boot1 = malloc(15 * 512);
 	if(!d->boot1) return -1;
 	memcpy(d->boot1, b1, 15 * 512);
+#elif defined(__ia64__)
+	/* nothing */
+#else
+#error "Set_Boot_Blocks: unknown arch"
 #endif
 	return 0;
 }

==== //depot/projects/ia64/lib/libdisk/libdisk.h#6 (text+ko) ====

@@ -38,10 +38,14 @@
 	u_char		*bootmenu;
 	size_t		bootmenu_size;
 #else
+#if !defined(__ia64__)
 	u_char		*bootmgr;
 	size_t		bootmgr_size;
 #endif
+#endif
+#if !defined(__ia64__)
 	u_char		*boot1;
+#endif
 #if defined(__i386__)		/* the i386 needs extra help... */
 	u_char		*boot2;
 #endif

==== //depot/projects/ia64/lib/libdisk/write_ia64_disk.c#2 (text+ko) ====

@@ -38,11 +38,13 @@
 		memcpy(buf + 512 * i, p, 512);
 		free(p);
 	}
+#if !defined(__ia64__)
 	if(new->boot1)
 		memcpy(buf, new->boot1, 512);
 
 	if(new->boot2)
 		memcpy(buf + 512, new->boot2, BBSIZE-512);
+#endif
 
 	dl = (struct disklabel *)(buf + 512 * LABELSECTOR + LABELOFFSET);
 	Fill_Disklabel(dl, new, old, c1);
@@ -71,12 +73,14 @@
 static void
 Cfg_Boot_Mgr(u_char *mbr, int edd)
 {
+#if !defined(__ia64__)
     if (mbr[0x1b0] == 0x66 && mbr[0x1b1] == 0xbb) {
 	if (edd)
 	    mbr[0x1bb] |= 0x80;	/* Packet mode on */
 	else
 	    mbr[0x1bb] &= 0x7f;	/* Packet mode off */
     }
+#endif
 }
 
 int
@@ -180,17 +184,21 @@
 				dp[i].dp_flag = 0x80;
 
 	mbr = read_block(fd, 0, d1->sector_size);
+#if !defined(__ia64__)
 	if (d1->bootmgr) {
 		memcpy(mbr, d1->bootmgr, DOSPARTOFF);
 		Cfg_Boot_Mgr(mbr, need_edd);
         }
+#endif
 	memcpy(mbr + DOSPARTOFF, dp, sizeof *dp * NDOSPART);
 	mbr[512-2] = 0x55;
 	mbr[512-1] = 0xaa;
 	write_block(fd, 0, mbr, d1->sector_size);
+#if !defined(__ia64__)
 	if (d1->bootmgr && d1->bootmgr_size > d1->sector_size)
 	  for(i = 1; i * d1->sector_size <= d1->bootmgr_size; i++)
 	    write_block(fd, i, &d1->bootmgr[i * d1->sector_size], d1->sector_size);
+#endif
 
 	close(fd);
 	return 0;

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe p4-projects" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210270007.g9R075ho048970>