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

TOMOYO Linux Cross Reference
Linux/arch/m68k/include/asm/entry.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /arch/m68k/include/asm/entry.h (Architecture ppc) and /arch/m68k/include/asm-m68k/entry.h (Architecture m68k)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 
  2 #ifndef __M68K_ENTRY_H                            
  3 #define __M68K_ENTRY_H                            
  4                                                   
  5 #include <asm/setup.h>                            
  6 #include <asm/page.h>                             
  7 #ifdef __ASSEMBLY__                               
  8 #include <asm/thread_info.h>                      
  9 #endif                                            
 10                                                   
 11 /*                                                
 12  * Stack layout in 'ret_from_exception':          
 13  *                                                
 14  *      This allows access to the syscall argu    
 15  *                                                
 16  *       0(sp) - d1                               
 17  *       4(sp) - d2                               
 18  *       8(sp) - d3                               
 19  *       C(sp) - d4                               
 20  *      10(sp) - d5                               
 21  *      14(sp) - a0                               
 22  *      18(sp) - a1                               
 23  *      1C(sp) - a2                               
 24  *      20(sp) - d0                               
 25  *      24(sp) - orig_d0                          
 26  *      28(sp) - stack adjustment                 
 27  *      2C(sp) - [ sr              ] [ format     
 28  *      2E(sp) - [ pc-hiword       ] [ sr         
 29  *      30(sp) - [ pc-loword       ] [ pc-hiwo    
 30  *      32(sp) - [ format & vector ] [ pc-lowo    
 31  *                ^^^^^^^^^^^^^^^^^   ^^^^^^^^    
 32  *                      M68K              COLD    
 33  */                                               
 34                                                   
 35 /* the following macro is used when enabling i    
 36 #if defined(MACH_ATARI_ONLY)                      
 37         /* block out HSYNC = ipl 2 on the atar    
 38 #define ALLOWINT        (~0x500)                  
 39 #else                                             
 40         /* portable version */                    
 41 #define ALLOWINT        (~0x700)                  
 42 #endif /* machine compilation types */            
 43                                                   
 44 #ifdef __ASSEMBLY__                               
 45 /*                                                
 46  * This defines the normal kernel pt-regs layo    
 47  *                                                
 48  * regs a3-a6 and d6-d7 are preserved by C cod    
 49  * the kernel doesn't mess with usp unless it     
 50  */                                               
 51 #define SWITCH_STACK_SIZE       (6*4+4) /* inc    
 52                                                   
 53 #ifdef CONFIG_COLDFIRE                            
 54 #ifdef CONFIG_COLDFIRE_SW_A7                      
 55 /*                                                
 56  * This is made a little more tricky on older     
 57  * separate supervisor and user stack pointers    
 58  * construct a usp in software... When doing t    
 59  * interrupts, otherwise bad things will happe    
 60  */                                               
 61 .globl sw_usp                                     
 62 .globl sw_ksp                                     
 63                                                   
 64 .macro SAVE_ALL_SYS                               
 65         move    #0x2700,%sr             /* dis    
 66         btst    #5,%sp@(2)              /* fro    
 67         bnes    6f                      /* no,    
 68         movel   %sp,sw_usp              /* sav    
 69         addql   #8,sw_usp               /* rem    
 70         movel   sw_ksp,%sp              /* ker    
 71         subql   #8,%sp                  /* roo    
 72         clrl    %sp@-                   /* stk    
 73         movel   %d0,%sp@-               /* ori    
 74         movel   %d0,%sp@-               /* d0     
 75         lea     %sp@(-32),%sp           /* spa    
 76         moveml  %d1-%d5/%a0-%a2,%sp@              
 77         movel   sw_usp,%a0              /* get    
 78         movel   %a0@-,%sp@(PT_OFF_PC)   /* cop    
 79         movel   %a0@-,%sp@(PT_OFF_FORMATVEC)/*    
 80         bra     7f                                
 81         6:                                        
 82         clrl    %sp@-                   /* stk    
 83         movel   %d0,%sp@-               /* ori    
 84         movel   %d0,%sp@-               /* d0     
 85         lea     %sp@(-32),%sp           /* spa    
 86         moveml  %d1-%d5/%a0-%a2,%sp@              
 87         7:                                        
 88 .endm                                             
 89                                                   
 90 .macro SAVE_ALL_INT                               
 91         SAVE_ALL_SYS                              
 92         moveq   #-1,%d0                 /* not    
 93         movel   %d0,%sp@(PT_OFF_ORIG_D0)          
 94 .endm                                             
 95                                                   
 96 .macro RESTORE_USER                               
 97         move    #0x2700,%sr             /* dis    
 98         movel   sw_usp,%a0              /* get    
 99         movel   %sp@(PT_OFF_PC),%a0@-   /* cop    
100         movel   %sp@(PT_OFF_FORMATVEC),%a0@-/*    
101         moveml  %sp@,%d1-%d5/%a0-%a2              
102         lea     %sp@(32),%sp            /* spa    
103         movel   %sp@+,%d0                         
104         addql   #4,%sp                  /* ori    
105         addl    %sp@+,%sp               /* stk    
106         addql   #8,%sp                  /* rem    
107         movel   %sp,sw_ksp              /* sav    
108         subql   #8,sw_usp               /* set    
109         movel   sw_usp,%sp              /* res    
110         rte                                       
111 .endm                                             
112                                                   
113 .macro RDUSP                                      
114         movel   sw_usp,%a3                        
115 .endm                                             
116                                                   
117 .macro WRUSP                                      
118         movel   %a3,sw_usp                        
119 .endm                                             
120                                                   
121 #else /* !CONFIG_COLDFIRE_SW_A7 */                
122 /*                                                
123  * Modern ColdFire parts have separate supervi    
124  * pointers. Simple load and restore macros fo    
125  */                                               
126 .macro SAVE_ALL_SYS                               
127         move    #0x2700,%sr             /* dis    
128         clrl    %sp@-                   /* stk    
129         movel   %d0,%sp@-               /* ori    
130         movel   %d0,%sp@-               /* d0     
131         lea     %sp@(-32),%sp           /* spa    
132         moveml  %d1-%d5/%a0-%a2,%sp@              
133 .endm                                             
134                                                   
135 .macro SAVE_ALL_INT                               
136         move    #0x2700,%sr             /* dis    
137         clrl    %sp@-                   /* stk    
138         pea     -1:w                    /* ori    
139         movel   %d0,%sp@-               /* d0     
140         lea     %sp@(-32),%sp           /* spa    
141         moveml  %d1-%d5/%a0-%a2,%sp@              
142 .endm                                             
143                                                   
144 .macro RESTORE_USER                               
145         moveml  %sp@,%d1-%d5/%a0-%a2              
146         lea     %sp@(32),%sp            /* spa    
147         movel   %sp@+,%d0                         
148         addql   #4,%sp                  /* ori    
149         addl    %sp@+,%sp               /* stk    
150         rte                                       
151 .endm                                             
152                                                   
153 .macro RDUSP                                      
154         /*move  %usp,%a3*/                        
155         .word   0x4e6b                            
156 .endm                                             
157                                                   
158 .macro WRUSP                                      
159         /*move  %a3,%usp*/                        
160         .word   0x4e63                            
161 .endm                                             
162                                                   
163 #endif /* !CONFIG_COLDFIRE_SW_A7 */               
164                                                   
165 .macro SAVE_SWITCH_STACK                          
166         lea     %sp@(-24),%sp           /* 6 r    
167         moveml  %a3-%a6/%d6-%d7,%sp@              
168 .endm                                             
169                                                   
170 .macro RESTORE_SWITCH_STACK                       
171         moveml  %sp@,%a3-%a6/%d6-%d7              
172         lea     %sp@(24),%sp            /* 6 r    
173 .endm                                             
174                                                   
175 #else /* !CONFIG_COLDFIRE */                      
176                                                   
177 /*                                                
178  * All other types of m68k parts (68000, 680x0    
179  * entry and exit code.                           
180  */                                               
181                                                   
182 /*                                                
183  * a -1 in the orig_d0 field signifies            
184  * that the stack frame is NOT for syscall        
185  */                                               
186 .macro SAVE_ALL_INT                               
187         clrl    %sp@-                   /* stk    
188         pea     -1:w                    /* ori    
189         movel   %d0,%sp@-               /* d0     
190         moveml  %d1-%d5/%a0-%a2,%sp@-             
191 .endm                                             
192                                                   
193 .macro SAVE_ALL_SYS                               
194         clrl    %sp@-                   /* stk    
195         movel   %d0,%sp@-               /* ori    
196         movel   %d0,%sp@-               /* d0     
197         moveml  %d1-%d5/%a0-%a2,%sp@-             
198 .endm                                             
199                                                   
200 .macro RESTORE_ALL                                
201         moveml  %sp@+,%a0-%a2/%d1-%d5             
202         movel   %sp@+,%d0                         
203         addql   #4,%sp                  /* ori    
204         addl    %sp@+,%sp               /* stk    
205         rte                                       
206 .endm                                             
207                                                   
208                                                   
209 .macro SAVE_SWITCH_STACK                          
210         moveml  %a3-%a6/%d6-%d7,%sp@-             
211 .endm                                             
212                                                   
213 .macro RESTORE_SWITCH_STACK                       
214         moveml  %sp@+,%a3-%a6/%d6-%d7             
215 .endm                                             
216                                                   
217 #endif /* !CONFIG_COLDFIRE */                     
218                                                   
219 /*                                                
220  * Register %a2 is reserved and set to current    
221  * Non-MMU systems do not reserve %a2 in this     
222  * not used for them.                             
223  */                                               
224 #ifdef CONFIG_MMU                                 
225                                                   
226 #define curptr a2                                 
227                                                   
228 #define GET_CURRENT(tmp) get_current tmp          
229 .macro get_current reg=%d0                        
230         movel   %sp,\reg                          
231         andl    #-THREAD_SIZE,\reg                
232         movel   \reg,%curptr                      
233         movel   %curptr@,%curptr                  
234 .endm                                             
235                                                   
236 #else                                             
237                                                   
238 #define GET_CURRENT(tmp)                          
239                                                   
240 #endif /* CONFIG_MMU */                           
241                                                   
242 #else /* C source */                              
243                                                   
244 #define STR(X) STR1(X)                            
245 #define STR1(X) #X                                
246                                                   
247 #define SAVE_ALL_INT                              
248         "clrl   %%sp@-;"    /* stk_adj */         
249         "pea    -1:w;"      /* orig d0 = -1 */    
250         "movel  %%d0,%%sp@-;" /* d0 */            
251         "moveml %%d1-%%d5/%%a0-%%a2,%%sp@-"       
252                                                   
253 #define GET_CURRENT(tmp) \                        
254         "movel  %%sp,"#tmp"\n\t" \                
255         "andw   #-"STR(THREAD_SIZE)","#tmp"\n\    
256         "movel  "#tmp",%%a2\n\t" \                
257         "movel  %%a2@,%%a2"                       
258                                                   
259 #endif                                            
260                                                   
261 #endif /* __M68K_ENTRY_H */                       
262                                                   

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