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

TOMOYO Linux Cross Reference
Linux/arch/sparc/kernel/termios.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/sparc/kernel/termios.c (Version linux-6.12-rc7) and /arch/m68k/kernel/termios.c (Version linux-6.3.13)


  1 // SPDX-License-Identifier: GPL-2.0                 1 
  2 #include <linux/termios_internal.h>               
  3                                                   
  4 /*                                                
  5  * c_cc characters in the termio structure.  O    
  6  * backwardly compatible.  Notice that charact    
  7  * interpreted differently depending on whethe    
  8  * c_lflag.  If it's set, they are used as _VE    
  9  * as _VMIN and V_TIME.  This is for compatibi    
 10  * is compatible with sysV)...                    
 11  */                                               
 12 #define _VMIN   4                                 
 13 #define _VTIME  5                                 
 14                                                   
 15 int kernel_termios_to_user_termio(struct termi    
 16                                                   
 17 {                                                 
 18         struct termio v;                          
 19         memset(&v, 0, sizeof(struct termio));     
 20         v.c_iflag = termios->c_iflag;             
 21         v.c_oflag = termios->c_oflag;             
 22         v.c_cflag = termios->c_cflag;             
 23         v.c_lflag = termios->c_lflag;             
 24         v.c_line = termios->c_line;               
 25         memcpy(v.c_cc, termios->c_cc, NCC);       
 26         if (!(v.c_lflag & ICANON)) {              
 27                 v.c_cc[_VMIN] = termios->c_cc[    
 28                 v.c_cc[_VTIME] = termios->c_cc    
 29         }                                         
 30         return copy_to_user(termio, &v, sizeof    
 31 }                                                 
 32                                                   
 33 int user_termios_to_kernel_termios(struct kter    
 34                                                   
 35 {                                                 
 36         int err;                                  
 37         err  = get_user(k->c_iflag, &u->c_ifla    
 38         err |= get_user(k->c_oflag, &u->c_ofla    
 39         err |= get_user(k->c_cflag, &u->c_cfla    
 40         err |= get_user(k->c_lflag, &u->c_lfla    
 41         err |= get_user(k->c_line,  &u->c_line    
 42         err |= copy_from_user(k->c_cc, u->c_cc    
 43         if (k->c_lflag & ICANON) {                
 44                 err |= get_user(k->c_cc[VEOF],    
 45                 err |= get_user(k->c_cc[VEOL],    
 46         } else {                                  
 47                 err |= get_user(k->c_cc[VMIN],    
 48                 err |= get_user(k->c_cc[VTIME]    
 49         }                                         
 50         err |= get_user(k->c_ispeed,  &u->c_is    
 51         err |= get_user(k->c_ospeed,  &u->c_os    
 52         return err;                               
 53 }                                                 
 54                                                   
 55 int kernel_termios_to_user_termios(struct term    
 56                                                   
 57 {                                                 
 58         int err;                                  
 59         err  = put_user(k->c_iflag, &u->c_ifla    
 60         err |= put_user(k->c_oflag, &u->c_ofla    
 61         err |= put_user(k->c_cflag, &u->c_cfla    
 62         err |= put_user(k->c_lflag, &u->c_lfla    
 63         err |= put_user(k->c_line, &u->c_line)    
 64         err |= copy_to_user(u->c_cc, k->c_cc,     
 65         if (!(k->c_lflag & ICANON)) {             
 66                 err |= put_user(k->c_cc[VMIN],    
 67                 err |= put_user(k->c_cc[VTIME]    
 68         } else {                                  
 69                 err |= put_user(k->c_cc[VEOF],    
 70                 err |= put_user(k->c_cc[VEOL],    
 71         }                                         
 72         err |= put_user(k->c_ispeed, &u->c_isp    
 73         err |= put_user(k->c_ospeed, &u->c_osp    
 74         return err;                               
 75 }                                                 
 76                                                   
 77 int user_termios_to_kernel_termios_1(struct kt    
 78                                                   
 79 {                                                 
 80         int err;                                  
 81         err  = get_user(k->c_iflag, &u->c_ifla    
 82         err |= get_user(k->c_oflag, &u->c_ofla    
 83         err |= get_user(k->c_cflag, &u->c_cfla    
 84         err |= get_user(k->c_lflag, &u->c_lfla    
 85         err |= get_user(k->c_line,  &u->c_line    
 86         err |= copy_from_user(k->c_cc, u->c_cc    
 87         if (k->c_lflag & ICANON) {                
 88                 err |= get_user(k->c_cc[VEOF],    
 89                 err |= get_user(k->c_cc[VEOL],    
 90         } else {                                  
 91                 err |= get_user(k->c_cc[VMIN],    
 92                 err |= get_user(k->c_cc[VTIME]    
 93         }                                         
 94         return err;                               
 95 }                                                 
 96                                                   
 97 int kernel_termios_to_user_termios_1(struct te    
 98                                                   
 99 {                                                 
100         int err;                                  
101         err  = put_user(k->c_iflag, &u->c_ifla    
102         err |= put_user(k->c_oflag, &u->c_ofla    
103         err |= put_user(k->c_cflag, &u->c_cfla    
104         err |= put_user(k->c_lflag, &u->c_lfla    
105         err |= put_user(k->c_line, &u->c_line)    
106         err |= copy_to_user(u->c_cc, k->c_cc,     
107         if (!(k->c_lflag & ICANON)) {             
108                 err |= put_user(k->c_cc[VMIN],    
109                 err |= put_user(k->c_cc[VTIME]    
110         } else {                                  
111                 err |= put_user(k->c_cc[VEOF],    
112                 err |= put_user(k->c_cc[VEOL],    
113         }                                         
114         return err;                               
115 }                                                 
116                                                   

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