- Timestamp:
- Oct 24, 2014, 1:50:44 AM (11 years ago)
- Location:
- trunk/libc
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/klibc/os2/os2.h
r3897 r3906 4 4 * Wrapper for the OS/2 API headers. 5 5 * 6 * Copyright (c) 2006 knut st. osmundsen <bird@innotek.de>6 * Copyright (c) 2006-2014 knut st. osmundsen <bird@innotek.de> 7 7 * 8 8 * … … 36 36 #define INCL_FSMACROS 37 37 #define INCL_FPCWMACROS 38 #define INCL_PRESERVE_REGISTER_MACROS 38 39 #define INCL_EXAPIS 39 40 -
trunk/libc/include/os2emx.h
r3897 r3906 13350 13350 13351 13351 13352 /* --------------------- FS Save/Load/Restoremacros ---------------------- */13353 13354 #if defined(INCL_FSMACROS) 13352 /* --------------------- Register preservation macros ---------------------- */ 13353 13354 #if defined(INCL_FSMACROS) || defined(INCL_PRESERVE_REGISTER_MACROS) 13355 13355 13356 13356 #ifndef FS_DISABLED … … 13384 13384 #endif 13385 13385 13386 #endif /* INCL_FSMACROS */13387 13388 #if defined(INCL_FPCWMACROS) 13386 #endif /* INCL_FSMACROS || INCL_PRESERVE_REGISTER_MACROS */ 13387 13388 #if defined(INCL_FPCWMACROS) || defined(INCL_PRESERVE_REGISTER_MACROS) 13389 13389 13390 13390 #ifndef FSCW_DISABLED … … 13412 13412 #endif 13413 13413 13414 #endif /* INCL_FPCWMACROS */ 13414 #endif /* INCL_FPCWMACROS || INCL_PRESERVE_REGISTER_MACROS */ 13415 13416 #if defined(INCL_PRESERVE_REGISTER_MACROS) || (defined(INCL_FSMACROS) && defined(INCL_FPCWMACROS)) 13417 # define PRESERVE_REGS_SAVE_LOAD_SAFE() FS_VAR(); FSCW_VAR(); PRESERVE_REGS_SAVE_LOAD_SAFE_AGAIN() 13418 # define PRESERVE_REGS_SAVE_LOAD_SAFE_AGAIN() do { FS_SAVE_LOAD(); FSCW_SAVE(); } while (0) 13419 # define PRESERVE_REGS_RESTORE() do { FSCW_RESTORE(); FS_RESTORE(); } while (0) 13420 #endif 13415 13421 13416 13422 -
trunk/libc/src/kNIX/os2/DosFreeModuleEx.c
r3862 r3906 4 4 * kNIX - DosFreeModuleEx. 5 5 * 6 * Copyright (c) 2004-20 06knut st. osmundsen <bird-src-spam@anduin.net>6 * Copyright (c) 2004-2014 knut st. osmundsen <bird-src-spam@anduin.net> 7 7 * 8 8 * … … 37 37 LIBCLOG_ENTER("hmod=%lx\n", hmod); 38 38 int rc; 39 FS_VAR();40 39 41 40 /* … … 48 47 * Free module. 49 48 */ 50 FS_SAVE_LOAD();51 49 rc = __libc_dosexFree(DOSEX_TYPE_LOAD_MODULE, (unsigned)hmod); 52 50 if (rc == -1) 51 { 52 PRESERVE_REGS_SAVE_LOAD_SAFE(); 53 53 rc = DosFreeModule(hmod); 54 FS_RESTORE(); 54 PRESERVE_REGS_RESTORE(); 55 } 55 56 if (!rc) 56 57 LIBCLOG_RETURN_INT(rc); -
trunk/libc/src/kNIX/os2/DosLoadModuleEx.c
r3862 r3906 2 2 /** @file 3 3 * 4 * kNIX - Dos CreateEventSemEx.4 * kNIX - DosLoadModuleEx. 5 5 * 6 * Copyright (c) 2004-20 06knut st. osmundsen <bird-src-spam@anduin.net>6 * Copyright (c) 2004-2014 knut st. osmundsen <bird-src-spam@anduin.net> 7 7 * 8 8 * … … 25 25 */ 26 26 27 #define INCL_PRESERVE_REGISTER_MACROS 27 28 #include "kNIX.h" 28 29 #include "DosEx.h" … … 42 43 HMODULE hmte; 43 44 int rc; 44 FS_VAR();45 45 46 46 /* 47 47 * Create the semaphore. 48 48 */ 49 FS_SAVE_LOAD();49 PRESERVE_REGS_SAVE_LOAD_SAFE(); 50 50 rc = DosLoadModule(pszObject, cbObject, pszModule, phmod); 51 PRESERVE_REGS_RESTORE(); 51 52 if (rc) 52 {53 FS_RESTORE();54 53 LIBCLOG_ERROR_RETURN_INT(rc); 55 }56 54 57 55 /* … … 74 72 if (!pDosEx) 75 73 { 74 PRESERVE_REGS_SAVE_LOAD_SAFE_AGAIN(); 76 75 DosFreeModule(hmte); 77 FS_RESTORE();76 PRESERVE_REGS_RESTORE(); 78 77 LIBCLOG_ERROR_RETURN_INT(ERROR_NOT_ENOUGH_MEMORY); 79 78 } … … 86 85 } 87 86 88 FS_RESTORE();89 87 LIBCLOG_RETURN_MSG(0, "ret 0 *phmod=%#lx\n", hmte); 90 88 } -
trunk/libc/src/kNIX/os2/fhOS2File.c
r3861 r3906 84 84 { 85 85 LIBCLOG_ENTER("pFH=%p:{.fh=%d} pvBuf=%p cbToRead=%zu pcbRead=%p\n", pFH, pFH->fh, pvBuf, cbToRead, pcbRead); 86 FS_VAR_SAVE_LOAD();87 FSCW_VAR();88 FSCW_SAVE();89 86 90 87 /* … … 92 89 * Allocate a buffer in the low heap. 93 90 */ 91 PRESERVE_REGS_SAVE_LOAD_SAFE(); 94 92 int rc; 95 93 ULONG cbActuallyRead = 0; … … 110 108 else 111 109 rc = DosRead(pFH->hNative, pvBuf, cbToRead, &cbActuallyRead); 112 110 PRESERVE_REGS_RESTORE(); 113 111 114 112 /* deal with the return code. */ … … 136 134 { 137 135 LIBCLOG_ENTER("pFH=%p:{.fh=%d} pvBuf=%p cbToWrite=%zu pcbWritten=%p\n", pFH, pFH->fh, pvBuf, cbToWrite, (void *)pcbWritten); 138 FS_VAR_SAVE_LOAD();139 FSCW_VAR();140 FSCW_SAVE();141 136 142 137 /* … … 144 139 * Allocate a buffer in the low heap. 145 140 */ 141 PRESERVE_REGS_SAVE_LOAD_SAFE(); 146 142 int rc; 147 143 ULONG cbActuallyWritten = 0; … … 161 157 else 162 158 rc = DosWrite(pFH->hNative, pvBuf, cbToWrite, &cbActuallyWritten); 159 PRESERVE_REGS_RESTORE(); 163 160 164 161 /* deal with the return code. */
Note:
See TracChangeset
for help on using the changeset viewer.