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:
[x86 setup] Make sure AH=00h when setting a video mode
[x86 setup] Volatilize asm() statements

+33 -31
+12 -12
arch/i386/boot/boot.h
··· 87 static inline u16 fs(void) 88 { 89 u16 seg; 90 - asm("movw %%fs,%0" : "=rm" (seg)); 91 return seg; 92 } 93 ··· 98 static inline u16 gs(void) 99 { 100 u16 seg; 101 - asm("movw %%gs,%0" : "=rm" (seg)); 102 return seg; 103 } 104 ··· 107 static inline u8 rdfs8(addr_t addr) 108 { 109 u8 v; 110 - asm("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); 111 return v; 112 } 113 static inline u16 rdfs16(addr_t addr) 114 { 115 u16 v; 116 - asm("movw %%fs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); 117 return v; 118 } 119 static inline u32 rdfs32(addr_t addr) 120 { 121 u32 v; 122 - asm("movl %%fs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); 123 return v; 124 } 125 ··· 139 static inline u8 rdgs8(addr_t addr) 140 { 141 u8 v; 142 - asm("movb %%gs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); 143 return v; 144 } 145 static inline u16 rdgs16(addr_t addr) 146 { 147 u16 v; 148 - asm("movw %%gs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); 149 return v; 150 } 151 static inline u32 rdgs32(addr_t addr) 152 { 153 u32 v; 154 - asm("movl %%gs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); 155 return v; 156 } 157 ··· 180 static inline int memcmp_fs(const void *s1, addr_t s2, size_t len) 181 { 182 u8 diff; 183 - asm("fs; repe; cmpsb; setnz %0" 184 - : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); 185 return diff; 186 } 187 static inline int memcmp_gs(const void *s1, addr_t s2, size_t len) 188 { 189 u8 diff; 190 - asm("gs; repe; cmpsb; setnz %0" 191 - : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); 192 return diff; 193 } 194
··· 87 static inline u16 fs(void) 88 { 89 u16 seg; 90 + asm volatile("movw %%fs,%0" : "=rm" (seg)); 91 return seg; 92 } 93 ··· 98 static inline u16 gs(void) 99 { 100 u16 seg; 101 + asm volatile("movw %%gs,%0" : "=rm" (seg)); 102 return seg; 103 } 104 ··· 107 static inline u8 rdfs8(addr_t addr) 108 { 109 u8 v; 110 + asm volatile("movb %%fs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); 111 return v; 112 } 113 static inline u16 rdfs16(addr_t addr) 114 { 115 u16 v; 116 + asm volatile("movw %%fs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); 117 return v; 118 } 119 static inline u32 rdfs32(addr_t addr) 120 { 121 u32 v; 122 + asm volatile("movl %%fs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); 123 return v; 124 } 125 ··· 139 static inline u8 rdgs8(addr_t addr) 140 { 141 u8 v; 142 + asm volatile("movb %%gs:%1,%0" : "=r" (v) : "m" (*(u8 *)addr)); 143 return v; 144 } 145 static inline u16 rdgs16(addr_t addr) 146 { 147 u16 v; 148 + asm volatile("movw %%gs:%1,%0" : "=r" (v) : "m" (*(u16 *)addr)); 149 return v; 150 } 151 static inline u32 rdgs32(addr_t addr) 152 { 153 u32 v; 154 + asm volatile("movl %%gs:%1,%0" : "=r" (v) : "m" (*(u32 *)addr)); 155 return v; 156 } 157 ··· 180 static inline int memcmp_fs(const void *s1, addr_t s2, size_t len) 181 { 182 u8 diff; 183 + asm volatile("fs; repe; cmpsb; setnz %0" 184 + : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); 185 return diff; 186 } 187 static inline int memcmp_gs(const void *s1, addr_t s2, size_t len) 188 { 189 u8 diff; 190 + asm volatile("gs; repe; cmpsb; setnz %0" 191 + : "=qm" (diff), "+D" (s1), "+S" (s2), "+c" (len)); 192 return diff; 193 } 194
+2 -1
arch/i386/boot/cpucheck.c
··· 96 asm volatile("movl %0,%%cr0" : : "r" (cr0)); 97 } 98 99 - asm("fninit ; fnstsw %0 ; fnstcw %1" : "+m" (fsw), "+m" (fcw)); 100 101 return fsw == 0 && (fcw & 0x103f) == 0x003f; 102 }
··· 96 asm volatile("movl %0,%%cr0" : : "r" (cr0)); 97 } 98 99 + asm volatile("fninit ; fnstsw %0 ; fnstcw %1" 100 + : "+m" (fsw), "+m" (fcw)); 101 102 return fsw == 0 && (fcw & 0x103f) == 0x003f; 103 }
+3 -3
arch/i386/boot/edd.c
··· 30 cx = 0x0001; /* Sector 0-0-1 */ 31 dx = devno; 32 bx = (size_t)buf; 33 - asm("pushfl; stc; int $0x13; setc %%al; popfl" 34 - : "+a" (ax), "+c" (cx), "+d" (dx), "+b" (bx) 35 - : : "esi", "edi", "memory"); 36 37 return -(u8)ax; /* 0 or -1 */ 38 }
··· 30 cx = 0x0001; /* Sector 0-0-1 */ 31 dx = devno; 32 bx = (size_t)buf; 33 + asm volatile("pushfl; stc; int $0x13; setc %%al; popfl" 34 + : "+a" (ax), "+c" (cx), "+d" (dx), "+b" (bx) 35 + : : "esi", "edi", "memory"); 36 37 return -(u8)ax; /* 0 or -1 */ 38 }
+7 -7
arch/i386/boot/tty.c
··· 54 u16 ax = 0x0200; 55 u16 cx, dx; 56 57 - asm("int $0x1a" 58 - : "+a" (ax), "=c" (cx), "=d" (dx) 59 - : : "ebx", "esi", "edi"); 60 61 return dx >> 8; 62 } ··· 67 int getchar(void) 68 { 69 u16 ax = 0; 70 - asm("int $0x16" : "+a" (ax)); 71 72 return ax & 0xff; 73 } ··· 75 static int kbd_pending(void) 76 { 77 u8 pending; 78 - asm("int $0x16; setnz %0" 79 - : "=rm" (pending) 80 - : "a" (0x0100)); 81 return pending; 82 } 83
··· 54 u16 ax = 0x0200; 55 u16 cx, dx; 56 57 + asm volatile("int $0x1a" 58 + : "+a" (ax), "=c" (cx), "=d" (dx) 59 + : : "ebx", "esi", "edi"); 60 61 return dx >> 8; 62 } ··· 67 int getchar(void) 68 { 69 u16 ax = 0; 70 + asm volatile("int $0x16" : "+a" (ax)); 71 72 return ax & 0xff; 73 } ··· 75 static int kbd_pending(void) 76 { 77 u8 pending; 78 + asm volatile("int $0x16; setnz %0" 79 + : "=rm" (pending) 80 + : "a" (0x0100)); 81 return pending; 82 } 83
+9 -8
arch/i386/boot/video-vga.c
··· 47 48 #ifdef CONFIG_VIDEO_400_HACK 49 if (adapter >= ADAPTER_VGA) { 50 - asm(INT10 51 - : : "a" (0x1202), "b" (0x0030) 52 - : "ecx", "edx", "esi", "edi"); 53 } 54 #endif 55 56 ax = 0x0f00; 57 - asm(INT10 58 - : "+a" (ax) 59 - : : "ebx", "ecx", "edx", "esi", "edi"); 60 61 mode = (u8)ax; 62 ··· 73 mode = 3; 74 75 /* Set the mode */ 76 asm volatile(INT10 77 - : : "a" (mode) 78 - : "ebx", "ecx", "edx", "esi", "edi"); 79 do_restore = 1; 80 return mode; 81 }
··· 47 48 #ifdef CONFIG_VIDEO_400_HACK 49 if (adapter >= ADAPTER_VGA) { 50 + asm volatile(INT10 51 + : : "a" (0x1202), "b" (0x0030) 52 + : "ecx", "edx", "esi", "edi"); 53 } 54 #endif 55 56 ax = 0x0f00; 57 + asm volatile(INT10 58 + : "+a" (ax) 59 + : : "ebx", "ecx", "edx", "esi", "edi"); 60 61 mode = (u8)ax; 62 ··· 73 mode = 3; 74 75 /* Set the mode */ 76 + ax = mode; 77 asm volatile(INT10 78 + : "+a" (ax) 79 + : : "ebx", "ecx", "edx", "esi", "edi"); 80 do_restore = 1; 81 return mode; 82 }