summaryrefslogtreecommitdiff
path: root/usr.sbin/installboot
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2014-11-13 16:02:25 +0000
committerchristos <christos@NetBSD.org>2014-11-13 16:02:25 +0000
commite0026404fda07ee45e4aa2e0da4b6f2f737d4ce4 (patch)
tree48f16f4bb633ccb2601f16b3459f1326f783113e /usr.sbin/installboot
parentb2f4ce2c5615fbdc1bdb201b94ae69a5b5a6b57d (diff)
Use VAX_LABELOFFSET here; It needs to be the machine-specific one. Thanks
to gcc-4.8 for discovering the bug and to Atari for having a LABELOFFSET of 516 > 512 :-) XXX: Perhaps we should put all those constants in <sys/bootblock.h> instead of spreading them around.
Diffstat (limited to 'usr.sbin/installboot')
-rw-r--r--usr.sbin/installboot/arch/vax.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/usr.sbin/installboot/arch/vax.c b/usr.sbin/installboot/arch/vax.c
index 74982ccaeac..c67f088858e 100644
--- a/usr.sbin/installboot/arch/vax.c
+++ b/usr.sbin/installboot/arch/vax.c
@@ -1,4 +1,4 @@
-/* $NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $ */
+/* $NetBSD: vax.c,v 1.18 2014/11/13 16:02:25 christos Exp $ */
/*-
* Copyright (c) 1999, 2002 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
#include <sys/cdefs.h>
#if !defined(__lint)
-__RCSID("$NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $");
+__RCSID("$NetBSD: vax.c,v 1.18 2014/11/13 16:02:25 christos Exp $");
#endif /* !__lint */
#include <sys/param.h>
@@ -88,6 +88,8 @@ __RCSID("$NetBSD: vax.c,v 1.17 2013/06/16 19:05:00 martin Exp $");
#include "installboot.h"
+#define VAX_LABELOFFSET 64
+
#ifndef __CTASSERT
#define __CTASSERT(X)
#endif
@@ -210,12 +212,12 @@ vax_setboot(ib_params *params)
/*
* Copy disklabel from old boot block to new.
- * Assume everything between LABELOFFSET and the start of
+ * Assume everything between VAX_LABELOFFSET and the start of
* the param block is scratch area and can be copied over.
*/
- memcpy(bootstrapbuf+LABELOFFSET,
- oldbb+LABELOFFSET,
- offsetof(struct vax_boot_block,bb_magic1)-LABELOFFSET);
+ memcpy(bootstrapbuf + VAX_LABELOFFSET,
+ oldbb + VAX_LABELOFFSET,
+ offsetof(struct vax_boot_block,bb_magic1) - VAX_LABELOFFSET);
/* point to bootblock at begining of bootstrap */
bb = (struct vax_boot_block*)bootstrapbuf;