Module Name:    src
Committed By:   thorpej
Date:           Fri Jan 19 18:49:10 UTC 2024

Modified Files:
        src/sys/arch/x68k/include: cpu.h
        src/sys/arch/x68k/x68k: locore.s

Log Message:
Switch the x68k port to use the same clockframe layout as the other
m68k ports.


To generate a diff of this commit:
cvs rdiff -u -r1.65 -r1.66 src/sys/arch/x68k/include/cpu.h
cvs rdiff -u -r1.132 -r1.133 src/sys/arch/x68k/x68k/locore.s

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/x68k/include/cpu.h
diff -u src/sys/arch/x68k/include/cpu.h:1.65 src/sys/arch/x68k/include/cpu.h:1.66
--- src/sys/arch/x68k/include/cpu.h:1.65	Thu Jan 18 14:39:07 2024
+++ src/sys/arch/x68k/include/cpu.h	Fri Jan 19 18:49:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: cpu.h,v 1.65 2024/01/18 14:39:07 thorpej Exp $	*/
+/*	$NetBSD: cpu.h,v 1.66 2024/01/19 18:49:10 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -59,19 +59,20 @@
 /*
  * Arguments to hardclock and gatherstats encapsulate the previous
  * machine state in an opaque clockframe.  On the x68k, we use
- * what the hardware pushes on an interrupt (frame format 0).
+ * what the locore.s glue puts on the stack before calling C-code.
  */
 struct clockframe {
-	u_short	sr;		/* sr at time of interrupt */
-	u_long	pc;		/* pc at time of interrupt */
-	u_short	vo;		/* vector offset (4-word frame) */
-};
+	u_int	cf_regs[4];	/* d0,d1,a0,a1 */
+	u_short	cf_sr;		/* sr at time of interrupt */
+	u_long	cf_pc;		/* pc at time of interrupt */
+	u_short	cf_vo;		/* vector offset (4-word frame) */
+} __attribute__((__packed__));
 
-#define	CLKF_USERMODE(framep)	(((framep)->sr & PSL_S) == 0)
-#define	CLKF_PC(framep)		((framep)->pc)
+#define	CLKF_USERMODE(framep)	(((framep)->cf_sr & PSL_S) == 0)
+#define	CLKF_PC(framep)		((framep)->cf_pc)
 #if 0
 /* We would like to do it this way... */
-#define	CLKF_INTR(framep)	(((framep)->sr & PSL_M) == 0)
+#define	CLKF_INTR(framep)	(((framep)->cf_sr & PSL_M) == 0)
 #else
 /* but until we start using PSL_M, we have to do this instead */
 #define	CLKF_INTR(framep)	(0)	/* XXX */

Index: src/sys/arch/x68k/x68k/locore.s
diff -u src/sys/arch/x68k/x68k/locore.s:1.132 src/sys/arch/x68k/x68k/locore.s:1.133
--- src/sys/arch/x68k/x68k/locore.s:1.132	Fri Jan 19 18:18:56 2024
+++ src/sys/arch/x68k/x68k/locore.s	Fri Jan 19 18:49:10 2024
@@ -1,4 +1,4 @@
-/*	$NetBSD: locore.s,v 1.132 2024/01/19 18:18:56 thorpej Exp $	*/
+/*	$NetBSD: locore.s,v 1.133 2024/01/19 18:49:10 thorpej Exp $	*/
 
 /*
  * Copyright (c) 1988 University of Utah.
@@ -672,8 +672,7 @@ ENTRY_NOPROFILE(timertrap)
 	addql	#1,_C_LABEL(intr_depth)
 	INTERRUPT_SAVEREG		| save scratch registers
 	addql	#1,_C_LABEL(intrcnt)+32	| count hardclock interrupts
-	lea	%sp@(16),%a1		| a1 = &clockframe
-	movl	%a1,%sp@-
+	movl	%sp,%sp@-		| push pointer to clockframe
 	jbsr	_C_LABEL(hardclock)	| hardclock(&frame)
 	addql	#4,%sp
 	CPUINFO_INCREMENT(CI_NINTR)	| chalk up another interrupt

Reply via email to