aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/sys-i386/bugs.c
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-05-06 17:50:58 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:13:00 -0400
commita5ed1ffa6c2480cdcf3f0aa945f0b8622fe4e90b (patch)
tree60bc11afebc2ede39683e3d08531856110872d5a /arch/um/sys-i386/bugs.c
parent11100b1dfb6e9444d54d38e822753f59ee42a7e6 (diff)
uml: formatting fixes
Formatting fixes - style violations whitespace breakage emacs formatting comment removal Signed-off-by: Jeff Dike <jdike@addtoit.com> Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/sys-i386/bugs.c')
-rw-r--r--arch/um/sys-i386/bugs.c54
1 files changed, 24 insertions, 30 deletions
diff --git a/arch/um/sys-i386/bugs.c b/arch/um/sys-i386/bugs.c
index e524a087679f..cae0af14903a 100644
--- a/arch/um/sys-i386/bugs.c
+++ b/arch/um/sys-i386/bugs.c
@@ -1,4 +1,4 @@
1/* 1/*
2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com) 2 * Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
3 * Licensed under the GPL 3 * Licensed under the GPL
4 */ 4 */
@@ -32,21 +32,21 @@ static char token(int fd, char *buf, int len, char stop)
32 n = os_read_file(fd, ptr, sizeof(*ptr)); 32 n = os_read_file(fd, ptr, sizeof(*ptr));
33 c = *ptr++; 33 c = *ptr++;
34 if(n != sizeof(*ptr)){ 34 if(n != sizeof(*ptr)){
35 if(n == 0) return(0); 35 if(n == 0)
36 return 0;
36 printk("Reading /proc/cpuinfo failed, err = %d\n", -n); 37 printk("Reading /proc/cpuinfo failed, err = %d\n", -n);
37 if(n < 0) 38 if(n < 0)
38 return(n); 39 return n;
39 else 40 else return -EIO;
40 return(-EIO);
41 } 41 }
42 } while((c != '\n') && (c != stop) && (ptr < end)); 42 } while((c != '\n') && (c != stop) && (ptr < end));
43 43
44 if(ptr == end){ 44 if(ptr == end){
45 printk("Failed to find '%c' in /proc/cpuinfo\n", stop); 45 printk("Failed to find '%c' in /proc/cpuinfo\n", stop);
46 return(-1); 46 return -1;
47 } 47 }
48 *(ptr - 1) = '\0'; 48 *(ptr - 1) = '\0';
49 return(c); 49 return c;
50} 50}
51 51
52static int find_cpuinfo_line(int fd, char *key, char *scratch, int len) 52static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
@@ -58,25 +58,25 @@ static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
58 while(1){ 58 while(1){
59 c = token(fd, scratch, len - 1, ':'); 59 c = token(fd, scratch, len - 1, ':');
60 if(c <= 0) 60 if(c <= 0)
61 return(0); 61 return 0;
62 else if(c != ':'){ 62 else if(c != ':'){
63 printk("Failed to find ':' in /proc/cpuinfo\n"); 63 printk("Failed to find ':' in /proc/cpuinfo\n");
64 return(0); 64 return 0;
65 } 65 }
66 66
67 if(!strncmp(scratch, key, strlen(key))) 67 if(!strncmp(scratch, key, strlen(key)))
68 return(1); 68 return 1;
69 69
70 do { 70 do {
71 n = os_read_file(fd, &c, sizeof(c)); 71 n = os_read_file(fd, &c, sizeof(c));
72 if(n != sizeof(c)){ 72 if(n != sizeof(c)){
73 printk("Failed to find newline in " 73 printk("Failed to find newline in "
74 "/proc/cpuinfo, err = %d\n", -n); 74 "/proc/cpuinfo, err = %d\n", -n);
75 return(0); 75 return 0;
76 } 76 }
77 } while(c != '\n'); 77 } while(c != '\n');
78 } 78 }
79 return(0); 79 return 0;
80} 80}
81 81
82static int check_cpu_flag(char *feature, int *have_it) 82static int check_cpu_flag(char *feature, int *have_it)
@@ -96,7 +96,8 @@ static int check_cpu_flag(char *feature, int *have_it)
96 goto out; 96 goto out;
97 97
98 c = token(fd, buf, len - 1, ' '); 98 c = token(fd, buf, len - 1, ' ');
99 if(c < 0) goto out; 99 if(c < 0)
100 goto out;
100 else if(c != ' '){ 101 else if(c != ' '){
101 printk("Failed to find ' ' in /proc/cpuinfo\n"); 102 printk("Failed to find ' ' in /proc/cpuinfo\n");
102 goto out; 103 goto out;
@@ -104,7 +105,8 @@ static int check_cpu_flag(char *feature, int *have_it)
104 105
105 while(1){ 106 while(1){
106 c = token(fd, buf, len - 1, ' '); 107 c = token(fd, buf, len - 1, ' ');
107 if(c < 0) goto out; 108 if(c < 0)
109 goto out;
108 else if(c == '\n') break; 110 else if(c == '\n') break;
109 111
110 if(!strcmp(buf, feature)){ 112 if(!strcmp(buf, feature)){
@@ -113,8 +115,10 @@ static int check_cpu_flag(char *feature, int *have_it)
113 } 115 }
114 } 116 }
115 out: 117 out:
116 if(*have_it == 0) printk("No\n"); 118 if(*have_it == 0)
117 else if(*have_it == 1) printk("Yes\n"); 119 printk("No\n");
120 else if(*have_it == 1)
121 printk("Yes\n");
118 os_close_file(fd); 122 os_close_file(fd);
119 return 1; 123 return 1;
120} 124}
@@ -166,12 +170,13 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs)
166 /* This is testing for a cmov (0x0f 0x4x) instruction causing a 170 /* This is testing for a cmov (0x0f 0x4x) instruction causing a
167 * SIGILL in init. 171 * SIGILL in init.
168 */ 172 */
169 if((sig != SIGILL) || (TASK_PID(get_current()) != 1)) return(0); 173 if((sig != SIGILL) || (TASK_PID(get_current()) != 1))
174 return 0;
170 175
171 if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2)) 176 if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2))
172 panic("SIGILL in init, could not read instructions!\n"); 177 panic("SIGILL in init, could not read instructions!\n");
173 if((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40)) 178 if((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40))
174 return(0); 179 return 0;
175 180
176 if(host_has_cmov == 0) 181 if(host_has_cmov == 0)
177 panic("SIGILL caused by cmov, which this processor doesn't " 182 panic("SIGILL caused by cmov, which this processor doesn't "
@@ -185,16 +190,5 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs)
185 "implements it, boot a filesystem compiled for older " 190 "implements it, boot a filesystem compiled for older "
186 "processors"); 191 "processors");
187 else panic("Bad value for host_has_cmov (%d)", host_has_cmov); 192 else panic("Bad value for host_has_cmov (%d)", host_has_cmov);
188 return(0); 193 return 0;
189} 194}
190
191/*
192 * Overrides for Emacs so that we follow Linus's tabbing style.
193 * Emacs will notice this stuff at the end of the file and automatically
194 * adjust the settings for this buffer only. This must remain at the end
195 * of the file.
196 * ---------------------------------------------------------------------------
197 * Local variables:
198 * c-file-style: "linux"
199 * End:
200 */