Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

x86, boot: Use .code16 instead of .code16gcc

This reverts commit 28b48688 ("x86, boot: use .code16gcc instead
of .code16").

Versions of binutils older than 2.16 are already not working, so this
workaround is no longer necessary either. At the same time, some of
the transformations that .code16gcc does can be *extremely*
counterintuitive to a human programmer.

[ hpa: folded ret -> retl and call -> calll fixes from followup patch ]

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1388788242.2391.75.camel@shinybook.infradead.org
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>

authored by

David Woodhouse and committed by
H. Peter Anvin
e24df921 df90ca96

+12 -12
+1 -1
arch/x86/boot/bioscall.S
··· 13 13 * touching registers they shouldn't be. 14 14 */ 15 15 16 - .code16gcc 16 + .code16 17 17 .text 18 18 .globl intcall 19 19 .type intcall, @function
+11 -11
arch/x86/boot/copy.S
··· 14 14 * Memory copy routines 15 15 */ 16 16 17 - .code16gcc 17 + .code16 18 18 .text 19 19 20 20 GLOBAL(memcpy) ··· 30 30 rep; movsb 31 31 popw %di 32 32 popw %si 33 - ret 33 + retl 34 34 ENDPROC(memcpy) 35 35 36 36 GLOBAL(memset) ··· 45 45 andw $3, %cx 46 46 rep; stosb 47 47 popw %di 48 - ret 48 + retl 49 49 ENDPROC(memset) 50 50 51 51 GLOBAL(copy_from_fs) 52 52 pushw %ds 53 53 pushw %fs 54 54 popw %ds 55 - call memcpy 55 + calll memcpy 56 56 popw %ds 57 - ret 57 + retl 58 58 ENDPROC(copy_from_fs) 59 59 60 60 GLOBAL(copy_to_fs) 61 61 pushw %es 62 62 pushw %fs 63 63 popw %es 64 - call memcpy 64 + calll memcpy 65 65 popw %es 66 - ret 66 + retl 67 67 ENDPROC(copy_to_fs) 68 68 69 69 #if 0 /* Not currently used, but can be enabled as needed */ ··· 71 71 pushw %ds 72 72 pushw %gs 73 73 popw %ds 74 - call memcpy 74 + calll memcpy 75 75 popw %ds 76 - ret 76 + retl 77 77 ENDPROC(copy_from_gs) 78 78 79 79 GLOBAL(copy_to_gs) 80 80 pushw %es 81 81 pushw %gs 82 82 popw %es 83 - call memcpy 83 + calll memcpy 84 84 popw %es 85 - ret 85 + retl 86 86 ENDPROC(copy_to_gs) 87 87 #endif