#
-# $OpenBSD: Makefile,v 1.40 2014/04/13 15:29:21 schwarze Exp $
+# $OpenBSD: Makefile,v 1.41 2014/05/05 17:18:08 miod Exp $
#
# Copyright (c) 1997 Tobias Weingartner
# All rights reserved.
CFLAGS += -DHAS_MBR
.endif
+# XXX gross
+.if ${MACHINE_ARCH} == "sh"
+CFLAGS += -fno-builtin-memcpy
+.endif
+
.include <bsd.prog.mk>
-/* $OpenBSD: part.c,v 1.65 2014/03/31 22:03:29 krw Exp $ */
+/* $OpenBSD: part.c,v 1.66 2014/05/05 17:18:08 miod Exp $ */
/*
* Copyright (c) 1997 Tobias Weingartner
off_t reloff, struct prt *partn)
{
off_t off;
+ u_int32_t t;
partn->flag = prt->dp_flag;
partn->shead = prt->dp_shd;
else
off = offset;
+#if 0 /* XXX */
partn->bs = letoh32(prt->dp_start) + off;
partn->ns = letoh32(prt->dp_size);
+#else
+ memcpy(&t, &prt->dp_start, sizeof(u_int32_t));
+ partn->bs = letoh32(t) + off;
+ memcpy(&t, &prt->dp_size, sizeof(u_int32_t));
+ partn->ns = letoh32(t);
+#endif
PRT_fix_CHS(disk, partn);
}
{
off_t off;
u_int32_t ecsave, scsave;
+ u_int32_t t;
/* Save (and restore below) cylinder info we may fiddle with. */
scsave = partn->scyl;
prt->dp_flag = partn->flag & 0xFF;
prt->dp_typ = partn->id & 0xFF;
+#if 0 /* XXX */
prt->dp_start = htole32(partn->bs - off);
prt->dp_size = htole32(partn->ns);
+#else
+ t = htole32(partn->bs - off);
+ memcpy(&prt->dp_start, &t, sizeof(u_int32_t));
+ t = htole32(partn->ns);
+ memcpy(&prt->dp_size, &t, sizeof(u_int32_t));
+#endif
partn->scyl = scsave;
partn->ecyl = ecsave;