1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
|
diff -ur --exclude '*.orig' grub-0.96-orig/grub/asmstub.c grub-0.96/grub/asmstub.c
--- grub-0.96-orig/grub/asmstub.c 2005-04-05 20:25:52.000000000 -0400
+++ grub-0.96/grub/asmstub.c 2005-04-05 20:26:05.000000000 -0400
@@ -91,7 +91,7 @@
static jmp_buf env_for_exit;
/* The current color for console. */
-static int console_current_color = A_NORMAL;
+int console_current_color = A_NORMAL;
/* The file descriptor for a serial device. */
static int serial_fd = -1;
@@ -162,31 +162,33 @@
size_t simstack_size, page_size;
int i;
+ auto void doit (void);
+
/* We need a nested function so that we get a clean stack frame,
regardless of how the code is optimized. */
- static volatile void doit ()
- {
- /* Make sure our stack lives in the simulated memory area. */
- asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
- : "=&r" (realstack) : "r" (simstack));
-
- /* Do a setjmp here for the stop command. */
- if (! setjmp (env_for_exit))
- {
- /* Actually enter the generic stage2 code. */
- status = 0;
- init_bios_info ();
- }
- else
- {
- /* If ERRNUM is non-zero, then set STATUS to non-zero. */
- if (errnum)
- status = 1;
- }
-
- /* Replace our stack before we use any local variables. */
- asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
- }
+ auto void doit (void)
+ {
+ /* Make sure our stack lives in the simulated memory area. */
+ asm volatile ("movl %%esp, %0\n\tmovl %1, %%esp\n"
+ : "=&r" (realstack) : "r" (simstack));
+
+ /* Do a setjmp here for the stop command. */
+ if (! setjmp (env_for_exit))
+ {
+ /* Actually enter the generic stage2 code. */
+ status = 0;
+ init_bios_info ();
+ }
+ else
+ {
+ /* If ERRNUM is non-zero, then set STATUS to non-zero. */
+ if (errnum)
+ status = 1;
+ }
+
+ /* Replace our stack before we use any local variables. */
+ asm volatile ("movl %0, %%esp\n" : : "r" (realstack));
+ }
assert (grub_scratch_mem == 0);
diff -ur --exclude '*.orig' grub-0.96-orig/lib/device.c grub-0.96/lib/device.c
--- grub-0.96-orig/lib/device.c 2005-04-05 20:25:52.000000000 -0400
+++ grub-0.96/lib/device.c 2005-04-05 20:26:05.000000000 -0400
@@ -499,12 +499,15 @@
static int
read_device_map (FILE *fp, char **map, const char *map_file)
{
- static void show_error (int no, const char *msg)
+ auto void show_error (int no, const char *msg);
+ auto void show_warning (int no, const char *msg, ...);
+
+ auto void show_error (int no, const char *msg)
{
fprintf (stderr, "%s:%d: error: %s\n", map_file, no, msg);
}
- static void show_warning (int no, const char *msg, ...)
+ auto void show_warning (int no, const char *msg, ...)
{
va_list ap;
diff -ur --exclude '*.orig' grub-0.96-orig/stage2/builtins.c grub-0.96/stage2/builtins.c
--- grub-0.96-orig/stage2/builtins.c 2005-04-05 20:25:52.000000000 -0400
+++ grub-0.96/stage2/builtins.c 2005-04-05 20:26:05.000000000 -0400
@@ -626,8 +626,10 @@
"white"
};
+ auto int color_number (char *str);
+
/* Convert the color name STR into the magical number. */
- static int color_number (char *str)
+ auto int color_number (char *str)
{
char *ptr;
int i;
@@ -3804,7 +3806,10 @@
int to_code, from_code;
int map_in_interrupt = 0;
- static int find_key_code (char *key)
+ auto int find_key_code (char *key);
+ auto int find_ascii_code (char *key);
+
+ auto int find_key_code (char *key)
{
int i;
@@ -3821,7 +3826,7 @@
return 0;
}
- static int find_ascii_code (char *key)
+ auto int find_ascii_code (char *key)
{
int i;
diff -ur --exclude '*.orig' grub-0.96-orig/stage2/char_io.c grub-0.96/stage2/char_io.c
--- grub-0.96-orig/stage2/char_io.c 2005-04-05 20:25:52.000000000 -0400
+++ grub-0.96/stage2/char_io.c 2005-04-05 20:26:49.000000000 -0400
@@ -1226,7 +1226,9 @@
return ! errnum;
# endif
# else /* __PIC__ */
- static int start_addr (void)
+ auto int start_addr(void);
+
+ auto int start_addr (void)
{
int ret;
# if defined(HAVE_START_SYMBOL)
@@ -1239,7 +1241,9 @@
return ret;
}
- static int end_addr (void)
+ auto int end_addr(void);
+
+ auto int end_addr (void)
{
int ret;
# if defined(HAVE_END_SYMBOL)
diff -ur --exclude '*.orig' grub-0.96-orig/stage2/smp-imps.h grub-0.96/stage2/smp-imps.h
--- grub-0.96-orig/stage2/smp-imps.h 2005-04-05 20:25:52.000000000 -0400
+++ grub-0.96/stage2/smp-imps.h 2005-04-05 20:26:05.000000000 -0400
@@ -183,36 +183,6 @@
*/
/*
- * "imps_any_new_apics" is non-zero if any of the APICS (local or I/O)
- * are *not* an 82489DX. This is useful to determine if more than 15
- * CPUs can be supported (true if zero).
- */
-extern int imps_any_new_apics;
-
-/*
- * "imps_enabled" is non-zero if the probe sequence found IMPS
- * information and was successful.
- */
-extern int imps_enabled;
-
-/*
- * This contains the local APIC hardware address.
- */
-extern unsigned imps_lapic_addr;
-
-/*
- * This represents the number of CPUs found.
- */
-extern int imps_num_cpus;
-
-/*
- * These map from virtual cpu numbers to APIC id's and back.
- */
-extern unsigned char imps_cpu_apic_map[IMPS_MAX_CPUS];
-extern unsigned char imps_apic_cpu_map[IMPS_MAX_CPUS];
-
-
-/*
* This is the primary function for probing for Intel MPS 1.1/1.4
* compatible hardware and BIOS information. While probing the CPUs
* information returned from the BIOS, this also starts up each CPU
|