Module Name:    src
Committed By:   mrg
Date:           Mon Sep  7 23:41:38 UTC 2020

Modified Files:
        src/sys/arch/m68k/include: cpuframe.h
        src/sys/arch/sun3/sun3: machdep.c

Log Message:
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.


To generate a diff of this commit:
cvs rdiff -u -r1.6 -r1.7 src/sys/arch/m68k/include/cpuframe.h
cvs rdiff -u -r1.212 -r1.213 src/sys/arch/sun3/sun3/machdep.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/arch/m68k/include/cpuframe.h
diff -u src/sys/arch/m68k/include/cpuframe.h:1.6 src/sys/arch/m68k/include/cpuframe.h:1.7
--- src/sys/arch/m68k/include/cpuframe.h:1.6	Sun Jul  2 14:10:23 2017
+++ src/sys/arch/m68k/include/cpuframe.h	Mon Sep  7 23:41:38 2020
@@ -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 @@ struct frame {
 		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;

Index: src/sys/arch/sun3/sun3/machdep.c
diff -u src/sys/arch/sun3/sun3/machdep.c:1.212 src/sys/arch/sun3/sun3/machdep.c:1.213
--- src/sys/arch/sun3/sun3/machdep.c:1.212	Thu Jun 11 19:20:45 2020
+++ src/sys/arch/sun3/sun3/machdep.c	Mon Sep  7 23:41:38 2020
@@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: machdep.c,v 
 
 #include <sun3/sun3/machdep.h>
 
+CTASSERT(sizeof(struct frame) == 76 /* F_t */ + 84 /* F_u */);
+
 #include "ksyms.h"
 
 /* Defined in locore.s */

Reply via email to