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

TOMOYO Linux Cross Reference
Linux/arch/alpha/lib/ev6-clear_user.S

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/alpha/lib/ev6-clear_user.S (Architecture ppc) and /arch/sparc/lib/ev6-clear_user.S (Architecture sparc)


  1 /* SPDX-License-Identifier: GPL-2.0 */            
  2 /*                                                
  3  * arch/alpha/lib/ev6-clear_user.S                
  4  * 21264 version contributed by Rick Gorton <ri    
  5  *                                                
  6  * Zero user space, handling exceptions as we     
  7  *                                                
  8  * We have to make sure that $0 is always up-t    
  9  * right "bytes left to zero" value (and that     
 10  * a successful copy).  There is also some rat    
 11  * stuff.                                         
 12  *                                                
 13  * Much of the information about 21264 schedul    
 14  *      Compiler Writer's Guide for the Alpha     
 15  *      abbreviated as 'CWG' in other comments    
 16  *      ftp.digital.com/pub/Digital/info/semic    
 17  * Scheduling notation:                           
 18  *      E       - either cluster                  
 19  *      U       - upper subcluster; U0 - subcl    
 20  *      L       - lower subcluster; L0 - subcl    
 21  * Try not to change the actual algorithm if p    
 22  * Determining actual stalls (other than slott    
 23  * From perusing the source code context where    
 24  * a fair assumption that significant fraction    
 25  * it's going to be worth the effort to hand-u    
 26  * ASSUMPTION:                                    
 27  *      The believed purpose of only updating     
 28  *      may come along during the execution of    
 29  *      want to leave a hole (and we also want    
 30  */                                               
 31                                                   
 32 #include <linux/export.h>                         
 33 /* Allow an exception for an insn; exit if we     
 34 #define EX(x,y...)                      \         
 35         99: x,##y;                      \         
 36         .section __ex_table,"a";        \         
 37         .long 99b - .;                  \         
 38         lda $31, $exception-99b($31);   \         
 39         .previous                                 
 40                                                   
 41         .set noat                                 
 42         .set noreorder                            
 43         .align 4                                  
 44                                                   
 45         .globl __clear_user                       
 46         .ent __clear_user                         
 47         .frame  $30, 0, $26                       
 48         .prologue 0                               
 49                                                   
 50                                 # Pipeline inf    
 51 __clear_user:                                     
 52         and     $17, $17, $0                      
 53         and     $16, 7, $4      # .. E  .. ..     
 54         beq     $0, $zerolength # U  .. .. ..     
 55                                                   
 56         addq    $0, $4, $1      # .. .. .. E      
 57         and     $1, 7, $2       # .. .. E  ..     
 58 # Note - we never actually use $2, so this is     
 59 # and we can rewrite this later...                
 60         srl     $1, 3, $1       # .. E  .. ..     
 61         beq     $4, $headalign  # U  .. .. ..     
 62                                                   
 63 /*                                                
 64  * Head is not aligned.  Write (8 - $4) bytes     
 65  * This means $16 is known to be misaligned       
 66  */                                               
 67         EX( ldq_u $5, 0($16) )  # .. .. .. L      
 68         beq     $1, $onebyte    # .. .. U  ..     
 69         mskql   $5, $16, $5     # .. U  .. ..     
 70         addq    $16, 8, $16     # E  .. .. ..     
 71                                                   
 72         EX( stq_u $5, -8($16) ) # .. .. .. L      
 73         subq    $1, 1, $1       # .. .. E  ..     
 74         addq    $0, $4, $0      # .. E  .. ..     
 75         subq    $0, 8, $0       # E  .. .. ..     
 76                                                   
 77         .align  4                                 
 78 /*                                                
 79  * (The .align directive ought to be a moot po    
 80  * values upon initial entry to the loop          
 81  * $1 is number of quadwords to clear (zero is    
 82  * $2 is number of trailing bytes (0..7) ($2 n    
 83  * $16 is known to be aligned 0mod8               
 84  */                                               
 85 $headalign:                                       
 86         subq    $1, 16, $4      # .. .. .. E      
 87         and     $16, 0x3f, $2   # .. .. E  ..     
 88         subq    $2, 0x40, $3    # .. E  .. ..     
 89         blt     $4, $trailquad  # U  .. .. ..     
 90                                                   
 91 /*                                                
 92  * We know that we're going to do at least 16     
 93  * going to be able to use the large block cle    
 94  * Figure out how many quads we need to clear     
 95  * so we can use the wh64 instruction.            
 96  */                                               
 97                                                   
 98         nop                     # .. .. .. E      
 99         nop                     # .. .. E  ..     
