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

TOMOYO Linux Cross Reference
Linux/arch/mips/include/asm/branch.h

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/include/asm/branch.h (Version linux-6.12-rc7) and /arch/i386/include/asm-i386/branch.h (Version linux-5.11.22)


  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) 1996, 1997, 1998, 2001 by Ral    
  7  */                                               
  8 #ifndef _ASM_BRANCH_H                             
  9 #define _ASM_BRANCH_H                             
 10                                                   
 11 #include <asm/cpu-features.h>                     
 12 #include <asm/mipsregs.h>                         
 13 #include <asm/ptrace.h>                           
 14 #include <asm/inst.h>                             
 15                                                   
 16 extern int __isa_exception_epc(struct pt_regs     
 17 extern int __compute_return_epc(struct pt_regs    
 18 extern int __compute_return_epc_for_insn(struc    
 19                                          union    
 20 extern int __microMIPS_compute_return_epc(stru    
 21 extern int __MIPS16e_compute_return_epc(struct    
 22                                                   
 23 /*                                                
 24  * microMIPS bitfields                            
 25  */                                               
 26 #define MM_POOL32A_MINOR_MASK   0x3f              
 27 #define MM_POOL32A_MINOR_SHIFT  0x6               
 28 #define MM_MIPS32_COND_FC       0x30              
 29                                                   
 30 int isBranchInstr(struct pt_regs *regs,           
 31         struct mm_decoded_insn dec_insn, unsig    
 32                                                   
 33 extern int __mm_isBranchInstr(struct pt_regs *    
 34         struct mm_decoded_insn dec_insn, unsig    
 35                                                   
 36 static inline int mm_isBranchInstr(struct pt_r    
 37         struct mm_decoded_insn dec_insn, unsig    
 38 {                                                 
 39         if (!cpu_has_mmips)                       
 40                 return 0;                         
 41                                                   
 42         return __mm_isBranchInstr(regs, dec_in    
 43 }                                                 
 44                                                   
 45 static inline int delay_slot(struct pt_regs *r    
 46 {                                                 
 47         return regs->cp0_cause & CAUSEF_BD;       
 48 }                                                 
 49                                                   
 50 static inline void clear_delay_slot(struct pt_    
 51 {                                                 
 52         regs->cp0_cause &= ~CAUSEF_BD;            
 53 }                                                 
 54                                                   
 55 static inline void set_delay_slot(struct pt_re    
 56 {                                                 
 57         regs->cp0_cause |= CAUSEF_BD;             
 58 }                                                 
 59                                                   
 60 static inline unsigned long exception_epc(stru    
 61 {                                                 
 62         if (likely(!delay_slot(regs)))            
 63                 return regs->cp0_epc;             
 64                                                   
 65         if (get_isa16_mode(regs->cp0_epc))        
 66                 return __isa_exception_epc(reg    
 67                                                   
 68         return regs->cp0_epc + 4;                 
 69 }                                                 
 70                                                   
 71 #define BRANCH_LIKELY_TAKEN 0x0001                
 72                                                   
 73 static inline int compute_return_epc(struct pt    
 74 {                                                 
 75         if (get_isa16_mode(regs->cp0_epc)) {      
 76                 if (cpu_has_mmips)                
 77                         return __microMIPS_com    
 78                 if (cpu_has_mips16)               
 79                         return __MIPS16e_compu    
 80         } else if (!delay_slot(regs)) {           
 81                 regs->cp0_epc += 4;               
 82                 return 0;                         
 83         }                                         
 84                                                   
 85         return __compute_return_epc(regs);        
 86 }                                                 
 87                                                   
 88 static inline int MIPS16e_compute_return_epc(s    
 89                                              u    
 90 {                                                 
 91         if (likely(!delay_slot(regs))) {          
 92                 if (inst->ri.opcode == MIPS16e    
 93                         regs->cp0_epc += 4;       
 94                         return 0;                 
 95                 }                                 
 96                 regs->cp0_epc += 2;               
 97                 return 0;                         
 98         }                                         
 99                                                   
100         return __MIPS16e_compute_return_epc(re    
101 }                                                 
102                                                   
103 #endif /* _ASM_BRANCH_H */                        
104                                                   

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