You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

realmode.c 887B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /* Real-mode interface: C portions.
  2. *
  3. * Initial version by Michael Brown <mbrown@fensystems.co.uk>, January 2004.
  4. */
  5. #include "realmode.h"
  6. /*
  7. * Copy data to/from base memory.
  8. *
  9. */
  10. #ifdef KEEP_IT_REAL
  11. void memcpy_to_real ( segoff_t dest, void *src, size_t n ) {
  12. }
  13. void memcpy_from_real ( void *dest, segoff_t src, size_t n ) {
  14. }
  15. #endif /* KEEP_IT_REAL */
  16. #define RM_STACK_SIZE ( 0x1000 )
  17. /* gcc won't let us use extended asm outside a function (compiler
  18. * bug), ao we have to put these asm statements inside a dummy
  19. * function.
  20. */
  21. static void work_around_gcc_bug ( void ) __attribute__ ((used));
  22. static void work_around_gcc_bug ( void ) {
  23. /* Export _real_mode_stack_size as absolute linker symbol */
  24. __asm__ ( ".globl real_mode_stack_size" );
  25. __asm__ ( ".equ real_mode_stack_size, %c0" : : "i" (RM_STACK_SIZE) );
  26. }
  27. char *real_mode_stack;
  28. int lock_real_mode_stack;