100         nop                     # .. E  .. ..     
101         beq     $3, $bigalign   # U  .. .. ..     
102                                                   
103 $alignmod64:                                      
104         EX( stq_u $31, 0($16) ) # .. .. .. L      
105         addq    $3, 8, $3       # .. .. E  ..     
106         subq    $0, 8, $0       # .. E  .. ..     
107         nop                     # E  .. .. ..     
108                                                   
109         nop                     # .. .. .. E      
110         subq    $1, 1, $1       # .. .. E  ..     
111         addq    $16, 8, $16     # .. E  .. ..     
112         blt     $3, $alignmod64 # U  .. .. ..     
113                                                   
114 $bigalign:                                        
115 /*                                                
116  * $0 is the number of bytes left                 
117  * $1 is the number of quads left                 
118  * $16 is aligned 0mod64                          
119  * we know that we'll be taking a minimum of o    
120  * CWG Section 3.7.6: do not expect a sustaine    
121  * We are _not_ going to update $0 after every    
122  * would be silly, because there will be cross    
123  * no matter how the code is scheduled.  By do    
124  * staggered fashion, we can still do this loo    
125  * The worse case will be doing two extra quad    
126  * in the event of an interrupted clear.          
127  * Assumes the wh64 needs to be for 2 trips th    
128  * The wh64 is issued on for the starting dest    
129  * through the loop, and if there are less tha    
130  * address will be for the current trip.          
131  */                                               
132         nop                     # E :             
133         nop                     # E :             
134         nop                     # E :             
135         bis     $16,$16,$3      # E : U L U L     
136         /* This might actually help for the cu    
137                                                   
138 $do_wh64:                                         
139         wh64    ($3)            # .. .. .. L1     
140         subq    $1, 16, $4      # .. .. E  ..     
141         EX( stq_u $31, 0($16) ) # .. L  .. ..     
142         subq    $0, 8, $0       # E  .. .. ..     
143                                                   
144         addq    $16, 128, $3    # E : Target a    
145         EX( stq_u $31, 8($16) ) # L :             
146         EX( stq_u $31, 16($16) )        # L :     
147         subq    $0, 16, $0      # E : U L L U     
148                                                   
149         nop                     # E :             
150         EX( stq_u $31, 24($16) )        # L :     
151         EX( stq_u $31, 32($16) )        # L :     
152         subq    $0, 168, $5     # E : U L L U     
153         /* 168 = 192 - 24, since we've already    
154                                                   
155         subq    $0, 16, $0      # E :             
156         EX( stq_u $31, 40($16) )        # L :     
157         EX( stq_u $31, 48($16) )        # L :     
158         cmovlt  $5, $16, $3     # E : U L L U     
159                                                   
160         subq    $1, 8, $1       # E :             
161         subq    $0, 16, $0      # E :             
162         EX( stq_u $31, 56($16) )        # L :     
163         nop                     # E : U L U L     
164                                                   
165         nop                     # E :             
166         subq    $0, 8, $0       # E :             
167         addq    $16, 64, $16    # E :             
168         bge     $4, $do_wh64    # U : U L U L     
169                                                   
170 $trailquad:                                       
171         # zero to 16 quadwords left to store,     
172         # $1 is the number of quadwords left t    
173         #                                         
174         nop                     # .. .. .. E      
175         nop                     # .. .. E  ..     
176         nop                     # .. E  .. ..     
177         beq     $1, $trailbytes # U  .. .. ..     
178                                                   
179 $onequad:                                         
180         EX( stq_u $31, 0($16) ) # .. .. .. L      
181         subq    $1, 1, $1       # .. .. E  ..     
182         subq    $0, 8, $0       # .. E  .. ..     
183         nop                     # E  .. .. ..     
184                                                   
185         nop                     # .. .. .. E      
186         nop                     # .. .. E  ..     
187         addq    $16, 8, $16     # .. E  .. ..     
188         bgt     $1, $onequad    # U  .. .. ..     
189                                                   
190         # We have an unknown number of bytes l    
191 $trailbytes:                                      
192         nop                     # .. .. .. E      
193         nop                     # .. .. E  ..     
194         nop                     # .. E  .. ..     
195         beq     $0, $zerolength # U  .. .. ..     
196                                                   
197         # $0 contains the number of bytes left    
198         # so we will use $0 as the loop counte    
199         # We know for a fact that $0 > 0 zero     
200 $onebyte:                                         
201         EX( stb $31, 0($16) )   # .. .. .. L      
202         subq    $0, 1, $0       # .. .. E  ..     
203         addq    $16, 1, $16     # .. E  .. ..     
204         bgt     $0, $onebyte    # U  .. .. ..     
205                                                   
206 $zerolength:                                      
207 $exception:                     # Destination     
208         nop                     # .. .. .. E      
209         nop                     # .. .. E  ..     
210         nop                     # .. E  .. ..     
211         ret     $31, ($26), 1   # L0 .. .. ..     
212         .end __clear_user                         
213         EXPORT_SYMBOL(__clear_user)               
                                                      

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