Deleted Added
full compact
interrupt.c (139825) interrupt.c (153666)
1/*-
2 * Copyright 2002 by Peter Grehan. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
1/*-
2 * Copyright 2002 by Peter Grehan. All rights reserved.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer.

--- 10 unchanged lines hidden (view full) ---

19 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
21 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
22 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
23 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25 * SUCH DAMAGE.
26 *
27 * $FreeBSD: head/sys/powerpc/aim/interrupt.c 139825 2005-01-07 02:29:27Z imp $
27 * $FreeBSD: head/sys/powerpc/aim/interrupt.c 153666 2005-12-22 22:16:09Z jhb $
28 */
29
30/*
31 * Interrupts are dispatched to here from locore asm
32 */
33
34#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
35

--- 31 unchanged lines hidden (view full) ---

67static void (*powerpc_extintr_handler)(void);
68
69void
70ext_intr_install(void (*new_extint)(void))
71{
72 powerpc_extintr_handler = new_extint;
73}
74
28 */
29
30/*
31 * Interrupts are dispatched to here from locore asm
32 */
33
34#include <sys/cdefs.h> /* RCS ID & Copyright macro defns */
35

--- 31 unchanged lines hidden (view full) ---

67static void (*powerpc_extintr_handler)(void);
68
69void
70ext_intr_install(void (*new_extint)(void))
71{
72 powerpc_extintr_handler = new_extint;
73}
74
75extern void decr_intr(struct clockframe *);
75extern void decr_intr(struct trapframe *);
76extern void trap(struct trapframe *);
77
78/*
79 * A very short dispatch, to try and maximise assembler code use
80 * between all exception types. Maybe 'true' interrupts should go
81 * here, and the trap code can come in separately
82 */
83void
84powerpc_interrupt(struct trapframe *framep)
85{
86 struct thread *td;
76extern void trap(struct trapframe *);
77
78/*
79 * A very short dispatch, to try and maximise assembler code use
80 * between all exception types. Maybe 'true' interrupts should go
81 * here, and the trap code can come in separately
82 */
83void
84powerpc_interrupt(struct trapframe *framep)
85{
86 struct thread *td;
87 struct clockframe ckframe;
88
89 td = curthread;
90
91 switch (framep->exc) {
92 case EXC_EXI:
93 atomic_add_int(&td->td_intr_nesting_level, 1);
94 (*powerpc_extintr_handler)();
95 atomic_subtract_int(&td->td_intr_nesting_level, 1);
96 break;
97
98 case EXC_DECR:
99 atomic_add_int(&td->td_intr_nesting_level, 1);
87
88 td = curthread;
89
90 switch (framep->exc) {
91 case EXC_EXI:
92 atomic_add_int(&td->td_intr_nesting_level, 1);
93 (*powerpc_extintr_handler)();
94 atomic_subtract_int(&td->td_intr_nesting_level, 1);
95 break;
96
97 case EXC_DECR:
98 atomic_add_int(&td->td_intr_nesting_level, 1);
100 ckframe.srr0 = framep->srr0;
101 ckframe.srr1 = framep->srr1;
102 decr_intr(&ckframe);
99 decr_intr(framep);
103 atomic_subtract_int(&td->td_intr_nesting_level, 1);
104 break;
105
106 default:
107 /*
108 * Re-enable interrupts and call the generic trap code
109 */
110#if 0
111 printf("powerpc_interrupt: got trap\n");
112 mtmsr(mfmsr() | PSL_EE);
113 isync();
114#endif
115 trap(framep);
116 }
117}
100 atomic_subtract_int(&td->td_intr_nesting_level, 1);
101 break;
102
103 default:
104 /*
105 * Re-enable interrupts and call the generic trap code
106 */
107#if 0
108 printf("powerpc_interrupt: got trap\n");
109 mtmsr(mfmsr() | PSL_EE);
110 isync();
111#endif
112 trap(framep);
113 }
114}