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

TOMOYO Linux Cross Reference
Linux/arch/sh/kernel/machvec.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/sh/kernel/machvec.c (Version linux-6.12-rc7) and /arch/alpha/kernel/machvec.c (Version linux-4.14.336)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 /*                                                
  3  * arch/sh/kernel/machvec.c                       
  4  *                                                
  5  * The SuperH machine vector setup handlers, y    
  6  *                                                
  7  *  Copyright (C) 1999  Niibe Yutaka              
  8  *  Copyright (C) 2002 - 2007 Paul Mundt          
  9  */                                               
 10 #include <linux/init.h>                           
 11 #include <linux/string.h>                         
 12 #include <asm/machvec.h>                          
 13 #include <asm/sections.h>                         
 14 #include <asm/addrspace.h>                        
 15 #include <asm/setup.h>                            
 16 #include <asm/io.h>                               
 17 #include <asm/irq.h>                              
 18 #include <asm/processor.h>                        
 19                                                   
 20 #define MV_NAME_SIZE 32                           
 21                                                   
 22 #define for_each_mv(mv) \                         
 23         for ((mv) = (struct sh_machine_vector     
 24              (mv) && (unsigned long)(mv) < (un    
 25              (mv)++)                              
 26                                                   
 27 static struct sh_machine_vector * __init get_m    
 28 {                                                 
 29         struct sh_machine_vector *mv;             
 30                                                   
 31         for_each_mv(mv)                           
 32                 if (strcasecmp(name, mv->mv_na    
 33                         return mv;                
 34                                                   
 35         return NULL;                              
 36 }                                                 
 37                                                   
 38 static unsigned int __initdata machvec_selecte    
 39                                                   
 40 static int __init early_parse_mv(char *from)      
 41 {                                                 
 42         char mv_name[MV_NAME_SIZE] = "";          
 43         char *mv_end;                             
 44         char *mv_comma;                           
 45         int mv_len;                               
 46         struct sh_machine_vector *mvp;            
 47                                                   
 48         mv_end = strchr(from, ' ');               
 49         if (mv_end == NULL)                       
 50                 mv_end = from + strlen(from);     
 51                                                   
 52         mv_comma = strchr(from, ',');             
 53         mv_len = mv_end - from;                   
 54         if (mv_len > (MV_NAME_SIZE-1))            
 55                 mv_len = MV_NAME_SIZE-1;          
 56         memcpy(mv_name, from, mv_len);            
 57         mv_name[mv_len] = '\0';                   
 58         from = mv_end;                            
 59                                                   
 60         machvec_selected = 1;                     
 61                                                   
 62         /* Boot with the generic vector */        
 63         if (strcmp(mv_name, "generic") == 0)      
 64                 return 0;                         
 65                                                   
 66         mvp = get_mv_byname(mv_name);             
 67         if (unlikely(!mvp)) {                     
 68                 pr_info("Available vectors:\n\    
 69                 for_each_mv(mvp)                  
 70                         pr_cont("'%s', ", mvp-    
 71                 pr_cont("\n\n");                  
 72                 panic("Failed to select machve    
 73                       mv_name);                   
 74         } else                                    
 75                 sh_mv = *mvp;                     
 76                                                   
 77         return 0;                                 
 78 }                                                 
 79 early_param("sh_mv", early_parse_mv);             
 80                                                   
 81 void __init sh_mv_setup(void)                     
 82 {                                                 
 83         /*                                        
 84          * Only overload the machvec if one ha    
 85          * the command line with sh_mv=           
 86          */                                       
 87         if (!machvec_selected) {                  
 88                 unsigned long machvec_size;       
 89                                                   
 90                 machvec_size = ((unsigned long    
 91                                 (unsigned long    
 92                                                   
 93                 /*                                
 94                  * Sanity check for machvec se    
 95                  * __initmv hasn't been misuse    
 96                  */                               
 97                 if (machvec_size % sizeof(stru    
 98                         panic("machvec misalig    
 99                                                   
100                 /*                                
101                  * If the machvec hasn't been     
102                  * vector (usually the only on    
103                  */                               
104                 if (machvec_size >= sizeof(str    
105                         sh_mv = *(struct sh_ma    
106         }                                         
107                                                   
108         pr_notice("Booting machvec: %s\n", get    
109                                                   
110         /*                                        
111          * Manually walk the vec, fill in anyt    
112          * by hand, wrapping to the generic im    
113          */                                       
114 #define mv_set(elem) do { \                       
115         if (!sh_mv.mv_##elem) \                   
116                 sh_mv.mv_##elem = generic_##el    
117 } while (0)                                       
118                                                   
119         mv_set(irq_demux);                        
120         mv_set(mode_pins);                        
121         mv_set(mem_init);                         
122 }                                                 
123                                                   

~ [ 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