~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/m68k/sun3/sun3ints.c

Version: ~ [ linux-5.2-rc6 ] ~ [ linux-5.1.15 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.56 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.130 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.183 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.183 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.69 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.39.4 ] ~ [ linux-2.6.38.8 ] ~ [ linux-2.6.37.6 ] ~ [ linux-2.6.36.4 ] ~ [ linux-2.6.35.14 ] ~ [ linux-2.6.34.15 ] ~ [ linux-2.6.33.20 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1  /*
  2  * linux/arch/m68k/sun3/sun3ints.c -- Sun-3(x) Linux interrupt handling code
  3  *
  4  * This file is subject to the terms and conditions of the GNU General Public
  5  * License.  See the file COPYING in the main directory of this archive
  6  * for more details.
  7  */
  8 
  9 #include <linux/types.h>
 10 #include <linux/kernel.h>
 11 #include <linux/sched.h>
 12 #include <linux/kernel_stat.h>
 13 #include <linux/interrupt.h>
 14 #include <asm/segment.h>
 15 #include <asm/intersil.h>
 16 #include <asm/oplib.h>
 17 #include <asm/sun3ints.h>
 18 #include <asm/irq_regs.h>
 19 #include <linux/seq_file.h>
 20 
 21 extern void sun3_leds (unsigned char);
 22 
 23 void sun3_disable_interrupts(void)
 24 {
 25         sun3_disable_irq(0);
 26 }
 27 
 28 void sun3_enable_interrupts(void)
 29 {
 30         sun3_enable_irq(0);
 31 }
 32 
 33 static int led_pattern[8] = {
 34        ~(0x80), ~(0x01),
 35        ~(0x40), ~(0x02),
 36        ~(0x20), ~(0x04),
 37        ~(0x10), ~(0x08)
 38 };
 39 
 40 volatile unsigned char* sun3_intreg;
 41 
 42 void sun3_enable_irq(unsigned int irq)
 43 {
 44         *sun3_intreg |=  (1 << irq);
 45 }
 46 
 47 void sun3_disable_irq(unsigned int irq)
 48 {
 49         *sun3_intreg &= ~(1 << irq);
 50 }
 51 
 52 static irqreturn_t sun3_int7(int irq, void *dev_id)
 53 {
 54         unsigned int cnt;
 55 
 56         cnt = kstat_irqs_cpu(irq, 0);
 57         if (!(cnt % 2000))
 58                 sun3_leds(led_pattern[cnt % 16000 / 2000]);
 59         return IRQ_HANDLED;
 60 }
 61 
 62 static irqreturn_t sun3_int5(int irq, void *dev_id)
 63 {
 64         unsigned int cnt;
 65 
 66 #ifdef CONFIG_SUN3
 67         intersil_clear();
 68 #endif
 69 #ifdef CONFIG_SUN3
 70         intersil_clear();
 71 #endif
 72         xtime_update(1);
 73         update_process_times(user_mode(get_irq_regs()));
 74         cnt = kstat_irqs_cpu(irq, 0);
 75         if (!(cnt % 20))
 76                 sun3_leds(led_pattern[cnt % 160 / 20]);
 77         return IRQ_HANDLED;
 78 }
 79 
 80 static irqreturn_t sun3_vec255(int irq, void *dev_id)
 81 {
 82 //      intersil_clear();
 83         return IRQ_HANDLED;
 84 }
 85 
 86 static void sun3_irq_enable(struct irq_data *data)
 87 {
 88     sun3_enable_irq(data->irq);
 89 };
 90 
 91 static void sun3_irq_disable(struct irq_data *data)
 92 {
 93     sun3_disable_irq(data->irq);
 94 };
 95 
 96 static struct irq_chip sun3_irq_chip = {
 97         .name           = "sun3",
 98         .irq_startup    = m68k_irq_startup,
 99         .irq_shutdown   = m68k_irq_shutdown,
100         .irq_enable     = sun3_irq_enable,
101         .irq_disable    = sun3_irq_disable,
102         .irq_mask       = sun3_irq_disable,
103         .irq_unmask     = sun3_irq_enable,
104 };
105 
106 void __init sun3_init_IRQ(void)
107 {
108         *sun3_intreg = 1;
109 
110         m68k_setup_irq_controller(&sun3_irq_chip, handle_level_irq, IRQ_AUTO_1,
111                                   7);
112         m68k_setup_user_interrupt(VEC_USER, 128);
113 
114         if (request_irq(IRQ_AUTO_5, sun3_int5, 0, "int5", NULL))
115                 pr_err("Couldn't register %s interrupt\n", "int5");
116         if (request_irq(IRQ_AUTO_7, sun3_int7, 0, "int7", NULL))
117                 pr_err("Couldn't register %s interrupt\n", "int7");
118         if (request_irq(IRQ_USER+127, sun3_vec255, 0, "vec255", NULL))
119                 pr_err("Couldn't register %s interrupt\n", "vec255");
120 }
121 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp