Mon Jan 21 14:42:24 2013 UTC ()
Account idepth properly in timer interrupt handler.


(tsutsui)
diff -r1.50 -r1.51 src/sys/arch/luna68k/luna68k/locore.s

cvs diff -r1.50 -r1.51 src/sys/arch/luna68k/luna68k/locore.s (expand / switch to unified diff)

--- src/sys/arch/luna68k/luna68k/locore.s 2013/01/18 18:41:12 1.50
+++ src/sys/arch/luna68k/luna68k/locore.s 2013/01/21 14:42:24 1.51
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1/* $NetBSD: locore.s,v 1.50 2013/01/18 18:41:12 tsutsui Exp $ */ 1/* $NetBSD: locore.s,v 1.51 2013/01/21 14:42:24 tsutsui Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1988 University of Utah. 4 * Copyright (c) 1988 University of Utah.
5 * Copyright (c) 1980, 1990, 1993 5 * Copyright (c) 1980, 1990, 1993
6 * The Regents of the University of California. All rights reserved. 6 * The Regents of the University of California. All rights reserved.
7 * 7 *
8 * This code is derived from software contributed to Berkeley by 8 * This code is derived from software contributed to Berkeley by
9 * the Systems Programming Group of the University of Utah Computer 9 * the Systems Programming Group of the University of Utah Computer
10 * Science Department. 10 * Science Department.
11 * 11 *
12 * Redistribution and use in source and binary forms, with or without 12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions 13 * modification, are permitted provided that the following conditions
14 * are met: 14 * are met:
@@ -809,39 +809,41 @@ ENTRY_NOPROFILE(intrhand_vectored) @@ -809,39 +809,41 @@ ENTRY_NOPROFILE(intrhand_vectored)
809 INTERRUPT_SAVEREG 809 INTERRUPT_SAVEREG
810 lea %sp@(16),%a1 | get pointer to frame 810 lea %sp@(16),%a1 | get pointer to frame
811 movl %a1,%sp@- 811 movl %a1,%sp@-
812 movw %sp@(26),%d0 812 movw %sp@(26),%d0
813 movl %d0,%sp@- | push exception vector info 813 movl %d0,%sp@- | push exception vector info
814 movl %sp@(26),%sp@- | and PC 814 movl %sp@(26),%sp@- | and PC
815 jbsr _C_LABEL(isrdispatch_vectored) | call dispatcher 815 jbsr _C_LABEL(isrdispatch_vectored) | call dispatcher
816 lea %sp@(12),%sp | pop value args 816 lea %sp@(12),%sp | pop value args
817 INTERRUPT_RESTOREREG 817 INTERRUPT_RESTOREREG
818 jra _ASM_LABEL(rei) | all done 818 jra _ASM_LABEL(rei) | all done
819 819
820#if 1 /* XXX wild timer -- how can I disable/enable the interrupt? */ 820#if 1 /* XXX wild timer -- how can I disable/enable the interrupt? */
821ENTRY_NOPROFILE(lev5intr) 821ENTRY_NOPROFILE(lev5intr)
 822 addql #1,_C_LABEL(idepth)
822 btst #7,0x63000000 | check whether system clock 823 btst #7,0x63000000 | check whether system clock
823 beq 1f 824 beq 1f
824 movb #1,0x63000000 | clear the interrupt 825 movb #1,0x63000000 | clear the interrupt
825 tstl _C_LABEL(clock_enable) | is hardclock() available? 826 tstl _C_LABEL(clock_enable) | is hardclock() available?
826 jeq 1f 827 jeq 1f
827 INTERRUPT_SAVEREG 828 INTERRUPT_SAVEREG
828 lea %sp@(16),%a1 | %a1 = &clockframe 829 lea %sp@(16),%a1 | %a1 = &clockframe
829 movl %a1,%sp@- 830 movl %a1,%sp@-
830 jbsr _C_LABEL(hardclock) | hardclock(&frame) 831 jbsr _C_LABEL(hardclock) | hardclock(&frame)
831 addql #4,%sp 832 addql #4,%sp
832 addql #1,_C_LABEL(intrcnt)+20 833 addql #1,_C_LABEL(intrcnt)+20
833 INTERRUPT_RESTOREREG 834 INTERRUPT_RESTOREREG
8341: 8351:
 836 addql #1,_C_LABEL(idepth)
835 jra _ASM_LABEL(rei) | all done 837 jra _ASM_LABEL(rei) | all done
836#endif 838#endif
837 839
838#undef INTERRUPT_SAVEREG 840#undef INTERRUPT_SAVEREG
839#undef INTERRUPT_RESTOREREG 841#undef INTERRUPT_RESTOREREG
840 842
841/* 843/*
842 * Emulation of VAX REI instruction. 844 * Emulation of VAX REI instruction.
843 * 845 *
844 * This code deals with checking for and servicing ASTs 846 * This code deals with checking for and servicing ASTs
845 * (profiling, scheduling) and software interrupts (network, softclock). 847 * (profiling, scheduling) and software interrupts (network, softclock).
846 * We check for ASTs first, just like the VAX. To avoid excess overhead 848 * We check for ASTs first, just like the VAX. To avoid excess overhead
847 * the T_ASTFLT handling code will also check for software interrupts so we 849 * the T_ASTFLT handling code will also check for software interrupts so we