summaryrefslogtreecommitdiffstats
path: root/src/arch/i386/include/librm.h
diff options
context:
space:
mode:
authorMichael Brown2006-08-24 15:18:05 +0200
committerMichael Brown2006-08-24 15:18:05 +0200
commit6abfaa153b7b9bcdbdfc8b842ebb3ec99428d69b (patch)
tree72f551c4156a9dd85d48099f905daccdb12a5933 /src/arch/i386/include/librm.h
parentQuick utility to pad floppy disk images for vmware/qemu (diff)
downloadipxe-6abfaa153b7b9bcdbdfc8b842ebb3ec99428d69b.tar.gz
ipxe-6abfaa153b7b9bcdbdfc8b842ebb3ec99428d69b.tar.xz
ipxe-6abfaa153b7b9bcdbdfc8b842ebb3ec99428d69b.zip
Towards making KEEP_IT_REAL work again.
Fix bug that caused over-allocation of .text16 and .data16 memory areas by a factor of 16.
Diffstat (limited to 'src/arch/i386/include/librm.h')
-rw-r--r--src/arch/i386/include/librm.h19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/arch/i386/include/librm.h b/src/arch/i386/include/librm.h
index 8b0169ed..3f2dbd57 100644
--- a/src/arch/i386/include/librm.h
+++ b/src/arch/i386/include/librm.h
@@ -177,20 +177,25 @@ extern void remove_from_rm_stack ( void *data, size_t size );
#define BASEMEM_PARAMETER_INIT BASEMEM_PARAMETER_INIT_LIBRM
#define BASEMEM_PARAMETER_DONE BASEMEM_PARAMETER_DONE_LIBRM
-/* REAL_CODE: declare a fragment of code that executes in real mode */
-#define REAL_CODE( asm_code_str ) \
- "pushl $1f\n\t" \
- "call real_call\n\t" \
- "addl $4, %%esp\n\t" \
+/* TEXT16_CODE: declare a fragment of code that resides in .text16 */
+#define TEXT16_CODE( asm_code_str ) \
".section \".text16\", \"ax\", @progbits\n\t" \
".code16\n\t" \
".arch i386\n\t" \
- "\n1:\n\t" \
asm_code_str "\n\t" \
- "ret\n\t" \
".code32\n\t" \
".previous\n\t"
+/* REAL_CODE: declare a fragment of code that executes in real mode */
+#define REAL_CODE( asm_code_str ) \
+ "pushl $1f\n\t" \
+ "call real_call\n\t" \
+ "addl $4, %%esp\n\t" \
+ TEXT16_CODE ( "\n1:\n\t" \
+ asm_code_str \
+ "\n\t" \
+ "ret\n\t" )
+
#endif /* ASSEMBLY */
#endif /* LIBRM_H */