Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Align struct timeval time to the same alignment req...



details:   https://anonhg.NetBSD.org/src/rev/5d73d82e2434
branches:  trunk
changeset: 472675:5d73d82e2434
user:      christos <christos%NetBSD.org@localhost>
date:      Tue May 04 16:16:54 1999 +0000

description:
Align struct timeval time to the same alignment requirements of a quad.
This broke the sparc elf kernel which in microtime uses ldd to load both
words at the same time. The a.out kernel, just got lucky.

diffstat:

 sys/kern/kern_clock.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r fcbe4ddc00d7 -r 5d73d82e2434 sys/kern/kern_clock.c
--- a/sys/kern/kern_clock.c     Tue May 04 16:08:02 1999 +0000
+++ b/sys/kern/kern_clock.c     Tue May 04 16:16:54 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_clock.c,v 1.47 1999/02/28 18:14:57 ross Exp $     */
+/*     $NetBSD: kern_clock.c,v 1.48 1999/05/04 16:16:54 christos Exp $ */
 
 /*-
  * Copyright (c) 1982, 1986, 1991, 1993
@@ -292,7 +292,12 @@
 int    shifthz;
 #endif
 
-volatile struct        timeval time;
+/*
+ * We might want ldd to load the both words from time at once.
+ * To succeed we need to be quadword aligned.
+ * The sparc already does that, and that it has worked so far is a fluke.
+ */
+volatile struct        timeval time  __attribute__((__aligned__(__alignof__(quad_t))));
 volatile struct        timeval mono_time;
 
 /*



Home | Main Index | Thread Index | Old Index