From owner-p4-projects Sat Oct 26 17: 8: 8 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id A6C5937B404; Sat, 26 Oct 2002 17:08:03 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 289F437B401 for ; Sat, 26 Oct 2002 17:08:03 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id CBD7343E65 for ; Sat, 26 Oct 2002 17:08:02 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9R076mV048973 for ; Sat, 26 Oct 2002 17:07:06 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.6/Submit) id g9R075ho048970 for perforce@freebsd.org; Sat, 26 Oct 2002 17:07:05 -0700 (PDT) Date: Sat, 26 Oct 2002 17:07:05 -0700 (PDT) Message-Id: <200210270007.g9R075ho048970@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 20210 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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