| @@ -1,14 +1,14 @@ | | | @@ -1,14 +1,14 @@ |
1 | /* $NetBSD: pic_uic.c,v 1.4 2013/11/19 12:46:43 kiyohara Exp $ */ | | 1 | /* $NetBSD: pic_uic.c,v 1.5 2020/03/05 11:33:14 rin Exp $ */ |
2 | | | 2 | |
3 | /* | | 3 | /* |
4 | * Copyright 2002 Wasabi Systems, Inc. | | 4 | * Copyright 2002 Wasabi Systems, Inc. |
5 | * All rights reserved. | | 5 | * All rights reserved. |
6 | * | | 6 | * |
7 | * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. | | 7 | * Written by Eduardo Horvath and Simon Burge for Wasabi Systems, Inc. |
8 | * | | 8 | * |
9 | * Redistribution and use in source and binary forms, with or without | | 9 | * Redistribution and use in source and binary forms, with or without |
10 | * modification, are permitted provided that the following conditions | | 10 | * modification, are permitted provided that the following conditions |
11 | * are met: | | 11 | * are met: |
12 | * 1. Redistributions of source code must retain the above copyright | | 12 | * 1. Redistributions of source code must retain the above copyright |
13 | * notice, this list of conditions and the following disclaimer. | | 13 | * notice, this list of conditions and the following disclaimer. |
14 | * 2. Redistributions in binary form must reproduce the above copyright | | 14 | * 2. Redistributions in binary form must reproduce the above copyright |
| @@ -26,27 +26,27 @@ | | | @@ -26,27 +26,27 @@ |
26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | | 26 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED |
27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | | 27 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR |
28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC | | 28 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL WASABI SYSTEMS, INC |
29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | | 29 | * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR |
30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | | 30 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF |
31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | | 31 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS |
32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | | 32 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN |
33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | | 33 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) |
34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | | 34 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
35 | * POSSIBILITY OF SUCH DAMAGE. | | 35 | * POSSIBILITY OF SUCH DAMAGE. |
36 | */ | | 36 | */ |
37 | | | 37 | |
38 | #include <sys/cdefs.h> | | 38 | #include <sys/cdefs.h> |
39 | __KERNEL_RCSID(0, "$NetBSD: pic_uic.c,v 1.4 2013/11/19 12:46:43 kiyohara Exp $"); | | 39 | __KERNEL_RCSID(0, "$NetBSD: pic_uic.c,v 1.5 2020/03/05 11:33:14 rin Exp $"); |
40 | | | 40 | |
41 | #include <sys/param.h> | | 41 | #include <sys/param.h> |
42 | #include <sys/kernel.h> | | 42 | #include <sys/kernel.h> |
43 | #include <sys/evcnt.h> | | 43 | #include <sys/evcnt.h> |
44 | #include <sys/cpu.h> | | 44 | #include <sys/cpu.h> |
45 | | | 45 | |
46 | #include <machine/intr.h> | | 46 | #include <machine/intr.h> |
47 | #include <machine/psl.h> | | 47 | #include <machine/psl.h> |
48 | | | 48 | |
49 | #include <powerpc/spr.h> | | 49 | #include <powerpc/spr.h> |
50 | #include <powerpc/ibm4xx/spr.h> | | 50 | #include <powerpc/ibm4xx/spr.h> |
51 | #include <powerpc/ibm4xx/cpu.h> | | 51 | #include <powerpc/ibm4xx/cpu.h> |
52 | | | 52 | |
| @@ -285,32 +285,26 @@ struct pic_ops pic_uic2 = { | | | @@ -285,32 +285,26 @@ struct pic_ops pic_uic2 = { |
285 | .pic_enable_irq = uic_enable_irq, | | 285 | .pic_enable_irq = uic_enable_irq, |
286 | .pic_reenable_irq = uic_enable_irq, | | 286 | .pic_reenable_irq = uic_enable_irq, |
287 | .pic_disable_irq = uic_disable_irq, | | 287 | .pic_disable_irq = uic_disable_irq, |
288 | .pic_establish_irq = uic_establish_irq, | | 288 | .pic_establish_irq = uic_establish_irq, |
289 | .pic_get_irq = uic_get_irq, | | 289 | .pic_get_irq = uic_get_irq, |
290 | .pic_ack_irq = uic_ack_irq, | | 290 | .pic_ack_irq = uic_ack_irq, |
291 | .pic_finish_setup = uic2_finish_setup, | | 291 | .pic_finish_setup = uic2_finish_setup, |
292 | .pic_name = "uic2" | | 292 | .pic_name = "uic2" |
293 | }; | | 293 | }; |
294 | | | 294 | |
295 | #endif /* MULTIUIC */ | | 295 | #endif /* MULTIUIC */ |
296 | #endif /* !PPC_IBM403 */ | | 296 | #endif /* !PPC_IBM403 */ |
297 | | | 297 | |
298 | /* Write External Enable Immediate */ | | | |
299 | #define wrteei(en) __asm volatile ("wrteei %0" : : "K"(en)) | | | |
300 | | | | |
301 | /* Enforce In Order Execution of I/O */ | | | |
302 | #define eieio() __asm volatile ("eieio") | | | |
303 | | | | |
304 | /* | | 298 | /* |
305 | * Set up interrupt mapping array. | | 299 | * Set up interrupt mapping array. |
306 | */ | | 300 | */ |
307 | void | | 301 | void |
308 | intr_init(void) | | 302 | intr_init(void) |
309 | { | | 303 | { |
310 | #ifdef PPC_IBM403 | | 304 | #ifdef PPC_IBM403 |
311 | struct pic_ops * const pic = &pic_uic403; | | 305 | struct pic_ops * const pic = &pic_uic403; |
312 | #else | | 306 | #else |
313 | struct pic_ops * const pic = &pic_uic0; | | 307 | struct pic_ops * const pic = &pic_uic0; |
314 | #endif | | 308 | #endif |
315 | struct uic * const uic = pic->pic_cookie; | | 309 | struct uic * const uic = pic->pic_cookie; |
316 | | | 310 | |