Module Name: src Committed By: thorpej Date: Fri Jan 19 17:08:42 UTC 2024
Modified Files: src/sys/arch/amiga/amiga: locore.s src/sys/arch/amiga/include: cpu.h Log Message: Switch the amiga port to use the same clockframe layout as the other m68k ports. To generate a diff of this commit: cvs rdiff -u -r1.170 -r1.171 src/sys/arch/amiga/amiga/locore.s cvs rdiff -u -r1.85 -r1.86 src/sys/arch/amiga/include/cpu.h 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/amiga/amiga/locore.s diff -u src/sys/arch/amiga/amiga/locore.s:1.170 src/sys/arch/amiga/amiga/locore.s:1.171 --- src/sys/arch/amiga/amiga/locore.s:1.170 Wed Jan 17 12:33:49 2024 +++ src/sys/arch/amiga/amiga/locore.s Fri Jan 19 17:08:42 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: locore.s,v 1.170 2024/01/17 12:33:49 thorpej Exp $ */ +/* $NetBSD: locore.s,v 1.171 2024/01/19 17:08:42 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -479,9 +479,7 @@ ENTRY_NOPROFILE(DraCoLev2intr) btst #0,%d0 | timerA interrupt? jeq Ldraciaend - lea %sp@(16),%a1 | get pointer to PS - movl %a1,%sp@- | push pointer to PS, PC - + movl %sp,%sp@- | push pointer to clockframe movw #PSL_HIGHIPL,%sr | hardclock at high IPL jbsr _C_LABEL(hardclock) | call generic clock int routine addql #4,%sp | pop params @@ -504,10 +502,9 @@ ENTRY_NOPROFILE(DraCoLev1intr) jeq Ldrintrcommon | so test last. movw #PSL_HIGHIPL,%sr | run clock at high ipl Ldrclockretry: - lea %sp@(16),%a1 | get pointer to PS - movl %a1,%sp@- | push pointer to PS, PC + movl %sp,%sp@- | push pointer to clockframe jbsr _C_LABEL(hardclock) - addql #4,%sp | pop params + addql #4,%sp | pop params addql #1,_C_LABEL(intrcnt)+32 | add another system clock interrupt movl _C_LABEL(draco_ioct),%a0 @@ -627,8 +624,8 @@ ENTRY_NOPROFILE(fake_lev6intr) btst #0,%d0 | timerA interrupt? jeq Ltstciab4 | no movl %d0,%sp@- | push CIAB interrupt flags - lea %sp@(20),%a1 | get pointer to PS - movl %a1,%sp@- | push pointer to PS, PC + lea %sp@(4),%a1 | get pointer to clockframe + movl %a1,%sp@- | push pointer to clockframe jbsr _C_LABEL(hardclock) | call generic clock int routine addql #4,%sp | pop params addql #1,_C_LABEL(intrcnt)+32 | add another system clock interrupt Index: src/sys/arch/amiga/include/cpu.h diff -u src/sys/arch/amiga/include/cpu.h:1.85 src/sys/arch/amiga/include/cpu.h:1.86 --- src/sys/arch/amiga/include/cpu.h:1.85 Thu Jan 18 14:39:05 2024 +++ src/sys/arch/amiga/include/cpu.h Fri Jan 19 17:08:42 2024 @@ -1,4 +1,4 @@ -/* $NetBSD: cpu.h,v 1.85 2024/01/18 14:39:05 thorpej Exp $ */ +/* $NetBSD: cpu.h,v 1.86 2024/01/19 17:08:42 thorpej Exp $ */ /* * Copyright (c) 1988 University of Utah. @@ -55,19 +55,19 @@ extern volatile unsigned int interrupt_d /* * Arguments to hardclock and gatherstats encapsulate the previous * machine state in an opaque clockframe. On the amiga, 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) #define CLKF_INTR(framep) (interrupt_depth > 1) - /* * Preempt the current process if in interrupt from user mode, * or after the current trap/syscall if in system mode.