Fri Jun 14 03:04:20 2013 UTC ()
Pull up following revision(s) (requested by martin in ticket #1856):
	sys/sys/bootblock.h		rev. 1.55
	usr.sbin/installboot/arch/vax.c	rev. 1.16
Adapt to new vax primary bootstrap layout.
Don't include host's disklabel.h.


(msaitoh)
diff -r1.45.10.1 -r1.45.10.2 src/sys/sys/bootblock.h
diff -r1.12.6.1 -r1.12.6.2 src/usr.sbin/installboot/arch/vax.c

cvs diff -r1.45.10.1 -r1.45.10.2 src/sys/sys/bootblock.h (expand / switch to unified diff)

--- src/sys/sys/bootblock.h 2013/06/12 06:05:52 1.45.10.1
+++ src/sys/sys/bootblock.h 2013/06/14 03:04:20 1.45.10.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: bootblock.h,v 1.45.10.1 2013/06/12 06:05:52 msaitoh Exp $ */ 1/* $NetBSD: bootblock.h,v 1.45.10.2 2013/06/14 03:04:20 msaitoh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 2002-2004 The NetBSD Foundation, Inc. 4 * Copyright (c) 2002-2004 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * Redistribution and use in source and binary forms, with or without 7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions 8 * modification, are permitted provided that the following conditions
9 * are met: 9 * are met:
10 * 1. Redistributions of source code must retain the above copyright 10 * 1. Redistributions of source code must retain the above copyright
11 * notice, this list of conditions and the following disclaimer. 11 * notice, this list of conditions and the following disclaimer.
12 * 2. Redistributions in binary form must reproduce the above copyright 12 * 2. Redistributions in binary form must reproduce the above copyright
13 * notice, this list of conditions and the following disclaimer in the 13 * notice, this list of conditions and the following disclaimer in the
14 * documentation and/or other materials provided with the distribution. 14 * documentation and/or other materials provided with the distribution.
@@ -1370,50 +1370,50 @@ struct sgi_boot_block { @@ -1370,50 +1370,50 @@ struct sgi_boot_block {
1370 1370
1371/* ------------------------------------------ 1371/* ------------------------------------------
1372 * vax -- 1372 * vax --
1373 * VAX boot block information 1373 * VAX boot block information
1374 */ 1374 */
1375 1375
1376struct vax_boot_block { 1376struct vax_boot_block {
1377/* Note that these don't overlap any of the pmax boot block */ 1377/* Note that these don't overlap any of the pmax boot block */
1378 uint8_t pad0[2]; 1378 uint8_t pad0[2];
1379 uint8_t bb_id_offset; /* offset in words to id (magic1)*/ 1379 uint8_t bb_id_offset; /* offset in words to id (magic1)*/
1380 uint8_t bb_mbone; /* must be one */ 1380 uint8_t bb_mbone; /* must be one */
1381 uint16_t bb_lbn_hi; /* lbn (hi word) of bootstrap */ 1381 uint16_t bb_lbn_hi; /* lbn (hi word) of bootstrap */
1382 uint16_t bb_lbn_low; /* lbn (low word) of bootstrap */ 1382 uint16_t bb_lbn_low; /* lbn (low word) of bootstrap */
1383 uint8_t pad1[460]; 1383 uint8_t pad1[406];
1384 /* disklabel offset is 64 from base, or 56 from start of pad1 */ 1384 /* disklabel offset is 64 from base, or 56 from start of pad1 */
1385 1385
1386 /* The rest of these fields are identification area and describe 1386 /* The rest of these fields are identification area and describe
1387 * the secondary block for uVAX VMB. 1387 * the secondary block for uVAX VMB.
1388 */ 1388 */
1389 uint8_t bb_magic1; /* magic number */ 1389 uint8_t bb_magic1; /* magic number */
1390 uint8_t bb_mbz1; /* must be zero */ 1390 uint8_t bb_mbz1; /* must be zero */
1391 uint8_t bb_pad1; /* any value */ 1391 uint8_t bb_pad1; /* any value */
1392 uint8_t bb_sum1; /* ~(magic1 + mbz1 + pad1) */ 1392 uint8_t bb_sum1; /* ~(magic1 + mbz1 + pad1) */
1393 1393
1394 uint8_t bb_mbz2; /* must be zero */ 1394 uint8_t bb_mbz2; /* must be zero */
1395 uint8_t bb_volinfo; /* volinfo */ 1395 uint8_t bb_volinfo; /* volinfo */
1396 uint8_t bb_pad2a; /* any value */ 1396 uint8_t bb_pad2a; /* any value */
1397 uint8_t bb_pad2b; /* any value */ 1397 uint8_t bb_pad2b; /* any value */
1398 1398
1399 uint32_t bb_size; /* size in blocks of bootstrap */ 1399 uint32_t bb_size; /* size in blocks of bootstrap */
1400 uint32_t bb_load; /* load offset to bootstrap */ 1400 uint32_t bb_load; /* load offset to bootstrap */
1401 uint32_t bb_entry; /* byte offset in bootstrap */ 1401 uint32_t bb_entry; /* byte offset in bootstrap */
1402 uint32_t bb_sum3; /* sum of previous 3 fields */ 1402 uint32_t bb_sum3; /* sum of previous 3 fields */
1403 1403
1404 /* The rest is unused. 1404 /* The rest is unused.
1405 */ 1405 */
1406 uint8_t pad2[20]; 1406 uint8_t pad2[74];
1407} __packed; 1407} __packed;
1408 1408
1409#define VAX_BOOT_MAGIC1 0x18 /* size of BB info? */ 1409#define VAX_BOOT_MAGIC1 0x18 /* size of BB info? */
1410#define VAX_BOOT_VOLINFO_NONE 0x00 /* no special info */ 1410#define VAX_BOOT_VOLINFO_NONE 0x00 /* no special info */
1411#define VAX_BOOT_VOLINFO_SS 0x01 /* single sided */ 1411#define VAX_BOOT_VOLINFO_SS 0x01 /* single sided */
1412#define VAX_BOOT_VOLINFO_DS 0x81 /* double sided */ 1412#define VAX_BOOT_VOLINFO_DS 0x81 /* double sided */
1413 1413
1414#define VAX_BOOT_SIZE 15 /* 15 blocks */ 1414#define VAX_BOOT_SIZE 15 /* 15 blocks */
1415#define VAX_BOOT_LOAD 0 /* no load offset */ 1415#define VAX_BOOT_LOAD 0 /* no load offset */
1416#define VAX_BOOT_ENTRY 0x200 /* one block in */ 1416#define VAX_BOOT_ENTRY 0x200 /* one block in */
1417 1417
1418#define VAX_BOOT_BLOCK_OFFSET 0 1418#define VAX_BOOT_BLOCK_OFFSET 0
1419#define VAX_BOOT_BLOCK_BLOCKSIZE 512 1419#define VAX_BOOT_BLOCK_BLOCKSIZE 512

cvs diff -r1.12.6.1 -r1.12.6.2 src/usr.sbin/installboot/arch/vax.c (expand / switch to unified diff)

--- src/usr.sbin/installboot/arch/vax.c 2013/06/12 06:05:52 1.12.6.1
+++ src/usr.sbin/installboot/arch/vax.c 2013/06/14 03:04:20 1.12.6.2
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: vax.c,v 1.12.6.1 2013/06/12 06:05:52 msaitoh Exp $ */ 1/* $NetBSD: vax.c,v 1.12.6.2 2013/06/14 03:04:20 msaitoh Exp $ */
2 2
3/*- 3/*-
4 * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc. 4 * Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This code is derived from software contributed to The NetBSD Foundation 7 * This code is derived from software contributed to The NetBSD Foundation
8 * by Simon Burge. 8 * by Simon Burge.
9 * 9 *
10 * This code is derived from software contributed to The NetBSD Foundation 10 * This code is derived from software contributed to The NetBSD Foundation
11 * by Luke Mewburn of Wasabi Systems. 11 * by Luke Mewburn of Wasabi Systems.
12 * 12 *
13 * Redistribution and use in source and binary forms, with or without 13 * Redistribution and use in source and binary forms, with or without
14 * modification, are permitted provided that the following conditions 14 * modification, are permitted provided that the following conditions
@@ -58,31 +58,37 @@ @@ -58,31 +58,37 @@
58 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 58 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 59 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 60 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 61 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
62 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 62 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
63 */ 63 */
64 64
65#if HAVE_NBTOOL_CONFIG_H 65#if HAVE_NBTOOL_CONFIG_H
66#include "nbtool_config.h" 66#include "nbtool_config.h"
67#endif 67#endif
68 68
69#include <sys/cdefs.h> 69#include <sys/cdefs.h>
70#if !defined(__lint) 70#if !defined(__lint)
71__RCSID("$NetBSD: vax.c,v 1.12.6.1 2013/06/12 06:05:52 msaitoh Exp $"); 71__RCSID("$NetBSD: vax.c,v 1.12.6.2 2013/06/14 03:04:20 msaitoh Exp $");
72#endif /* !__lint */ 72#endif /* !__lint */
73 73
74#include <sys/param.h> 74/* We need the target disklabel.h, not the hosts one..... */
 75#ifdef HAVE_NBTOOL_CONFIG_H
 76#include <nbinclude/vax/disklabel.h>
 77#include <nbinclude/sys/disklabel.h>
 78#else
75#include <sys/disklabel.h> 79#include <sys/disklabel.h>
 80#endif
 81#include <sys/param.h>
76 82
77#include <assert.h> 83#include <assert.h>
78#include <err.h> 84#include <err.h>
79#include <stddef.h> 85#include <stddef.h>
80#include <stdio.h> 86#include <stdio.h>
81#include <stdlib.h> 87#include <stdlib.h>
82#include <string.h> 88#include <string.h>
83#include <unistd.h> 89#include <unistd.h>
84 90
85#include "installboot.h" 91#include "installboot.h"
86 92
87#ifndef __CTASSERT 93#ifndef __CTASSERT
88#define __CTASSERT(X) 94#define __CTASSERT(X)