Skip to content

Commit

Permalink
Header file to produce 16-bit code with gcc
Browse files Browse the repository at this point in the history
gcc for i386 can be used with the assembly prefix ".code16gcc" to generate
16-bit (real-mode) code.  This header file provides the assembly prefix.

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
H. Peter Anvin authored and Linus Torvalds committed Jul 12, 2007
1 parent 8afd2af commit f7f4a5f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions arch/i386/boot/code16gcc.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/*
* code16gcc.h
*
* This file is -include'd when compiling 16-bit C code.
* Note: this asm() needs to be emitted before gcc omits any code.
* Depending on gcc version, this requires -fno-unit-at-a-time or
* -fno-toplevel-reorder.
*
* Hopefully gcc will eventually have a real -m16 option so we can
* drop this hack long term.
*/

#ifndef __ASSEMBLY__
asm(".code16gcc");
#endif

0 comments on commit f7f4a5f

Please sign in to comment.