Ignore:
Timestamp:
Oct 24, 2014, 1:50:44 AM (11 years ago)
Author:
bird
Message:

0.6,trunk: DosLoadModuleEx and DosFreeModuleEx should make an effort to preserve the FPU control word in addition to FS. Added a couple of common macros for doing both in one go. Fixed DosRead and DosWrite wrappers on trunk, they weren't restoring the registers.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/libc-0.6/src/emx/include/os2emx.h

    r3839 r3906  
    1334713347
    1334813348
    13349 /* --------------------- FS Save/Load/Restore macros ---------------------- */
    13350 
    13351 #if defined(INCL_FSMACROS)
     13349/* --------------------- Register preservation macros ---------------------- */
     13350
     13351#if defined(INCL_FSMACROS) || defined(INCL_PRESERVE_REGISTER_MACROS)
    1335213352
    1335313353#ifndef FS_DISABLED
     
    1336413364#endif
    1336513365
    13366 #endif /* INCL_FSMACROS */
    13367 
    13368 #if defined(INCL_FPCWMACROS)
    13369 
    13370 #ifndef FSCW_DISABLED
     13366#endif /* INCL_FSMACROS || INCL_PRESERVE_REGISTER_MACROS */
     13367
     13368#if defined(INCL_FPCWMACROS) || defined(INCL_PRESERVE_REGISTER_MACROS)
     13369
     13370#ifndef FPCW_DISABLED
    1337113371#define FSCW_VAR()        volatile unsigned __fpcw__;
    1337213372#define FSCW_SAVE()       __asm__ __volatile__ ("fnstcw %0;" : : "m" (__fpcw__) )
     
    1337813378#endif
    1337913379
    13380 #endif /* INCL_FPCWMACROS */
     13380#endif /* INCL_FPCWMACROS || INCL_PRESERVE_REGISTER_MACROS */
     13381
     13382#if defined(INCL_PRESERVE_REGISTER_MACROS) || (defined(INCL_FSMACROS) && defined(INCL_FPCWMACROS))
     13383# define PRESERVE_REGS_SAVE_LOAD_SAFE()       FS_VAR(); FSCW_VAR(); PRESERVE_REGS_SAVE_LOAD_SAFE_AGAIN()
     13384# define PRESERVE_REGS_SAVE_LOAD_SAFE_AGAIN() do { FS_SAVE_LOAD(); FSCW_SAVE(); } while (0)
     13385# define PRESERVE_REGS_RESTORE()              do { FSCW_RESTORE(); FS_RESTORE(); } while (0)
     13386#endif
     13387
    1338113388
    1338213389
Note: See TracChangeset for help on using the changeset viewer.