Source-Changes-HG archive

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

[src/trunk]: src/sys/arch move the __packed attribute from struct frame::F_t ...



details:   https://anonhg.NetBSD.org/src/rev/beefea5bc070
branches:  trunk
changeset: 975889:beefea5bc070
user:      mrg <mrg%NetBSD.org@localhost>
date:      Mon Sep 07 23:41:38 2020 +0000

description:
move the __packed attribute from struct frame::F_t into the single
unaligned member inside.  CTASSERT() the size is unchanged.

with this, sun3 and GCC 9 appears to work.

diffstat:

 sys/arch/m68k/include/cpuframe.h |  6 +++---
 sys/arch/sun3/sun3/machdep.c     |  6 ++++--
 2 files changed, 7 insertions(+), 5 deletions(-)

diffs (49 lines):

diff -r 02a92cef25d7 -r beefea5bc070 sys/arch/m68k/include/cpuframe.h
--- a/sys/arch/m68k/include/cpuframe.h  Mon Sep 07 22:22:17 2020 +0000
+++ b/sys/arch/m68k/include/cpuframe.h  Mon Sep 07 23:41:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpuframe.h,v 1.6 2017/07/02 14:10:23 christos Exp $    */
+/*     $NetBSD: cpuframe.h,v 1.7 2020/09/07 23:41:38 mrg Exp $ */
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -47,10 +47,10 @@
                short   tf_pad;
                short   tf_stackadj;
                u_short tf_sr;
-               u_int   tf_pc;
+               u_int   tf_pc __packed;
                u_short /* BITFIELDTYPE */ tf_format:4,
                        /* BITFIELDTYPE */ tf_vector:12;
-       } __attribute__((packed)) F_t;
+       } F_t;
        union F_u {
                struct fmt2 {
                        u_int   f_iaddr;
diff -r 02a92cef25d7 -r beefea5bc070 sys/arch/sun3/sun3/machdep.c
--- a/sys/arch/sun3/sun3/machdep.c      Mon Sep 07 22:22:17 2020 +0000
+++ b/sys/arch/sun3/sun3/machdep.c      Mon Sep 07 23:41:38 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: machdep.c,v 1.212 2020/06/11 19:20:45 ad Exp $ */
+/*     $NetBSD: machdep.c,v 1.213 2020/09/07 23:41:38 mrg Exp $        */
 
 /*
  * Copyright (c) 1982, 1986, 1990, 1993
@@ -78,7 +78,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.212 2020/06/11 19:20:45 ad Exp $");
+__KERNEL_RCSID(0, "$NetBSD: machdep.c,v 1.213 2020/09/07 23:41:38 mrg Exp $");
 
 #include "opt_ddb.h"
 #include "opt_kgdb.h"
@@ -137,6 +137,8 @@
 
 #include <sun3/sun3/machdep.h>
 
+CTASSERT(sizeof(struct frame) == 76 /* F_t */ + 84 /* F_u */);
+
 #include "ksyms.h"
 
 /* Defined in locore.s */



Home | Main Index | Thread Index | Old Index