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

TOMOYO Linux Cross Reference
Linux/arch/mips/kernel/rtlx-mt.c

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.12 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/mips/kernel/rtlx-mt.c (Version linux-6.12-rc7) and /arch/ppc/kernel/rtlx-mt.c (Version linux-4.20.17)


  1 /*                                                  1 
  2  * This file is subject to the terms and condi    
  3  * License.  See the file "COPYING" in the mai    
  4  * for more details.                              
  5  *                                                
  6  * Copyright (C) 2005 MIPS Technologies, Inc.     
  7  * Copyright (C) 2013 Imagination Technologies    
  8  */                                               
  9 #include <linux/device.h>                         
 10 #include <linux/fs.h>                             
 11 #include <linux/err.h>                            
 12 #include <linux/wait.h>                           
 13 #include <linux/sched.h>                          
 14 #include <linux/interrupt.h>                      
 15 #include <linux/irq.h>                            
 16                                                   
 17 #include <asm/mips_mt.h>                          
 18 #include <asm/vpe.h>                              
 19 #include <asm/rtlx.h>                             
 20                                                   
 21 static int major;                                 
 22                                                   
 23 static void rtlx_dispatch(void)                   
 24 {                                                 
 25         if (read_c0_cause() & read_c0_status()    
 26                 do_IRQ(MIPS_CPU_IRQ_BASE + MIP    
 27 }                                                 
 28                                                   
 29 /*                                                
 30  * Interrupt handler may be called before rtlx    
 31  * a chance to run.                               
 32  */                                               
 33 static irqreturn_t rtlx_interrupt(int irq, voi    
 34 {                                                 
 35         unsigned int vpeflags;                    
 36         unsigned long flags;                      
 37         int i;                                    
 38                                                   
 39         local_irq_save(flags);                    
 40         vpeflags = dvpe();                        
 41         set_c0_status(0x100 << MIPS_CPU_RTLX_I    
 42         irq_enable_hazard();                      
 43         evpe(vpeflags);                           
 44         local_irq_restore(flags);                 
 45                                                   
 46         for (i = 0; i < RTLX_CHANNELS; i++) {     
 47                 wake_up(&channel_wqs[i].lx_que    
 48                 wake_up(&channel_wqs[i].rt_que    
 49         }                                         
 50                                                   
 51         return IRQ_HANDLED;                       
 52 }                                                 
 53                                                   
 54 static int rtlx_irq_num = MIPS_CPU_IRQ_BASE +     
 55                                                   
 56 void _interrupt_sp(void)                          
 57 {                                                 
 58         unsigned long flags;                      
 59                                                   
 60         local_irq_save(flags);                    
 61         dvpe();                                   
 62         settc(1);                                 
 63         write_vpe_c0_cause(read_vpe_c0_cause()    
 64         evpe(EVPE_ENABLE);                        
 65         local_irq_restore(flags);                 
 66 }                                                 
 67                                                   
 68 int __init rtlx_module_init(void)                 
 69 {                                                 
 70         struct device *dev;                       
 71         int i, err;                               
 72                                                   
 73         if (!cpu_has_mipsmt) {                    
 74                 pr_warn("VPE loader: not a MIP    
 75                 return -ENODEV;                   
 76         }                                         
 77                                                   
 78         if (aprp_cpu_index() == 0) {              
 79                 pr_warn("No TCs reserved for A    
 80                         "Pass maxtcs=<n> argum    
 81                                                   
 82                 return -ENODEV;                   
 83         }                                         
 84                                                   
 85         major = register_chrdev(0, RTLX_MODULE    
 86         if (major < 0) {                          
 87                 pr_err("rtlx_module_init: unab    
 88                 return major;                     
 89         }                                         
 90                                                   
 91         /* initialise the wait queues */          
 92         for (i = 0; i < RTLX_CHANNELS; i++) {     
 93                 init_waitqueue_head(&channel_w    
 94                 init_waitqueue_head(&channel_w    
 95                 atomic_set(&channel_wqs[i].in_    
 96                 mutex_init(&channel_wqs[i].mut    
 97                                                   
 98                 dev = device_create(&mt_class,    
 99                                     "%s%d", RT    
100                 if (IS_ERR(dev)) {                
101                         while (i--)               
102                                 device_destroy    
103                                                   
104                         err = PTR_ERR(dev);       
105                         goto out_chrdev;          
106                 }                                 
107         }                                         
108                                                   
109         /* set up notifiers */                    
110         rtlx_notify.start = rtlx_starting;        
111         rtlx_notify.stop = rtlx_stopping;         
112         vpe_notify(aprp_cpu_index(), &rtlx_not    
113                                                   
114         if (cpu_has_vint) {                       
115                 aprp_hook = rtlx_dispatch;        
116         } else {                                  
117                 pr_err("APRP RTLX init on non-    
118                 err = -ENODEV;                    
119                 goto out_class;                   
120         }                                         
121                                                   
122         err = request_irq(rtlx_irq_num, rtlx_i    
123         if (err)                                  
124                 goto out_class;                   
125                                                   
126         return 0;                                 
127                                                   
128 out_class:                                        
129         for (i = 0; i < RTLX_CHANNELS; i++)       
130                 device_destroy(&mt_class, MKDE    
131 out_chrdev:                                       
132         unregister_chrdev(major, RTLX_MODULE_N    
133                                                   
134         return err;                               
135 }                                                 
136                                                   
137 void __exit rtlx_module_exit(void)                
138 {                                                 
139         int i;                                    
140                                                   
141         for (i = 0; i < RTLX_CHANNELS; i++)       
142                 device_destroy(&mt_class, MKDE    
143                                                   
144         unregister_chrdev(major, RTLX_MODULE_N    
145                                                   
146         aprp_hook = NULL;                         
147 }                                                 
148                                                   

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

kernel.org | git.kernel.org | LWN.net | Project Home | 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.

sflogo.php