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

TOMOYO Linux Cross Reference
Linux/arch/loongarch/include/asm/stacktrace.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/loongarch/include/asm/stacktrace.h (Architecture m68k) and /arch/mips/include/asm-mips/stacktrace.h (Architecture mips)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 /*                                                
  3  * Copyright (C) 2020-2022 Loongson Technology    
  4  */                                               
  5 #ifndef _ASM_STACKTRACE_H                         
  6 #define _ASM_STACKTRACE_H                         
  7                                                   
  8 #include <asm/asm.h>                              
  9 #include <asm/ptrace.h>                           
 10 #include <asm/loongarch.h>                        
 11 #include <linux/stringify.h>                      
 12                                                   
 13 enum stack_type {                                 
 14         STACK_TYPE_UNKNOWN,                       
 15         STACK_TYPE_IRQ,                           
 16         STACK_TYPE_TASK,                          
 17 };                                                
 18                                                   
 19 struct stack_info {                               
 20         enum stack_type type;                     
 21         unsigned long begin, end, next_sp;        
 22 };                                                
 23                                                   
 24 struct stack_frame {                              
 25         unsigned long   fp;                       
 26         unsigned long   ra;                       
 27 };                                                
 28                                                   
 29 bool in_irq_stack(unsigned long stack, struct     
 30 bool in_task_stack(unsigned long stack, struct    
 31 int get_stack_info(unsigned long stack, struct    
 32                                                   
 33 #define STR_LONG_L    __stringify(LONG_L)         
 34 #define STR_LONG_S    __stringify(LONG_S)         
 35 #define STR_LONGSIZE  __stringify(LONGSIZE)       
 36                                                   
 37 #define STORE_ONE_REG(r) \                        
 38     STR_LONG_S   " $r" __stringify(r)", %1, "S    
 39                                                   
 40 #define CSRRD_ONE_REG(reg) \                      
 41     __stringify(csrrd) " %0, "__stringify(reg)    
 42                                                   
 43 static __always_inline void prepare_frametrace    
 44 {                                                 
 45         __asm__ __volatile__(                     
 46                 /* Save $ra */                    
 47                 STORE_ONE_REG(1)                  
 48                 /* Use $ra to save PC */          
 49                 "pcaddi $ra, 0\n\t"               
 50                 STR_LONG_S " $ra, %0\n\t"         
 51                 /* Restore $ra */                 
 52                 STR_LONG_L " $ra, %1, "STR_LON    
 53                 STORE_ONE_REG(2)                  
 54                 STORE_ONE_REG(3)                  
 55                 STORE_ONE_REG(4)                  
 56                 STORE_ONE_REG(5)                  
 57                 STORE_ONE_REG(6)                  
 58                 STORE_ONE_REG(7)                  
 59                 STORE_ONE_REG(8)                  
 60                 STORE_ONE_REG(9)                  
 61                 STORE_ONE_REG(10)                 
 62                 STORE_ONE_REG(11)                 
 63                 STORE_ONE_REG(12)                 
 64                 STORE_ONE_REG(13)                 
 65                 STORE_ONE_REG(14)                 
 66                 STORE_ONE_REG(15)                 
 67                 STORE_ONE_REG(16)                 
 68                 STORE_ONE_REG(17)                 
 69                 STORE_ONE_REG(18)                 
 70                 STORE_ONE_REG(19)                 
 71                 STORE_ONE_REG(20)                 
 72                 STORE_ONE_REG(21)                 
 73                 STORE_ONE_REG(22)                 
 74                 STORE_ONE_REG(23)                 
 75                 STORE_ONE_REG(24)                 
 76                 STORE_ONE_REG(25)                 
 77                 STORE_ONE_REG(26)                 
 78                 STORE_ONE_REG(27)                 
 79                 STORE_ONE_REG(28)                 
 80                 STORE_ONE_REG(29)                 
 81                 STORE_ONE_REG(30)                 
 82                 STORE_ONE_REG(31)                 
 83                 : "=m" (regs->csr_era)            
 84                 : "r" (regs->regs)                
 85                 : "memory");                      
 86         __asm__ __volatile__(CSRRD_ONE_REG(LOO    
 87         __asm__ __volatile__(CSRRD_ONE_REG(LOO    
 88         __asm__ __volatile__(CSRRD_ONE_REG(LOO    
 89         __asm__ __volatile__(CSRRD_ONE_REG(LOO    
 90         __asm__ __volatile__(CSRRD_ONE_REG(LOO    
 91         __asm__ __volatile__(CSRRD_ONE_REG(LOO    
 92 }                                                 
 93                                                   
 94 #endif /* _ASM_STACKTRACE_H */                    
 95                                                   

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