aboutsummaryrefslogtreecommitdiffstats
path: root/arch/i386
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-10-03 01:33:17 -0400
committerPaul Mackerras <paulus@samba.org>2007-10-03 01:33:17 -0400
commit70f227d8846a8a9b1f36f71c42e11cc7c6e9408d (patch)
treefb4dd5c8240bdaada819fb569c01a392b52847b9 /arch/i386
parenta0c7ce9c877ceef8428798ac91fb794f83609aed (diff)
parentf778089cb2445dfc6dfd30a7a567925fd8589f1e (diff)
Merge branch 'linux-2.6' into for-2.6.24
Diffstat (limited to 'arch/i386')
-rw-r--r--arch/i386/boot/header.S2
-rw-r--r--arch/i386/boot/memory.c39
-rw-r--r--arch/i386/boot/video.c14
-rw-r--r--arch/i386/kernel/acpi/wakeup.S41
-rw-r--r--arch/i386/xen/mmu.c5
5 files changed, 54 insertions, 47 deletions
diff --git a/arch/i386/boot/header.S b/arch/i386/boot/header.S
index 7f4a2c53bd76..f3140e596d40 100644
--- a/arch/i386/boot/header.S
+++ b/arch/i386/boot/header.S
@@ -275,7 +275,7 @@ die:
275 hlt 275 hlt
276 jmp die 276 jmp die
277 277
278 .size die, .-due 278 .size die, .-die
279 279
280 .section ".initdata", "a" 280 .section ".initdata", "a"
281setup_corrupt: 281setup_corrupt:
diff --git a/arch/i386/boot/memory.c b/arch/i386/boot/memory.c
index 1a2e62db8bed..378353956b5d 100644
--- a/arch/i386/boot/memory.c
+++ b/arch/i386/boot/memory.c
@@ -20,6 +20,7 @@
20 20
21static int detect_memory_e820(void) 21static int detect_memory_e820(void)
22{ 22{
23 int count = 0;
23 u32 next = 0; 24 u32 next = 0;
24 u32 size, id; 25 u32 size, id;
25 u8 err; 26 u8 err;
@@ -27,20 +28,33 @@ static int detect_memory_e820(void)
27 28
28 do { 29 do {
29 size = sizeof(struct e820entry); 30 size = sizeof(struct e820entry);
30 id = SMAP; 31
32 /* Important: %edx is clobbered by some BIOSes,
33 so it must be either used for the error output
34 or explicitly marked clobbered. */
31 asm("int $0x15; setc %0" 35 asm("int $0x15; setc %0"
32 : "=am" (err), "+b" (next), "+d" (id), "+c" (size), 36 : "=d" (err), "+b" (next), "=a" (id), "+c" (size),
33 "=m" (*desc) 37 "=m" (*desc)
34 : "D" (desc), "a" (0xe820)); 38 : "D" (desc), "d" (SMAP), "a" (0xe820));
39
40 /* Some BIOSes stop returning SMAP in the middle of
41 the search loop. We don't know exactly how the BIOS
42 screwed up the map at that point, we might have a
43 partial map, the full map, or complete garbage, so
44 just return failure. */
45 if (id != SMAP) {
46 count = 0;
47 break;
48 }
35 49
36 if (err || id != SMAP) 50 if (err)
37 break; 51 break;
38 52
39 boot_params.e820_entries++; 53 count++;
40 desc++; 54 desc++;
41 } while (next && boot_params.e820_entries < E820MAX); 55 } while (next && count < E820MAX);
42 56
43 return boot_params.e820_entries; 57 return boot_params.e820_entries = count;
44} 58}
45 59
46static int detect_memory_e801(void) 60static int detect_memory_e801(void)
@@ -89,11 +103,16 @@ static int detect_memory_88(void)
89 103
90int detect_memory(void) 104int detect_memory(void)
91{ 105{
106 int err = -1;
107
92 if (detect_memory_e820() > 0) 108 if (detect_memory_e820() > 0)
93 return 0; 109 err = 0;
94 110
95 if (!detect_memory_e801()) 111 if (!detect_memory_e801())
96 return 0; 112 err = 0;
113
114 if (!detect_memory_88())
115 err = 0;
97 116
98 return detect_memory_88(); 117 return err;
99} 118}
diff --git a/arch/i386/boot/video.c b/arch/i386/boot/video.c
index 693f20d3102e..e4ba897bf9a3 100644
--- a/arch/i386/boot/video.c
+++ b/arch/i386/boot/video.c
@@ -147,7 +147,7 @@ int mode_defined(u16 mode)
147} 147}
148 148
149/* Set mode (without recalc) */ 149/* Set mode (without recalc) */
150static int raw_set_mode(u16 mode) 150static int raw_set_mode(u16 mode, u16 *real_mode)
151{ 151{
152 int nmode, i; 152 int nmode, i;
153 struct card_info *card; 153 struct card_info *card;
@@ -165,8 +165,10 @@ static int raw_set_mode(u16 mode)
165 165
166 if ((mode == nmode && visible) || 166 if ((mode == nmode && visible) ||
167 mode == mi->mode || 167 mode == mi->mode ||
168 mode == (mi->y << 8)+mi->x) 168 mode == (mi->y << 8)+mi->x) {
169 *real_mode = mi->mode;
169 return card->set_mode(mi); 170 return card->set_mode(mi);
171 }
170 172
171 if (visible) 173 if (visible)
172 nmode++; 174 nmode++;
@@ -178,7 +180,7 @@ static int raw_set_mode(u16 mode)
178 if (mode >= card->xmode_first && 180 if (mode >= card->xmode_first &&
179 mode < card->xmode_first+card->xmode_n) { 181 mode < card->xmode_first+card->xmode_n) {
180 struct mode_info mix; 182 struct mode_info mix;
181 mix.mode = mode; 183 *real_mode = mix.mode = mode;
182 mix.x = mix.y = 0; 184 mix.x = mix.y = 0;
183 return card->set_mode(&mix); 185 return card->set_mode(&mix);
184 } 186 }
@@ -223,6 +225,7 @@ static void vga_recalc_vertical(void)
223static int set_mode(u16 mode) 225static int set_mode(u16 mode)
224{ 226{
225 int rv; 227 int rv;
228 u16 real_mode;
226 229
227 /* Very special mode numbers... */ 230 /* Very special mode numbers... */
228 if (mode == VIDEO_CURRENT_MODE) 231 if (mode == VIDEO_CURRENT_MODE)
@@ -232,13 +235,16 @@ static int set_mode(u16 mode)
232 else if (mode == EXTENDED_VGA) 235 else if (mode == EXTENDED_VGA)
233 mode = VIDEO_8POINT; 236 mode = VIDEO_8POINT;
234 237
235 rv = raw_set_mode(mode); 238 rv = raw_set_mode(mode, &real_mode);
236 if (rv) 239 if (rv)
237 return rv; 240 return rv;
238 241
239 if (mode & VIDEO_RECALC) 242 if (mode & VIDEO_RECALC)
240 vga_recalc_vertical(); 243 vga_recalc_vertical();
241 244
245 /* Save the canonical mode number for the kernel, not
246 an alias, size specification or menu position */
247 boot_params.hdr.vid_mode = real_mode;
242 return 0; 248 return 0;
243} 249}
244 250
diff --git a/arch/i386/kernel/acpi/wakeup.S b/arch/i386/kernel/acpi/wakeup.S
index ed0a0f2c1597..f22ba8534d26 100644
--- a/arch/i386/kernel/acpi/wakeup.S
+++ b/arch/i386/kernel/acpi/wakeup.S
@@ -151,51 +151,30 @@ bogus_real_magic:
151#define VIDEO_FIRST_V7 0x0900 151#define VIDEO_FIRST_V7 0x0900
152 152
153# Setting of user mode (AX=mode ID) => CF=success 153# Setting of user mode (AX=mode ID) => CF=success
154
155# For now, we only handle VESA modes (0x0200..0x03ff). To handle other
156# modes, we should probably compile in the video code from the boot
157# directory.
154mode_set: 158mode_set:
155 movw %ax, %bx 159 movw %ax, %bx
156#if 0 160 subb $VIDEO_FIRST_VESA>>8, %bh
157 cmpb $0xff, %ah 161 cmpb $2, %bh
158 jz setalias 162 jb check_vesa
159
160 testb $VIDEO_RECALC>>8, %ah
161 jnz _setrec
162
163 cmpb $VIDEO_FIRST_RESOLUTION>>8, %ah
164 jnc setres
165
166 cmpb $VIDEO_FIRST_SPECIAL>>8, %ah
167 jz setspc
168
169 cmpb $VIDEO_FIRST_V7>>8, %ah
170 jz setv7
171#endif
172
173 cmpb $VIDEO_FIRST_VESA>>8, %ah
174 jnc check_vesa
175#if 0
176 orb %ah, %ah
177 jz setmenu
178#endif
179
180 decb %ah
181# jz setbios Add bios modes later
182 163
183setbad: clc 164setbad:
165 clc
184 ret 166 ret
185 167
186check_vesa: 168check_vesa:
187 subb $VIDEO_FIRST_VESA>>8, %bh
188 orw $0x4000, %bx # Use linear frame buffer 169 orw $0x4000, %bx # Use linear frame buffer
189 movw $0x4f02, %ax # VESA BIOS mode set call 170 movw $0x4f02, %ax # VESA BIOS mode set call
190 int $0x10 171 int $0x10
191 cmpw $0x004f, %ax # AL=4f if implemented 172 cmpw $0x004f, %ax # AL=4f if implemented
192 jnz _setbad # AH=0 if OK 173 jnz setbad # AH=0 if OK
193 174
194 stc 175 stc
195 ret 176 ret
196 177
197_setbad: jmp setbad
198
199 .code32 178 .code32
200 ALIGN 179 ALIGN
201 180
diff --git a/arch/i386/xen/mmu.c b/arch/i386/xen/mmu.c
index 4ae038aa6c24..874db0cd1d2a 100644
--- a/arch/i386/xen/mmu.c
+++ b/arch/i386/xen/mmu.c
@@ -559,6 +559,9 @@ void xen_exit_mmap(struct mm_struct *mm)
559 put_cpu(); 559 put_cpu();
560 560
561 spin_lock(&mm->page_table_lock); 561 spin_lock(&mm->page_table_lock);
562 xen_pgd_unpin(mm->pgd); 562
563 /* pgd may not be pinned in the error exit path of execve */
564 if (PagePinned(virt_to_page(mm->pgd)))
565 xen_pgd_unpin(mm->pgd);
563 spin_unlock(&mm->page_table_lock); 566 spin_unlock(&mm->page_table_lock);
564} 567}