Skip to content

Commit 97405fe

Browse files
author
Linus Torvalds
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup: [PATCH] x86: do not recompile boot for each build [x86 setup] Save/restore DS around invocations of INT 10h [x86 setup] VGA: Clear the Protect bit before setting the vertical height [x86 setup] Fix assembly constraints [x86 setup] build/tools.c: fix comment [x86 setup] MAINTAINERS: document x86 setup code git tree
2 parents a10d9a7 + 3fbc541 commit 97405fe

File tree

11 files changed

+25
-12
lines changed

11 files changed

+25
-12
lines changed

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1740,6 +1740,7 @@ S: Maintained
17401740
i386 SETUP CODE / CPU ERRATA WORKAROUNDS
17411741
P: H. Peter Anvin
17421742
1743+
T: git.kernel.org:/pub/scm/linux/kernel/git/hpa/linux-2.6-x86setup.git
17431744
S: Maintained
17441745

17451746
IA64 (Itanium) PLATFORM

arch/i386/boot/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ setup-y += printf.o string.o tty.o video.o version.o voyager.o
3939
setup-y += video-vga.o
4040
setup-y += video-vesa.o
4141
setup-y += video-bios.o
42-
42+
targets += $(setup-y)
4343
hostprogs-y := tools/build
4444

4545
HOSTCFLAGS_build.o := $(LINUXINCLUDE)

arch/i386/boot/boot.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ static inline u16 inw(u16 port)
5656

5757
static inline void outl(u32 v, u16 port)
5858
{
59-
asm volatile("outl %0,%1" : : "a" (v), "dn" (port));
59+
asm volatile("outl %0,%1" : : "a" (v), "dN" (port));
6060
}
6161
static inline u32 inl(u32 port)
6262
{

arch/i386/boot/cpucheck.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ static int has_eflag(u32 mask)
115115
"pushfl ; "
116116
"popl %1 ; "
117117
"popfl"
118-
: "=r" (f0), "=r" (f1)
119-
: "g" (mask));
118+
: "=&r" (f0), "=&r" (f1)
119+
: "ri" (mask));
120120

121121
return !!((f0^f1) & mask);
122122
}

arch/i386/boot/mca.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ int query_mca(void)
2626
"setc %0 ; "
2727
"movw %%es, %1 ; "
2828
"popw %%es"
29-
: "=acdSDm" (err), "=acdSDm" (es), "=b" (bx)
29+
: "=acd" (err), "=acdSD" (es), "=b" (bx)
3030
: "a" (0xc000));
3131

3232
if (err)

arch/i386/boot/pm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void move_kernel_around(void)
6565
"popw %%ds ; "
6666
"popw %%es"
6767
: "+c" (dwords)
68-
: "rm" (dst_seg), "rm" (src_seg)
68+
: "r" (dst_seg), "r" (src_seg)
6969
: "esi", "edi");
7070

7171
syssize -= paras;

arch/i386/boot/tools/build.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
*/
66

77
/*
8-
* This file builds a disk-image from three different files:
8+
* This file builds a disk-image from two different files:
99
*
1010
* - setup: 8086 machine code, sets up system parm
1111
* - system: 80386 code for actual system

arch/i386/boot/tty.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void __attribute__((section(".inittext"))) putchar(int ch)
3131

3232
/* int $0x10 is known to have bugs involving touching registers
3333
it shouldn't. Be extra conservative... */
34-
asm volatile("pushal; int $0x10; popal"
34+
asm volatile("pushal; pushw %%ds; int $0x10; popw %%ds; popal"
3535
: : "b" (0x0007), "c" (0x0001), "a" (0x0e00|ch));
3636
}
3737

arch/i386/boot/video.c

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ static void vga_recalc_vertical(void)
195195
{
196196
unsigned int font_size, rows;
197197
u16 crtc;
198-
u8 ov;
198+
u8 pt, ov;
199199

200200
set_fs(0);
201201
font_size = rdfs8(0x485); /* BIOS: font size (pixels) */
@@ -206,7 +206,12 @@ static void vga_recalc_vertical(void)
206206

207207
crtc = vga_crtc();
208208

209+
pt = in_idx(crtc, 0x11);
210+
pt &= ~0x80; /* Unlock CR0-7 */
211+
out_idx(pt, crtc, 0x11);
212+
209213
out_idx((u8)rows, crtc, 0x12); /* Lower height register */
214+
210215
ov = in_idx(crtc, 0x07); /* Overflow register */
211216
ov &= 0xbd;
212217
ov |= (rows >> (8-1)) & 0x02;
@@ -411,7 +416,7 @@ static void restore_screen(void)
411416
"1: rep;stosl ; "
412417
"popw %%es"
413418
: "+D" (dst), "+c" (npad)
414-
: "bdSm" (video_segment),
419+
: "bdS" (video_segment),
415420
"a" (0x07200720));
416421
}
417422

arch/i386/boot/video.h

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,15 @@ extern int graphic_mode; /* Graphics mode with linear frame buffer */
117117
* int $0x10 is notorious for touching registers it shouldn't.
118118
* gcc doesn't like %ebp being clobbered, so define it as a push/pop
119119
* sequence here.
120+
*
121+
* A number of systems, including the original PC can clobber %bp in
122+
* certain circumstances, like when scrolling. There exists at least
123+
* one Trident video card which could clobber DS under a set of
124+
* circumstances that we are unlikely to encounter (scrolling when
125+
* using an extended graphics mode of more than 800x600 pixels), but
126+
* it's cheap insurance to deal with that here.
120127
*/
121-
#define INT10 "pushl %%ebp; int $0x10; popl %%ebp"
128+
#define INT10 "pushl %%ebp; pushw %%ds; int $0x10; popw %%ds; popl %%ebp"
122129

123130
/* Accessing VGA indexed registers */
124131
static inline u8 in_idx(u16 port, u8 index)

arch/i386/boot/voyager.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ int query_voyager(void)
3232
"setc %0 ; "
3333
"movw %%es, %1 ; "
3434
"popw %%es"
35-
: "=qm" (err), "=rm" (es), "=D" (di)
35+
: "=q" (err), "=r" (es), "=D" (di)
3636
: "a" (0xffc0));
3737

3838
if (err)

0 commit comments

Comments
 (0)