Changeset 3906 for branches/libc-0.6
- Timestamp:
- Oct 24, 2014, 1:50:44 AM (11 years ago)
- Location:
- branches/libc-0.6/src/emx
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/libc-0.6/src/emx/include/os2emx.h
r3839 r3906 13347 13347 13348 13348 13349 /* --------------------- FS Save/Load/Restoremacros ---------------------- */13350 13351 #if defined(INCL_FSMACROS) 13349 /* --------------------- Register preservation macros ---------------------- */ 13350 13351 #if defined(INCL_FSMACROS) || defined(INCL_PRESERVE_REGISTER_MACROS) 13352 13352 13353 13353 #ifndef FS_DISABLED … … 13364 13364 #endif 13365 13365 13366 #endif /* INCL_FSMACROS */13367 13368 #if defined(INCL_FPCWMACROS) 13369 13370 #ifndef F SCW_DISABLED13366 #endif /* INCL_FSMACROS || INCL_PRESERVE_REGISTER_MACROS */ 13367 13368 #if defined(INCL_FPCWMACROS) || defined(INCL_PRESERVE_REGISTER_MACROS) 13369 13370 #ifndef FPCW_DISABLED 13371 13371 #define FSCW_VAR() volatile unsigned __fpcw__; 13372 13372 #define FSCW_SAVE() __asm__ __volatile__ ("fnstcw %0;" : : "m" (__fpcw__) ) … … 13378 13378 #endif 13379 13379 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 13381 13388 13382 13389 -
branches/libc-0.6/src/emx/src/lib/sys/DosFreeModuleEx.c
r2254 r3906 4 4 * DosFreeModuleEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2014 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 31 31 #define INCL_ERRORS 32 32 #define INCL_DOSMODULEMGR 33 #define INCL_ FSMACROS33 #define INCL_PRESERVE_REGISTER_MACROS 34 34 #define INCL_EXAPIS 35 35 #include <os2emx.h> … … 45 45 { 46 46 LIBCLOG_ENTER("hmod=%lx\n", hmod); 47 int rc; 48 FS_VAR(); 47 int rc; 49 48 50 49 /* … … 57 56 * Free module. 58 57 */ 59 FS_SAVE_LOAD();60 58 rc = __libc_dosexFree(DOSEX_TYPE_LOAD_MODULE, (unsigned)hmod); 61 59 if (rc == -1) 60 { 61 PRESERVE_REGS_SAVE_LOAD_SAFE(); 62 62 rc = DosFreeModule(hmod); 63 FS_RESTORE(); 63 PRESERVE_REGS_RESTORE(); 64 } 64 65 if (!rc) 65 66 LIBCLOG_RETURN_INT(rc); -
branches/libc-0.6/src/emx/src/lib/sys/DosLoadModuleEx.c
r2254 r3906 4 4 * DosCreateEventSemEx. 5 5 * 6 * Copyright (c) 2004 knut st. osmundsen <bird-srcspam@anduin.net>6 * Copyright (c) 2004-2014 knut st. osmundsen <bird-srcspam@anduin.net> 7 7 * 8 8 * … … 31 31 #define INCL_ERRORS 32 32 #define INCL_DOSMODULEMGR 33 #define INCL_ FSMACROS33 #define INCL_PRESERVE_REGISTER_MACROS 34 34 #define INCL_EXAPIS 35 35 #include <os2emx.h> … … 50 50 HMODULE hmte; 51 51 int rc; 52 FS_VAR();53 52 54 53 /* 55 54 * Create the semaphore. 56 55 */ 57 FS_SAVE_LOAD();56 PRESERVE_REGS_SAVE_LOAD_SAFE(); 58 57 rc = DosLoadModule(pszObject, cbObject, pszModule, phmod); 58 PRESERVE_REGS_RESTORE(); 59 59 if (rc) 60 {61 FS_RESTORE();62 60 LIBCLOG_ERROR_RETURN_INT(rc); 63 }64 61 65 62 /* … … 82 79 if (!pDosEx) 83 80 { 81 PRESERVE_REGS_SAVE_LOAD_SAFE_AGAIN(); 84 82 DosFreeModule(hmte); 85 FS_RESTORE();83 PRESERVE_REGS_RESTORE(); 86 84 LIBCLOG_ERROR_RETURN_INT(ERROR_NOT_ENOUGH_MEMORY); 87 85 } … … 94 92 } 95 93 96 FS_RESTORE();97 94 LIBCLOG_RETURN_MSG(0, "ret 0 *phmod=%#lx\n", hmte); 98 95 } -
branches/libc-0.6/src/emx/src/lib/sys/__read.c
r3776 r3906 3 3 4 4 #include "libc-alias.h" 5 #define INCL_FSMACROS 6 #define INCL_FPCWMACROS 5 #define INCL_PRESERVE_REGISTER_MACROS 7 6 #define INCL_ERRORS 8 7 #include <os2emx.h> … … 41 40 */ 42 41 void *pvBuf_safe = NULL; 43 FS_VAR();44 FSCW_VAR();45 42 46 43 /* … … 60 57 } 61 58 62 FS_SAVE_LOAD(); 63 FSCW_SAVE(); 59 PRESERVE_REGS_SAVE_LOAD_SAFE(); 64 60 rc = DosRead(handle, pvBuf_safe ? pvBuf_safe : buf, cbToRead, &cbRead); 65 FSCW_RESTORE(); 66 FS_RESTORE(); 61 PRESERVE_REGS_RESTORE(); 67 62 if (pvBuf_safe) 68 63 { -
branches/libc-0.6/src/emx/src/lib/sys/__write.c
r2647 r3906 3 3 4 4 #include "libc-alias.h" 5 #define INCL_FSMACROS 6 #define INCL_FPCWMACROS 5 #define INCL_PRESERVE_REGISTER_MACROS 7 6 #define INCL_ERRORS 8 7 #include <os2emx.h> … … 24 23 int rc; 25 24 ULONG cbWritten; 26 FS_VAR();27 FSCW_VAR();28 29 25 30 26 /* … … 71 67 } 72 68 73 FS_SAVE_LOAD(); 74 FSCW_SAVE(); 69 PRESERVE_REGS_SAVE_LOAD_SAFE(); 75 70 rc = DosWrite(handle, buf, cbToWrite, &cbWritten); 76 FSCW_RESTORE(); 77 FS_RESTORE(); 71 PRESERVE_REGS_RESTORE(); 78 72 79 73 if (pvBuf_safe)
Note:
See TracChangeset
for help on using the changeset viewer.