- Timestamp:
- Jun 26, 2014, 2:12:11 PM (11 years ago)
- Location:
- trunk/libc
- Files:
-
- 3 added
- 2 deleted
- 34 edited
- 3 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/Config.kmk
r3845 r3861 93 93 TEMPLATE_libc_CFLAGS.os2 = $(TEMPLATE_lib_CFLAGS.os2) 94 94 TEMPLATE_libc_CFLAGS.release = $(TEMPLATE_lib_CFLAGS.release) 95 TEMPLATE_libc_ASTOOL = $(TEMPLATE_libcasm_ASTOOL) 96 TEMPLATE_libc_ASFLAGS = $(TEMPLATE_libcasm_ASFLAGS) 95 97 else 96 98 TEMPLATE_libc_TOOL = GCC3 … … 123 125 124 126 125 # Intel assembly libs (default templates uses AT&T assembly ).127 # Intel assembly libs (default templates uses AT&T assembly with gcc). 126 128 127 129 TEMPLATE_libcasm = . -
trunk/libc/include/386/builtin.h
r3860 r3861 535 535 536 536 537 #ifndef __WATCOMC__ /** @todo port me later. */538 537 /** 539 538 * Atomically compare and exchange a 32-bit word. … … 544 543 * @param u32Cur The current value. Only update if *pu32 equals this one. 545 544 */ 545 #ifdef __WATCOMC__ 546 unsigned __atomic_cmpxchg32(volatile uint32_t *pu32, uint32_t u32New, uint32_t u32Old); 547 # pragma aux __atomic_cmpxchg32 = \ 548 "lock cmpxchg [edx], ecx" \ 549 "setz al" \ 550 "movzx eax, al" \ 551 parm [edx] [ecx] [eax] value [eax] 552 #else 546 553 static inline unsigned __atomic_cmpxchg32(volatile uint32_t *pu32, uint32_t u32New, uint32_t u32Old) 547 554 { 555 # ifdef _MSC_VER 556 uint32_t uOrg = _InterlockedCompareExchange((long volatile *)pu32, u32New, u32Old) 557 return uOrg == u32Old; 558 # else 548 559 __asm__ __volatile__("lock; cmpxchgl %2, %1\n\t" 549 560 "setz %%al\n\t" … … 553 564 : "r" (u32New), 554 565 "0" (u32Old)); 555 return (unsigned)u32Old; 556 } 557 558 566 return u32Old; 567 # endif 568 } 569 #endif 570 571 572 #ifndef __WATCOMC__ /** @todo port me later. */ 559 573 /** 560 574 * Atomically compare and exchange a pointer. -
trunk/libc/include/InnoTekLIBC/fork.h
r3860 r3861 525 525 * @param pfnCallback Callback function. See __LIBC_PFNFORKCALLBACK for prototype. 526 526 */ 527 #ifdef __WATCOMC__528 # define _FORK_PARENT1(uPriority, pfnCallback) \529 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = { pfnCallback, uPriority }; \530 const __LIBC_FORKCALLBACK * __based(__segname("forkpar1")) __fork_parent1_ptr_##pfnCallback = &__fork_parent1_##pfnCallback531 532 #elif defined(_MSC_VER)533 # define _FORK_PARENT1(uPriority, pfnCallback) \534 __Pragma(section("forkpar1", read, write)); \535 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = { pfnCallback, uPriority }; \536 const __LIBC_FORKCALLBACK * __declspec(allocate("forkpar1")) __fork_parent1_ptr_##pfnCallback = &__fork_parent1_##pfnCallback537 538 #else539 # define _FORK_PARENT1(uPriority, pfnCallback) \540 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = \541 { pfnCallback, uPriority + (unsigned)(&__fork_parent1_##pfnCallback - &__fork_parent1_##pfnCallback) }; \542 __asm__ (".stabs \"___fork_parent1__\", 23, 0, 0, ___fork_parent1_" #pfnCallback)543 #endif544 527 545 528 /** @def _FORK_CHILD1 … … 552 535 * @param pfnCallback Callback function. See __LIBC_PFNFORKCALLBACK for prototype. 553 536 */ 554 #ifdef __WATCOMC__ 555 # define _FORK_CHILD1(uPriority, pfnCallback) \ 537 #ifdef __OS2__ 538 # ifdef __WATCOMC__ 539 # define _FORK_PARENT1(uPriority, pfnCallback) \ 540 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = { pfnCallback, uPriority }; \ 541 const __LIBC_FORKCALLBACK * __based(__segname("SET2___fork_parent1__")) __fork_parent1_ptr_##pfnCallback = &__fork_parent1_##pfnCallback 542 # define _FORK_CHILD1(uPriority, pfnCallback) \ 543 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = { pfnCallback, uPriority }; \ 544 const __LIBC_FORKCALLBACK * __based(__segname("SET2___fork_child1__")) __fork_parent1_ptr_##pfnCallback = &__fork_parent1_##pfnCallback 545 # else 546 # define _FORK_PARENT1(uPriority, pfnCallback) \ 547 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = \ 548 { pfnCallback, uPriority + (unsigned)(&__fork_parent1_##pfnCallback - &__fork_parent1_##pfnCallback) }; \ 549 __asm__ (".stabs \"___fork_parent1__\", 23, 0, 0, ___fork_parent1_" #pfnCallback) 550 # define _FORK_CHILD1(uPriority, pfnCallback) \ 551 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_child1_##pfnCallback = { pfnCallback, uPriority + (unsigned)(&__fork_child1_##pfnCallback - &__fork_child1_##pfnCallback) }; \ 552 __asm__ (".stabs \"___fork_child1__\", 23, 0, 0, ___fork_child1_" #pfnCallback ) 553 # endif 554 555 #elif defined(__NT__) || defined(__WIN32__) || defined(__WIN64__) 556 # ifdef __WATCOMC__ 557 # define _FORK_PARENT1(uPriority, pfnCallback) \ 558 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = { pfnCallback, uPriority }; \ 559 const __LIBC_FORKCALLBACK * __based(__segname("forkpar1")) __fork_parent1_ptr_##pfnCallback = &__fork_parent1_##pfnCallback 560 # define _FORK_CHILD1(uPriority, pfnCallback) \ 556 561 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_child1_##pfnCallback = { pfnCallback, uPriority }; \ 557 562 const __LIBC_FORKCALLBACK * __based(__segname("forkcld1")) __fork_child1_ptr_##pfnCallback = &__fork_child1_##pfnCallback 558 563 559 # elif defined(_MSC_VER)560 # define _FORK_CHILD1(uPriority, pfnCallback) \564 # elif defined(_MSC_VER) 565 # define _FORK_PARENT1(uPriority, pfnCallback) \ 561 566 __Pragma(section("forkpar1", read, write)); \ 567 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_parent1_##pfnCallback = { pfnCallback, uPriority }; \ 568 const __LIBC_FORKCALLBACK * __declspec(allocate("forkpar1")) __fork_parent1_ptr_##pfnCallback = &__fork_parent1_##pfnCallback 569 # define _FORK_CHILD1(uPriority, pfnCallback) \ 570 __Pragma(section("forkcld1", read, write)); \ 562 571 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_child1_##pfnCallback = { pfnCallback, uPriority }; \ 563 572 const __LIBC_FORKCALLBACK * __declspec(allocate("forkcld1")) __fork_child1_ptr_##pfnCallback = &__fork_child1_##pfnCallback 564 573 574 # else 575 # error "Port me" 576 # endif 565 577 #else 566 # define _FORK_CHILD1(uPriority, pfnCallback) \ 567 static const __LIBC_FORKCALLBACK _FORK_DATA_USED() __fork_child1_##pfnCallback = { pfnCallback, uPriority + (unsigned)(&__fork_child1_##pfnCallback - &__fork_child1_##pfnCallback) }; \ 568 __asm__ (".stabs \"___fork_child1__\", 23, 0, 0, ___fork_child1_" #pfnCallback ) 578 # error "Port me" 569 579 #endif 570 580 -
trunk/libc/include/emx/startup.h
r3804 r3861 56 56 * Arrange that FUN will be called by _CRT_term(). */ 57 57 #ifdef __OS2__ 58 # define _CRT_INIT1(fun) __asm__ (".stabs \"___crtinit1__\", 23, 0, 0, _" #fun); 59 # define _CRT_EXIT1(fun) __asm__ (".stabs \"___crtexit1__\", 23, 0, 0, _" #fun); 60 #elif defined(__NT__) 61 # define _CRT_INIT1(fun) void *__crtinit1__##fun##__ __attribute__((__section__("crtinit1"))) = (void *)fun; 62 # define _CRT_EXIT1(fun) void *__crtexit1__##fun##__ __attribute__((__section__("crtexit1"))) = (void *)fun; 58 # ifdef __WATCOMC__ 59 # define _CRT_INIT1(fun) void * __based(__segname("SET2___crtinit1__")) __crtinit1__##fun##__ = (void *)fun 60 # define _CRT_EXIT1(fun) void * __based(__segname("SET2___crtexit1__")) __crtexit1__##fun##__ = (void *)fun 61 # else 62 # define _CRT_INIT1(fun) __asm__ (".stabs \"___crtinit1__\", 23, 0, 0, _" #fun) 63 # define _CRT_EXIT1(fun) __asm__ (".stabs \"___crtexit1__\", 23, 0, 0, _" #fun) 64 # endif 65 #elif defined(__NT__) || defined(__WIN32__) || defined(__WIN64__) 66 # ifdef __WATCOMC__ 67 # define _CRT_INIT1(fun) void * __based(__segname("crtinit1")) __crtinit1__##fun##__ = (void *)fun 68 # define _CRT_EXIT1(fun) void * __based(__segname("crtexit1")) __crtexit1__##fun##__ = (void *)fun 69 # elif defined(_MSC_VER) 70 # define _CRT_INIT1(fun) __declspec(allocate("crtinit1")) void * __crtinit1__##fun##__ = (void *)fun 71 # define _CRT_EXIT1(fun) __declspec(allocate("crtexit1")) void * __crtexit1__##fun##__ = (void *)fun 72 # else 73 # define _CRT_INIT1(fun) void *__crtinit1__##fun##__ __attribute__((__section__("crtinit1"))) = (void *)fun 74 # define _CRT_EXIT1(fun) void *__crtexit1__##fun##__ __attribute__((__section__("crtexit1"))) = (void *)fun 75 # endif 63 76 #else 64 77 # error "port me" -
trunk/libc/include/klibc/logstrict.h
r2918 r3861 72 72 #endif 73 73 74 /** Function name macro. */ 75 #ifdef __GNUC__ 76 # define __LIBCLOG_FUNC_NM __PRETTY_FUNCTION__ 77 #else 78 # define __LIBCLOG_FUNC_NM __FUNCTION__ 79 #endif 80 74 81 75 82 /** Macro to, in release mode too, log a generic message within a function. */ 76 83 #define LIBCLOG_REL(...) \ 77 __libc_LogMsg(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __VA_ARGS__)84 __libc_LogMsg(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __VA_ARGS__) 78 85 79 86 … … 81 88 #ifdef DEBUG_LOGGING 82 89 # define LIBCLOG_ENTER(...) \ 83 unsigned __libclog_uEnterTS__ = __libc_LogEnter(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __VA_ARGS__)90 unsigned __libclog_uEnterTS__ = __libc_LogEnter(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __VA_ARGS__) 84 91 #else 85 92 # define LIBCLOG_ENTER(...) //... … … 89 96 #ifdef DEBUG_LOGGING 90 97 # define LIBCLOG_MSG(...) \ 91 __libc_LogMsg(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __VA_ARGS__)98 __libc_LogMsg(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __VA_ARGS__) 92 99 #else 93 100 # define LIBCLOG_MSG(...) ((void)0) … … 97 104 #ifdef DEBUG_LOGGING 98 105 # define LIBCLOG_MSG2(...) \ 99 __libc_LogMsg(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __VA_ARGS__)106 __libc_LogMsg(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __VA_ARGS__) 100 107 #else 101 108 # define LIBCLOG_MSG2(...) ((void)0) … … 105 112 #ifdef DEBUG_LOGGING 106 113 # define LIBCLOG_ERROR(...) \ 107 __libc_LogError(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)114 __libc_LogError(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, __VA_ARGS__) 108 115 #else 109 116 # define LIBCLOG_ERROR(...) ((void)0) … … 113 120 #ifdef DEBUG_LOGGING 114 121 # define LIBCLOG_ERROR2(...) \ 115 __libc_LogError(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)122 __libc_LogError(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, __VA_ARGS__) 116 123 #else 117 124 # define LIBCLOG_ERROR2(...) ((void)0) … … 121 128 #ifdef DEBUG_LOGGING 122 129 # define LIBCLOG_ERROR_CHECK(expr, ...) \ 123 (!(expr) ? __libc_LogError(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) : ((void)0) )130 (!(expr) ? __libc_LogError(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, __VA_ARGS__) : ((void)0) ) 124 131 #else 125 132 # define LIBCLOG_ERROR_CHECK(expr, ...) ((void)0) … … 129 136 #ifdef DEBUG_LOGGING 130 137 # define LIBCLOG_ERROR2_CHECK(expr, ...) \ 131 (!(expr) ? __libc_LogError(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__) : ((void)0) )138 (!(expr) ? __libc_LogError(~0, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, __VA_ARGS__) : ((void)0) ) 132 139 #else 133 140 # define LIBCLOG_ERROR2_CHECK(expr, ...) ((void)0) … … 145 152 #ifdef DEBUG_LOGGING 146 153 # define LIBCLOG_LEAVE(...) \ 147 __libc_LogLeave(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __VA_ARGS__)154 __libc_LogLeave(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __VA_ARGS__) 148 155 #else 149 156 # define LIBCLOG_LEAVE(...) ((void)0) … … 176 183 #ifdef DEBUG_LOGGING 177 184 # define LIBCLOG_ERROR_LEAVE(...) \ 178 __libc_LogErrorLeave(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, __VA_ARGS__)185 __libc_LogErrorLeave(__libclog_uEnterTS__, __LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, __VA_ARGS__) 179 186 #else 180 187 # define LIBCLOG_ERROR_LEAVE(...) ((void)0) … … 328 335 #ifdef __LIBC_STRICT 329 336 # define LIBC_ASSERT(expr) ((expr) ? (void)0 \ 330 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #expr, NULL))337 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #expr, NULL)) 331 338 #else 332 339 # define LIBC_ASSERT(expr) ((void)0) … … 337 344 */ 338 345 #ifdef __LIBC_STRICT 339 # define LIBC_ASSERT_FAILED() __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, "0", NULL)346 # define LIBC_ASSERT_FAILED() __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, "0", NULL) 340 347 #else 341 348 # define LIBC_ASSERT_FAILED() ((void)0) … … 348 355 #ifdef __LIBC_STRICT 349 356 # define LIBC_ASSERT_MEM_R(pv, cb) (__libc_StrictMemoryR((pv), (cb)) ? (void)0 \ 350 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #pv "; " #cb, \357 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #pv "; " #cb, \ 351 358 "Memory buffer at %p of %d bytes isn't readable!\n", (pv), (cb))) 352 359 #else … … 360 367 #ifdef __LIBC_STRICT 361 368 # define LIBC_ASSERT_MEM_RW(pv, cb) (__libc_StrictMemoryRW((pv), (cb)) ? (void)0 \ 362 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #pv "; " #cb, \369 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #pv "; " #cb, \ 363 370 "Memory buffer at %p of %d bytes isn't readable and writable!\n", (pv), (cb))) 364 371 #else … … 371 378 #ifdef __LIBC_STRICT 372 379 # define LIBC_ASSERT_STR(psz) (__libc_StrictStringR((psz), ~0) ? (void)0 \ 373 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #psz, \380 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #psz, \ 374 381 "String at %p isn't readable!\n", (psz))) 375 382 #else … … 383 390 #ifdef __LIBC_STRICT 384 391 # define LIBC_ASSERT_NSTR(psz, cchMax) (__libc_StrictStringR((psz), cchMax) ? (void)0 \ 385 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #psz " " #cchMax, \392 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #psz " " #cchMax, \ 386 393 "String at %p of maximum %d bytes isn't readable!\n", (psz), (cchMax))) 387 394 #else … … 396 403 #ifdef __LIBC_STRICT 397 404 # define LIBC_ASSERTM(expr, ...) ((expr) ? (void)0 \ 398 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #expr, \405 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #expr, \ 399 406 __VA_ARGS__)) 400 407 #else … … 407 414 */ 408 415 #ifdef __LIBC_STRICT 409 # define LIBC_ASSERTM_FAILED(...) __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, "0", __VA_ARGS__)416 # define LIBC_ASSERTM_FAILED(...) __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, "0", __VA_ARGS__) 410 417 #else 411 418 # define LIBC_ASSERTM_FAILED(...) ((void)0) … … 418 425 #ifdef __LIBC_STRICT 419 426 # define LIBC_ASSERTM_MEM_R(pv, cb, ...) (__libc_StrictMemoryR((pv), (cb)) ? (void)0 \ 420 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #pv "; " #cb, \427 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #pv "; " #cb, \ 421 428 __VA_ARGS__)) 422 429 #else … … 430 437 #ifdef __LIBC_STRICT 431 438 # define LIBC_ASSERTM_MEM_RW(pv, cb, ...) (__libc_StrictMemoryRW((pv), (cb)) ? (void)0 \ 432 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #pv "; " #cb, \439 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #pv "; " #cb, \ 433 440 __VA_ARGS__)) 434 441 #else … … 441 448 #ifdef __LIBC_STRICT 442 449 # define LIBC_ASSERTM_STR(psz, ...) (__libc_StrictStringR((psz), ~0) ? (void)0 \ 443 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #psz, \450 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #psz, \ 444 451 __VA_ARGS__)) 445 452 #else … … 453 460 #ifdef __LIBC_STRICT 454 461 # define LIBC_ASSERTM_NSTR(psz, cchMax, ...) (__libc_StrictStringR((psz), cchMax) ? (void)0 \ 455 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #psz " " #cchMax, \462 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __LIBCLOG_FUNC_NM, __FILE__, __LINE__, #psz " " #cchMax, \ 456 463 __VA_ARGS__)) 457 464 #else -
trunk/libc/include/os2emx.h
r3860 r3861 13395 13395 13396 13396 # elif defined(__WATCOMC__) 13397 void FSCW_INTERNAL_SAVE( unsigned *);13397 void FSCW_INTERNAL_SAVE(volatile unsigned *); 13398 13398 # pragma aux FSCW_INTERNAL_SAVE = "fnstcw [edx]" parm [edx] 13399 void FSCW_INTERNAL_RESTORE( unsigned *);13399 void FSCW_INTERNAL_RESTORE(volatile unsigned *); 13400 13400 # pragma aux FS_INTERNAL_RESTORE = "fldcw [edx]" parm [edx] 13401 13401 # define FSCW_VAR() volatile unsigned __fpcw__; -
trunk/libc/include/os2thunk.h
r1517 r3861 12 12 13 13 typedef unsigned long _far16ptr; 14 15 _far16ptr _libc_32to16 (void *ptr); 16 void *_libc_16to32 (_far16ptr ptr); 14 extern _far16ptr _Optlink DosFlatToSel(void *ptr); 15 extern void * _Optlink DosSelToFlat(_far16ptr ptr); 16 #define _libc_32to16 DosFlatToSel 17 #define _libc_16to32 DosSelToFlat 17 18 18 19 typedef union _thunk_u -
trunk/libc/include/sys/cdefs.h
r3836 r3861 178 178 #endif 179 179 180 /** @} */ 180 /** @} */ 181 182 /** @name Misc 183 * @{ */ 184 #ifdef __WATCOMC__ 185 # define __KLIBC_BREAKPOINT() __asm { int 3 } 186 # define __KLIBC_CLEAR_DIR_FLAG() __asm { cld } 187 #elif defined(_MSC_VER) 188 # define __KLIBC_BREAKPOINT() __debugbreak() 189 # define __KLIBC_CLEAR_DIR_FLAG() __asm { cld } 190 #else 191 # define __KLIBC_BREAKPOINT() __asm__ __volatile__ ("int3") 192 # define __KLIBC_CLEAR_DIR_FLAG() __asm__ __volatile__ ("cld") 193 #endif 194 /** @} */ 195 181 196 182 197 #endif -
trunk/libc/include/sys/shm.h
r1987 r3861 86 86 #define SHM_INFO 14 87 87 88 #ifdef __ EMX__89 typedef __ uint32_t shmatt_t;88 #ifdef __KLIBC__ 89 typedef __int32_t shmatt_t; 90 90 #endif 91 91 92 92 struct shmid_ds { 93 93 struct ipc_perm shm_perm; /* operation permission structure */ 94 #ifdef __ EMX__94 #ifdef __KLIBC__ 95 95 size_t shm_segsz; /* size of segment in bytes */ 96 96 #else … … 99 99 pid_t shm_lpid; /* process ID of last shared memory op */ 100 100 pid_t shm_cpid; /* process ID of creator */ 101 #ifdef __ EMX__101 #ifdef __KLIBC__ 102 102 shmatt_t shm_nattch; /* number of current attaches */ 103 103 #else … … 123 123 shmall; /* max amount of shared memory (pages) */ 124 124 }; 125 #ifndef __ EMX__125 #ifndef __KLIBC__ 126 126 extern struct shminfo shminfo; 127 127 extern struct shmid_ds *shmsegs; … … 137 137 }; 138 138 139 #ifndef __ EMX__139 #ifndef __KLIBC__ 140 140 struct thread; 141 141 struct proc; … … 144 144 void shmexit(struct vmspace *); 145 145 void shmfork(struct proc *, struct proc *); 146 #endif /* !__ EMX__ */146 #endif /* !__KLIBC__ */ 147 147 #else /* !_KERNEL */ 148 148 … … 155 155 156 156 __BEGIN_DECLS 157 #ifndef __ EMX__157 #ifndef __KLIBC__ 158 158 int shmsys(int, ...); 159 159 #endif -
trunk/libc/src/kNIX/Makefile.kmk
r3857 r3861 92 92 $(PATH_LIBC_SRC)/kNIX/os2/b_initDllLoadException.c \ 93 93 $(PATH_LIBC_SRC)/kNIX/os2/__libc_back_envInit.c \ 94 $(PATH_LIBC_SRC)/kNIX/os2/386/__libc_back_envInitAsm.s \95 94 $(PATH_LIBC_SRC)/kNIX/os2/b_dir.c \ 96 95 $(PATH_LIBC_SRC)/kNIX/os2/b_fsDirChangeRoot.c \ … … 184 183 $(PATH_LIBC_SRC)/kNIX/os2/tcpipver43.c \ 185 184 $(PATH_LIBC_SRC)/kNIX/os2/timebomb.c \ 186 $(PATH_LIBC_SRC)/kNIX/os2/386/thunk0.s \187 $(PATH_LIBC_SRC)/kNIX/os2/386/thunk1.s \188 $(PATH_LIBC_SRC)/kNIX/os2/386/unwind.s \189 185 $(PATH_LIBC_SRC)/kNIX/os2/_os2_bad.c \ 190 186 $(PATH_LIBC_SRC)/kNIX/os2/__spawnve.c \ 191 187 $(PATH_LIBC_SRC)/kNIX/os2/__read_kbd.c \ 192 188 $(PATH_LIBC_SRC)/kNIX/os2/__select.c 189 ifdef CFG_LIBC_USE_WATCOM 190 libc_kNIX_SOURCES.os2 += \ 191 $(PATH_LIBC_SRC)/kNIX/os2/386/__libc_back_envInitAsm.asm \ 192 $(PATH_LIBC_SRC)/kNIX/os2/386/thunk1.asm \ 193 $(PATH_LIBC_SRC)/kNIX/os2/386/unwind.asm 194 else 195 libc_kNIX_SOURCES.os2 += \ 196 $(PATH_LIBC_SRC)/kNIX/os2/386/__libc_back_envInitAsm.s \ 197 $(PATH_LIBC_SRC)/kNIX/os2/386/thunk1.s \ 198 $(PATH_LIBC_SRC)/kNIX/os2/386/unwind.s 199 endif 200 193 201 TODO= \ 194 202 $(PATH_LIBC_SRC)/kNIX/os2/__init.c \ … … 196 204 $(PATH_LIBC_SRC)/kNIX/os2/__ioctl1.c \ 197 205 $(PATH_LIBC_SRC)/kNIX/os2/__ioctl2.c \ 198 $(PATH_LIBC_SRC)/kNIX/os2/__select.c \ 206 $(PATH_LIBC_SRC)/kNIX/os2/__select.c 207 199 208 200 209 -
trunk/libc/src/kNIX/os2/386/__libc_back_envInitAsm.asm
- Property svn:executable deleted
r3859 r3861 1 /* $Id$ 2 * 3 * Assembly stuff used by __initdll.c 4 * 5 * Copyright (c) 2003 InnoTek Systemberatung GmbH 6 * Author: knut st. osmundsen <bird-src-spam@anduin.net> 7 * 8 * 9 * This file is part of Innotek LIBC. 10 * 11 * Innotek LIBC is free software; you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License as published 13 * by the Free Software Foundation; either version 2 of the License, or 14 * (at your option) any later version. 15 * 16 * Innotek LIBC is distributed in the hope that it will be useful, 17 * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 * GNU Lesser General Public License for more details. 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * along with Innotek LIBC; if not, write to the Free Software 23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 24 * 25 */ 1 ; $Id$ 2 ;; @file 3 ; Assembly stuff used by __initdll.c 4 ; 5 ; @copyright Copyright (C) 2003-2014 knut st. osmundsen <bird-klibc-spam-xiv@anduin.net> 6 ; @licenses MIT, BSD2, BSD3, BSD4, LGPLv2.1, LGPLv3. 7 ; 26 8 27 #include <emx/asm386.h>28 9 29 .text 10 %include "klibc/os2/asmdefs.mac" 30 11 31 /** 32 * Initialize __org_environ and _STD(environ). 33 * 34 * @cproto int __libc_back_envInitAsm(const char *pszzEnv); 35 * @sketch Assumes large amounts of stack so we can construct the a reverse array there. 36 * 37 */ 38 .globl ___libc_back_envInitAsm 12 extern __hmalloc 13 extern __org_environ 14 extern _STD(environ) 15 16 BEGIN_CODE32 17 18 ;; 19 ; Initalizes the two global environment variable arrays _STD(environ) and 20 ; __org_environ. 21 ; 22 ; @returns 0 on success, -1 on failure. 23 ; @param pszzEnv [ebp + 8] Pointer to the OS/2 environment. 24 ; @cproto int __libc_back_envInitAsm(const char *pszzEnv); 25 ; @remarks Requires lots of stack. 26 ; 27 global ___libc_back_envInitAsm 39 28 ___libc_back_envInitAsm: 40 pushl %ebp 41 movl %esp, %ebp 42 pushl %edi 43 pushl %esi 29 push ebp 30 mov esp, ebp 31 push edi 44 32 45 /* 46 * Init registers. 47 */ 48 movl %esp, %esi 49 xorl %eax, %eax 50 xorl %ecx, %ecx 51 decl %ecx 52 movl 8(%ebp), %edi 53 cld 33 ; 34 ; Build a reverse environment vector on the stack. 35 ; 36 mov edi, [ebp + 8] ; pszzEnv 37 xor eax, eax ; eax = zero (for scab and terminator). 38 cld ; paranoia 54 39 55 /* 56 * Scan loop. 57 */ 58 env_loop: 59 push %edi 60 repnz scasb 61 cmpb %al, (%edi) 62 jnz env_loop 63 push %eax 40 or edi, edi ; Just in case the environment block is empty. 41 jnz .build_reverse_done 42 cmp [edi], al 43 jne .build_reverse_done 64 44 65 /* 66 * Calculate array size and allocate it. 67 */ 68 movl %esi, %ecx 69 subl %esp, %ecx 70 / _org_environ = _hmalloc(size); 71 pushl %ecx 72 call __hmalloc 73 addl $4, %esp 74 orl %eax, %eax 75 jz env_ret 76 mov %eax, __org_environ 45 mov ecx, -1 ; Scan until zero terminator. 46 .build_reverse_loop: 47 push edi ; Push the variable pointer. 48 repne scasb 49 cmp [edi], al ; More variables? 50 jne .build_reverse_loop 77 51 78 /* 79 * Do a reverse copy of the array on the stack. 80 */ 81 movl __org_environ, %edi 82 movl %edi, _STD(environ) 83 movl %esi, %edx 84 env_copy: 85 subl $4, %edx 86 movl (%edx), %eax 87 stosl 88 orl %eax, %eax 89 jnz env_copy 52 .build_reverse_done: 53 push eax ; Null terminator. 90 54 91 env_ret: 92 mov %esi, %esp 93 popl %esi 94 popl %edi 95 leave 96 ret 55 ; 56 ; Allocate the environment vector. 57 ; 58 lea ecx, [ebp - 4] ; ebp - 4 is the end of the vector we built above. 59 sub ecx, esp 97 60 61 push ecx 62 call __hmalloc 63 add esp, 4 64 or eax, eax 65 jz .return_error 66 67 mov [__org_environ], eax 68 mov [_STD(environ)], eax 69 70 ; 71 ; Initialize the environment vector by copying the vector we built on 72 ; the stack in reverse order. 73 ; 74 mov edi, eax 75 lea edx, [ebp - 4] ; end of array. 76 .reverse_copy: 77 sub edx, 4 78 mov eax, [edx] 79 stosd 80 or eax, eax 81 jnz .reverse_copy 82 83 .return: 84 lea esp, [ebp - 4] 85 pop edi 86 leave 87 ret 88 89 .return_error: 90 mov eax, -1 91 jmp .return 92 -
trunk/libc/src/kNIX/os2/386/__libc_back_envInitAsm.s
- Property svn:executable deleted
-
trunk/libc/src/kNIX/os2/386/signal16bit.asm
- Property svn:executable deleted
r3626 r3861 25 25 ; 26 26 27 %include "klibc/os2/asmdefs.mac" 28 27 29 extern Dos32TIB 28 30 extern ___libc_back_signalOS2V1Handler32bit 29 30 ;; move to header.31 segment CODE32 use32 flat align=16 public class=CODE32 segment DATA32 use32 align=16 public class=DATA33 segment SET1___fork_child1__ use32 align=4 public class=DATA34 segment SET2___fork_child1__ use32 align=4 public class=DATA35 segment SET3___fork_child1__ use32 align=4 public class=DATA36 segment BSS32 use32 align=16 public class=BSS37 group DGROUP DATA32 BSS32 SET1___fork_child1__ SET2___fork_child1__ SET3___fork_child1__38 segment CODE16 use16 align=16 public class=CODE39 31 40 32 -
trunk/libc/src/kNIX/os2/386/thunk1.asm
- Property svn:executable deleted
r3859 r3861 1 / thunk1.asm (emx+gcc) -- Copyright (c) 1992-1994 by Eberhard Mattes 1 ; $Id$ 2 ;; @file 3 ; 16-bit thunks. 4 ; 5 ; @copyright Copyright (c) 1992-1994 by Eberhard Mattes 6 ; Copyright (C) 2004-2014 knut st. osmundsen <bird-klibc-spam-xiv@anduin.net> 7 ; @licenses MIT, BSD2, BSD3, BSD4, LGPLv2.1, LGPLv3. 8 ; 2 9 3 .globl __libc_thunk1 10 %include "klibc/os2/asmdefs.mac" 4 11 5 /6 / unsigned long _libc_thunk1 (void *args, void *fun)7 /8 / Call 16-bit code9 /10 / In: ARGS Pointer to argument list. The first DWORD contains the11 / number of argument bytes, excluding that DWORD. The12 / remaining values are packed appropriately for calling13 / a 16-bit function. Pointers have been converted to14 / sel:offset format15 /16 / FUN 16:16 address of 16-bit function to be called. Both17 / `pascal' and `cdecl' calling conventions are supported.18 / The function must not change the DI register19 /20 / Out: EAX Return value (DX:AX) of 16-bit function21 /22 .p2align 223 12 24 .set ARGS, 4*4 # Offset to ARGS relative to %ebp 25 .set FUN, 5*4 # Offset to FUN relative to %ebp 26 .set RETADDR, -4*4 # Offset to spare space relative to FUN 13 extern DosFlatToSel 27 14 28 __libc_thunk1: pushl %ebp # Leave two dwords spare 29 pushl %ebp # space for 32-bit return address 30 pushl %ebp # Set up stack frame 31 movl %esp, %ebp 32 pushl %esi # Save %esi 33 pushl %edi # Save %edi 34 pushl %ebx # Save %ebx 35 pushl %es # (2) Save %es 36 movl %esp, %eax # Check stack 37 cmpw $0x1000, %ax # 1000H bytes left in this 64K 38 jae 1f # segment? Yes => skip 39 xorw %ax, %ax # Move %esp down to next 64K seg 40 movb $0, (%eax) # Stack probe 41 xchgl %esp, %eax # Set new %esp, %eax := old %esp 42 1: pushl %ss # Save original %ss:%esp on 43 pushl %eax # stack (points to saved %ebx) 44 / 45 / Copy arguments 46 / 47 movl ARGS(%ebp), %esi 48 lodsl 49 movl %eax, %ecx 50 subl %ecx, %esp 51 movl %esp, %edi 52 shrl $2, %ecx 53 repne 54 movsl 55 movl %eax, %ecx 56 andl $3, %ecx 57 repne 58 movsb # %edi now points to %ss:%esp59 leal FUN(%ebp), %esi 60 / 61 / Convert %eip to %cs:%ip and %esp to %ss:%sp62 / 63 movw %cs, RETADDR+4(%esi) 64 movl $Lthunk1_ret, RETADDR(%esi) 15 segment CODE32 16 ;; 17 ; unsigned long _libc_thunk1 (void *args, void *fun) 18 ; 19 ; Call 16-bit code 20 ; 21 ; In: ARGS Pointer to argument list. The first DWORD contains the 22 ; number of argument bytes, excluding that DWORD. The 23 ; remaining values are packed appropriately for calling 24 ; a 16-bit function. Pointers have been converted to 25 ; sel:offset format 26 ; 27 ; FUN 16:16 address of 16-bit function to be called. Both 28 ; `pascal' and `cdecl' calling conventions are supported. 29 ; The function must not change the DI register 30 ; 31 ; Out: EAX Return value (DX:AX) of 16-bit function 32 ; 33 global __libc_thunk1 34 __libc_thunk1: 35 %define ARGS (2*4) ; Offset to ARGS relative to ebp 36 %define FUN (3*4) ; Offset to FUN relative to ebp 37 push ebp ; Set up stack frame 38 mov ebp, esp 39 push esi ; Save esi 40 push edi ; Save edi 41 push ebx ; Save ebx 42 push es ; (2) Save es 43 mov eax, esp ; Check stack 44 cmp ax, 0x1000 ; 1000H bytes left in this 64K 45 jae .stack_good ; segment? Yes => skip 46 and eax, 0ffff0000h ; Move esp down to next 64K seg 47 mov word [eax], 0 ; Stack probe 48 xchg eax, esp ; Set new esp, eax := old esp 49 .stack_good: 50 push ss ; Save original ss:esp on 51 push eax ; stack (points to saved es). 65 52 66 movl $Lthunk16_call, %eax 67 call DosFlatToSel 68 movzwl %ax, %ecx # %ecx = offset 69 shrl $16, %eax # %eax = segment 70 pushl %eax 71 pushl %ecx 53 ; 54 ; Copy arguments onto the stack. 55 ; 56 cld ; paranoia 57 mov esi, [ebp + ARGS] 58 lodsd 59 mov ecx, eax ; Size of arguments (and size). 60 sub esp, ecx 61 mov edi, esp 62 shr ecx, 2 63 repne movsd 64 mov ecx, eax 65 and ecx, 3 66 repne movsb ; edi now points to the saved ss:esp. 72 67 73 movl %esp, %eax 74 call DosFlatToSel 75 movzwl %ax, %ecx # %ecx = offset 76 shrl $16, %eax # %eax = segment 77 pushl %eax 78 pushl %ecx 68 lea esi, [ebp + FUN] 79 69 80 / 81 / Jump to 16-bit code 82 / 83 lss (%esp), %esp # Switch to new %ss:%sp 84 lret 70 ; 71 ; Convert eip to cs:ip and esp to ss:sp. 72 ; 73 mov eax, .thunk16_call 74 call DosFlatToSel 75 movzx ecx, ax ; ecx <- offset 76 shr eax, 16 ; eax <- segment 77 push eax 78 push ecx 85 79 86 / 87 / Call 16-bit function 88 / 89 / In: %esi Points to 16:16 function address 90 / Note: Actually this is 16-bit code. It is put inside the 32-bit code 91 / since a.out format does not support 16-bit segments. 92 / 93 .p2align 2 94 Lthunk16_call: 95 / lcall *(%esi) 96 .byte 0x67,0xff,0x1e 97 / ljmp *RETADDR(%esi) 98 .byte 0x67,0x66,0xff,0x6e,RETADDR 80 mov eax, esp 81 call DosFlatToSel 82 movzx ecx, ax ; ecx <- offset 83 shr eax, 16 ; eax <- segment 84 push eax 85 push ecx 99 86 100 .p2align 2 101 Lthunk1_ret: movzwl %di, %esp # (4) Remove arguments 102 lss (%esp),%esp # Get 32-bit stack pointer 103 popl %es # Restore %es 104 popl %ebx # Restore %ebx 105 popl %edi # Restore %edi 106 popl %esi # Restore %esi 107 popl %ebp # Restore %ebp 108 addl $4*2,%esp # Skip spare space 109 movzwl %ax, %eax # Compute return value 110 movzwl %dx, %edx 111 shll $16, %edx 112 orl %edx, %eax 113 ret # Return to 32-bit code 87 ; 88 ; Load 16-bit stack and jump (return) to the 16-bit code. 89 ; 90 lss esp, [esp] 91 retf 92 93 ; 94 ; Call 16-bit function 95 ; 96 ; In: esi Points to 16:16 function address 97 ; 98 segment CODE16 99 .thunk16_call: 100 call far dword [esi] 101 jmp dword seg .thunk1_ret:.thunk1_ret 102 103 segment CODE32 104 .thunk1_ret: 105 movzx esp, di ; (4) Remove arguments 106 lss esp, [esp] ; Get 32-bit stack pointer 107 pop es ; Restore es 108 pop ebx ; Restore ebx 109 pop edi ; Restore edi 110 pop esi ; Restore esi 111 pop ebp ; Restore ebp 112 113 movzx eax, ax ; Compute 32-bit return value. 114 shl edx, 16 115 or eax, edx 116 ret ; Return to caller of __libc_thunk1. 117 -
trunk/libc/src/kNIX/os2/386/thunk1.s
- Property svn:executable deleted
-
trunk/libc/src/kNIX/os2/386/unwind.asm
- Property svn:executable deleted
r3859 r3861 1 / sys/unwind.s (emx+gcc) -- Copyright (c) 1992-1994 by Eberhard Mattes */ 1 ; sys/unwind.s (emx+gcc) -- Copyright (c) 1992-1994 by Eberhard Mattes 2 ; Copyright (c) 2014 by Knut St. Osmundsen 2 3 3 .globl ___unwind2 4 %include "klibc/os2/asmdefs.mac" 4 5 5 / void __unwind2 (void *xcpt_reg_ptr) 6 extern DosUnwindException 6 7 8 BEGIN_CODE32 9 ; void __unwind2 (void *xcpt_reg_ptr) 10 global ___unwind2 7 11 ___unwind2: 8 mov l 1*4(%esp), %eax /* xcpt_reg_ptr */9 push l $010 push l $L_cont11 push l %eax12 mov eax, [esp + 4] 13 push 0 14 push __unwind2_continue 15 push eax 12 16 call DosUnwindException 13 L_cont: addl $3*4, %esp 17 __unwind2_continue: 18 lea esp, [esp + 12] 14 19 ret 20 -
trunk/libc/src/kNIX/os2/386/unwind.s
- Property svn:executable deleted
-
trunk/libc/src/kNIX/os2/DosEx.c
r3860 r3861 155 155 * All facts speaks for it being lazyingly initialized during loading. 156 156 */ 157 _CRT_INIT1(dosexInit) 157 _CRT_INIT1(dosexInit); 158 158 159 159 /** … … 164 164 { 165 165 LIBCLOG_ENTER("\n"); 166 FS_VAR() 166 FS_VAR(); 167 167 if (gfInited) 168 168 LIBCLOG_RETURN_VOID(); -
trunk/libc/src/kNIX/os2/b_dir.c
r2929 r3861 46 46 static int dirIOControl(__LIBC_PFH pFH, unsigned long ulIOControl, va_list va, int *prc); 47 47 static int dirSetFileMode(__LIBC_PFH pFH, mode_t fMode); 48 static int dirSetOwner(__LIBC_PFH pFH, uid_t uid );48 static int dirSetOwner(__LIBC_PFH pFH, uid_t uid, gid_t gid); 49 49 static int dirSetTimes(__LIBC_PFH pFH, const struct timeval *paTimes); 50 50 static int dirStat(__LIBC_PFH pFH, struct stat *pStat); … … 191 191 192 192 /** @copydoc __LIBC_FHOPS::pfnSetOwner */ 193 static int dirSetOwner(__LIBC_PFH pFH, uid_t uid )194 { 195 LIBCLOG_ENTER("pFH=%p:{.fd=%d} uid=%d \n", (void *)pFH, pFH->fh, uid);193 static int dirSetOwner(__LIBC_PFH pFH, uid_t uid, gid_t gid) 194 { 195 LIBCLOG_ENTER("pFH=%p:{.fd=%d} uid=%d gid=%d\n", (void *)pFH, pFH->fh, uid, gid); 196 196 int rc; 197 197 if (pFH->pszNativePath) … … 542 542 * Fill the buffer? 543 543 */ 544 if (pFHDir->cFiles <= 0)544 if (pFHDir->cFiles == 0) 545 545 { 546 546 FS_VAR_SAVE_LOAD(); -
trunk/libc/src/kNIX/os2/b_fsNativeFileModeSet.c
r3816 r3861 178 178 } EAs = 179 179 { 180 sizeof(EAs), 0, 0, sizeof(EA_MODE) - 1, sizeof(uint32_t) + 4, EA_MODE, EAT_BINARY, sizeof(uint32_t), Mode180 sizeof(EAs), 0, 0, sizeof(EA_MODE) - 1, sizeof(uint32_t) + 4, EA_MODE, EAT_BINARY, sizeof(uint32_t), 0 181 181 }; 182 182 #pragma pack() 183 EAs.u32Mode = Mode; 183 184 184 185 if (!S_ISREG(Mode) && !S_ISDIR(Mode)) -
trunk/libc/src/kNIX/os2/b_fsNativeFileOwnerSet.c
r3816 r3861 92 92 /* .usUidType =*/ EAT_BINARY, 93 93 /* .cbUidData =*/ sizeof(uint32_t), 94 /* .u32Uid =*/ uid != (uid_t)-1 ? uid : StOrg.st_uid,94 /* .u32Uid =*/ 0, 95 95 /* .achUidAlign =*/ "", 96 96 … … 102 102 /* .usGidType =*/ EAT_BINARY, 103 103 /* .cbGidData =*/ sizeof(uint32_t), 104 /* .u32Gid =*/ gid != (gid_t)-1 ? gid : StOrg.st_gid,104 /* .u32Gid =*/ 0, 105 105 /* .achGidAlign =*/ "", 106 106 }; 107 107 #pragma pack() 108 108 109 if (uid != -1 && uid != 0) 109 EAs.u32Uid = uid != (uid_t)-1 ? uid : StOrg.st_uid; 110 if (EAs.u32Uid != 0) 110 111 EAs.fUidEA = FEA_NEEDEA; 111 if (gid != -1 && gid != 0) 112 113 EAs.u32Gid = gid != (gid_t)-1 ? gid : StOrg.st_gid; 114 if (EAs.u32Gid != 0) 112 115 EAs.fGidEA = FEA_NEEDEA; 113 116 … … 118 121 LIBCLOG_ERROR2("__libc_back_fsNativeSetEAs('%s',,,,) -> %d, oError=%#lx\n", pszNativePath, rc, EaOp2.oError); 119 122 if ( rc == ERROR_EAS_NOT_SUPPORTED 120 && (uid == -1 || uid == 0)121 && (gid == -1 || gid == 0))123 && (uid != (uid_t)-1 ? uid : StOrg.st_uid) == 0 124 && (gid != (gid_t)-1 ? gid : StOrg.st_gid) == 0 ) 122 125 rc = 0; 123 126 else -
trunk/libc/src/kNIX/os2/b_fsStat.c
r2929 r3861 183 183 * Query if anything is attached/mounted at the specified mount point. 184 184 */ 185 FS_VAR() 185 FS_VAR(); 186 186 FS_SAVE_LOAD(); 187 187 ULONG fError; -
trunk/libc/src/kNIX/os2/b_panic.c
r3848 r3861 390 390 { 391 391 LIBCLOG_MSG("Breakpoint\n"); 392 __asm__ __volatile__ ("int3\n\t" 393 "nop\n\t"); 392 __KLIBC_BREAKPOINT(); 394 393 } 395 394 -
trunk/libc/src/kNIX/os2/b_processWait.c
r3860 r3861 137 137 138 138 139 _CRT_INIT1(waitInit) 140 _CRT_EXIT1(__libc_back_processWaitNotifyTerm) 139 _CRT_INIT1(waitInit); 140 _CRT_EXIT1(__libc_back_processWaitNotifyTerm); 141 141 142 142 /** -
trunk/libc/src/kNIX/os2/exceptions.c
r2929 r3861 38 38 * External Functions * 39 39 *******************************************************************************/ 40 #ifndef __WATCOMC__ /** @todo figure out weak symbols in watcom C/C++ */ 40 41 /* from kLib/kHeapDbg.h */ 41 42 typedef enum … … 48 49 void * pvOS); 49 50 /* Weak on _Optlink and _System doesn't work because of underscoring. */ 50 asm (".weak kHeapDbgException"); 51 __asm__ (".weak kHeapDbgException"); 52 #endif /* !__WATCOMC__ */ 51 53 52 54 … … 66 68 PVOID pvWhatEver) 67 69 { 70 #ifdef __WATCOMC__ 71 __asm {cld}; /* usual paranoia. */ 72 #else 68 73 __asm__ ("cld"); /* usual paranoia. */ 74 #endif 69 75 siginfo_t SigInfo = {0}; 70 76 int rc; /* return from __libc_Back_signalRaise() */ … … 117 123 */ 118 124 case XCPT_ACCESS_VIOLATION: 125 #ifndef __WATCOMC__ /** @todo figure out weak symbols in watcom C/C++ */ 119 126 /* If we're linking libc01.elh or someone is linking static libc 120 127 together with kLib the electric fence heap will get the opportunity … … 143 150 return XCPT_CONTINUE_EXECUTION; 144 151 } 152 #endif /* !__WATCOMC__ */ 145 153 /* take signal */ 146 154 SigInfo.si_signo = SIGSEGV; … … 290 298 || (rc = __libc_back_signalRaisePoked(&pXcptRepRec, pXcptRepRec->ExceptionInfo[0])) < 0) 291 299 { 292 300 #if 0 /** bird: no so sure about this. */ 293 301 /* 294 302 * For all but thread 1 we commit suicide. … … 309 317 } 310 318 FS_RESTORE(); 311 319 #endif 312 320 return XCPT_CONTINUE_SEARCH; 313 321 } -
trunk/libc/src/kNIX/os2/fhOS2File.c
r3816 r3861 633 633 } EAs = 634 634 { 635 sizeof(EAs), 0, 0, sizeof(EA_MODE) - 1, sizeof(uint32_t) + 4, EA_MODE, EAT_BINARY, sizeof(uint32_t), fMode635 sizeof(EAs), 0, 0, sizeof(EA_MODE) - 1, sizeof(uint32_t) + 4, EA_MODE, EAT_BINARY, sizeof(uint32_t), 0 636 636 }; 637 637 #pragma pack() 638 638 639 EAs.u32Mode = fMode; 639 640 if (!S_ISREG(fMode) && !S_ISDIR(fMode)) 640 641 EAs.fEA = FEA_NEEDEA; -
trunk/libc/src/kNIX/os2/fs-os2.c
r3816 r3861 838 838 char _achBuffer[SIZEOF_ACHBUFFER + 4]; 839 839 char *pachBuffer = (char *)((uintptr_t)&_achBuffer[3] & ~3); 840 unsignedcLoopsLeft = 8;840 int cLoopsLeft = 8; 841 841 int fInUnixTree = __libc_gfInUnixTree; 842 842 int rcRet = 0; … … 844 844 __LIBC_PFSINFO pFsInfo = NULL; 845 845 int fUnixEAs; 846 FS_VAR() 846 FS_VAR(); 847 847 FS_SAVE_LOAD(); 848 848 for (;;) … … 1282 1282 1283 1283 /* Check if we've reached the max number of symlink loops before we continue. */ 1284 if ( cLoopsLeft--<= 0)1284 if (--cLoopsLeft <= 0) 1285 1285 { 1286 1286 rcRet = -ELOOP; … … 1459 1459 if (!s_Seed.ausSeed[3]) 1460 1460 { 1461 #ifdef __WATCOMC__ 1462 extern uint64_t __libc_back_fsUnixAttribsInit_RdTsc(void); 1463 # pragma aux __libc_back_fsUnixAttribsInit_RdTsc = "rdtsc" value [eax edx] 1464 s_Seed.u64TSC = __libc_back_fsUnixAttribsInit_RdTsc(); 1465 #else 1461 1466 __asm__ __volatile__ ("rdtsc" : "=A" (s_Seed.u64TSC)); 1467 #endif 1462 1468 s_Seed.ausSeed[3] = 1; 1463 1469 } -
trunk/libc/src/kNIX/os2/libcfork.c
r3804 r3861 210 210 static void forkBthCopyPagesDetect(void *pvDst, const void *pvSrc, size_t cb); 211 211 static void forkBthCopyPagesPlain(void *pvDst, const void *pvSrc, size_t cb); 212 #ifdef __GNUC__ 212 213 static void forkBthCopyPagesMMX(void *pvDst, const void *pvSrc, size_t cb); 213 # if 0214 # if 0 214 215 static void forkBthCopyPagesMMXNonTemporal(void *pvDst, const void *pvSrc, size_t cb); 215 216 static void forkBthCopyPagesSSE2(void *pvDst, const void *pvSrc, size_t cb); 217 # endif 216 218 #endif 217 219 static void forkBthCallbacksSort(__LIBC_PFORKCALLBACK *papCallbacks); … … 567 569 uint32_t u1; 568 570 uint32_t u2; 571 #if defined(__WATCOMC__) || defined(_MSC_VER) 572 __asm { 573 pushf 574 mov eax, [esp] 575 xor [esp], 0200000h 576 popf 577 pushf 578 cmp eax, [esp] 579 pop eax 580 setne al 581 and eax, 1 582 mov [fRet], eax 583 }; 584 #else 569 585 __asm__ ("pushf\n\t" 570 586 "pop %1\n\t" … … 580 596 "popf\n\t" 581 597 : "=m" (fRet), "=r" (u1), "=r" (u2)); 598 #endif 582 599 return fRet; 583 600 } … … 590 607 * @returns EDX after cpuid operation. 591 608 */ 609 #ifdef __WATCOMC__ 610 uint32_t CpuIdEDX(unsigned uOperator); 611 # pragma aux CpuIdEDX = "cpuid" parm [eax] value [edx] modify [eax ebx ecx edx] 612 #else 592 613 static inline uint32_t CpuIdEDX(unsigned uOperator) 593 614 { … … 600 621 return u32EDX; 601 622 } 623 #endif 602 624 603 625 … … 617 639 * Determine fxsave/fxrstor support. 618 640 */ 619 static int fHaveFXSR = -1;620 if ( fHaveFXSR == -1)621 fHaveFXSR = HasCpuId() && (CpuIdEDX(1) & 0x1000000); /* bit 24 - fxsr */641 static int s_fHaveFXSR = -1; 642 if (s_fHaveFXSR == -1) 643 s_fHaveFXSR = HasCpuId() && (CpuIdEDX(1) & 0x1000000); /* bit 24 - fxsr */ 622 644 623 645 /* … … 626 648 PX86FXSTATE pFPU = (PX86FXSTATE)alloca(512 + 16); 627 649 pFPU = (PX86FXSTATE)(((uintptr_t)pFPU + 15) & ~15); 628 if (fHaveFXSR) 650 #if defined(__WATCOMC__) || defined(_MSC_VER) 651 if (s_fHaveFXSR) 652 { 653 __asm { 654 mov eax, [pFPU] 655 fxsave [eax] 656 } 657 } 658 else 659 { 660 __asm { 661 mov eax, [pFPU] 662 fnsave [eax] 663 } 664 } 665 #else 666 if (s_fHaveFXSR) 629 667 __asm__ __volatile__ ("fxsave %0" : "=m" (*pFPU)); 630 668 else 631 669 __asm__ __volatile__ ("fnsave %0" : "=m" (*pFPU)); 670 #endif 632 671 633 672 /* … … 663 702 */ 664 703 pid_t pid = -1; 704 #if defined(__WATCOMC__) || defined(_MSC_VER) 705 __asm { 706 lea edx, [XcptRegRec] 707 pushfd 708 push ebx 709 push ecx 710 push esi 711 push edi 712 push ebp 713 push gs 714 715 ; 716 ; Call the fork worker, forkParDo(). 717 ; 718 mov eax, esp 719 push edx 720 push eax 721 push fork_ret 722 call forkParDo 723 add esp, 12 ; cdecl 724 jmp fork_skip_regs 725 726 ; 727 ; The Child returns here. 728 ; 729 fork_ret: 730 pop gs 731 pop ebp 732 pop edi 733 pop esi 734 pop ecx 735 pop ebx 736 popfd 737 fork_skip_regs: 738 mov [pid], eax 739 }; 740 #else 665 741 __asm__ __volatile__ ( 666 742 "pushf\n\t" … … 695 771 "fork_skip_regs:\n\t" 696 772 : "=a" (pid): "d" (&XcptRegRec) : "ecx"); 773 #endif 697 774 698 775 /* … … 710 787 * Restore the FPU state. 711 788 */ 712 if (fHaveFXSR) 789 #if defined(__WATCOMC__) || defined(_MSC_VER) 790 if (s_fHaveFXSR) 791 { 792 __asm { 793 mov eax, [pFPU] 794 fxrstor [eax] 795 } 796 } 797 else 798 { 799 __asm { 800 mov eax, [pFPU] 801 frstor [eax] 802 } 803 } 804 #else 805 if (s_fHaveFXSR) 713 806 __asm__ __volatile__ ("fxrstor %0" : "=m" (*pFPU)); 714 807 else 715 808 __asm__ __volatile__ ("frstor %0" : "=m" (*pFPU)); 809 #endif 716 810 717 811 FS_RESTORE(); … … 1472 1566 } 1473 1567 } 1568 #if defined(__WATCOMC__) || defined(_MSC_VER) 1569 void *pvStackRet = pForkHandle->pvStackRet; 1570 void *pvForkRet = pForkHandle->pvForkRet; 1571 __asm { 1572 mov edx, [pForkHandle] 1573 mov edi, [pvStackRet] 1574 mov esi, [pvForkRet] 1575 mov eax, [uNewESP] 1576 push edx 1577 call forkChlDoFork2 1578 mov esp, edi 1579 jmp esi 1580 }; 1581 #else 1474 1582 __asm__ __volatile__("movl %0, %%esp\n\t" 1475 1583 "pushl %1\n\t" … … 1481 1589 "D" ((uintptr_t)pForkHandle->pvStackRet), 1482 1590 "S" (pForkHandle->pvForkRet)); 1591 #endif 1483 1592 /* just for referencing the functions so GCC doesn't optimize them away - we'll never get here!!! */ 1484 1593 return forkChlDoFork2(pForkHandle) + forkParDo(NULL, NULL, NULL); … … 2714 2823 */ 2715 2824 pfnForkBthCopyPages = forkBthCopyPagesPlain; /* default, always works. */ 2825 #ifdef __GNUC__ 2716 2826 if (HasCpuId()) 2717 2827 { … … 2720 2830 { 2721 2831 pfnForkBthCopyPages = forkBthCopyPagesMMX; 2722 # if 0 /* missing hardware to test this. */2832 # if 0 /* missing hardware to test this. */ 2723 2833 /* hope this is right */ 2724 2834 if ( (uEdx & (1 << 24)) /*FXSR*/ … … 2726 2836 && (uEdx & (1 << 26)) /*SSE2*/) 2727 2837 pfnForkBthCopyPages = forkBthCopyPagesSSE2; 2728 # endif2729 # if 0 /* too slow for some peculiar reason... */2838 # endif 2839 # if 0 /* too slow for some peculiar reason... */ 2730 2840 else 2731 2841 { … … 2734 2844 pfnForkBthCopyPages = forkBthCopyPagesMMXNonTemporal; 2735 2845 } 2846 # endif 2847 } 2848 } 2736 2849 #endif 2737 }2738 }2739 2850 pfnForkBthCopyPages(pvDst, pvSrc, cb); 2740 2851 } 2741 2852 2742 2853 2854 #ifdef __GNUC__ 2743 2855 __asm__(".align 4\n\t"); 2856 #endif 2744 2857 /** 2745 2858 * Copy page memory, plain stupid rep movsl. … … 2752 2865 { 2753 2866 LIBCLOG_ENTER("pvDst=%p pvSrc=%p cb=0x%08x\n", pvDst, pvSrc, cb); 2867 #ifdef __WATCOMC__ 2868 extern void forkBthCopyPagesPlainInner(void *pvDst, const void *pvSrc, size_t cb); 2869 # pragma aux forkBthCopyPagesPlainInner = \ 2870 "cld" \ 2871 "shr ecx, 2" \ 2872 "rep movsd" \ 2873 parm [edi] [esi] [ecx] modify [edi esi ecx] 2874 #elif defined(_MSC_VER) 2875 __movsd(pvDst, pvSrc, cb >> 2); 2876 #else 2754 2877 register unsigned long int r0,r1,r2; 2755 2878 __asm__ __volatile__ … … 2759 2882 : "0" (cb / 4), "1" (pvDst), "2" (pvSrc) 2760 2883 : "memory"); 2884 #endif 2761 2885 LIBCLOG_RETURN_VOID(); 2762 2886 } 2763 2887 2764 2888 2889 #ifdef __GNUC__ 2765 2890 __asm__(".align 4\n\t"); 2766 2891 /** … … 2807 2932 LIBCLOG_RETURN_VOID(); 2808 2933 } 2934 #endif 2809 2935 2810 2936 2811 2937 #if 0 /* too slow */ 2938 #ifdef __GNUC__ 2812 2939 __asm__(".align 4\n\t"); 2940 #endif 2813 2941 /** 2814 2942 * Copy page memory, MMX with non-temporal stores. … … 3192 3320 PVOID pvWhatEver) 3193 3321 { 3194 __ asm__ ("cld"); /* usual paranoia.*/3322 __KLIBC_CLEAR_DIR_FLAG(); /* paranoia. */ 3195 3323 3196 3324 if (pXcptRepRec->fHandlerFlags & (EH_UNWINDING | EH_EXIT_UNWIND)) … … 3319 3447 PPIB pPib; 3320 3448 PTIB pTib; 3321 __ asm__ ("cld"); /* usual paranoia.*/3449 __KLIBC_CLEAR_DIR_FLAG(); /* paranoia. */ 3322 3450 3323 3451 if (pXcptRepRec->fHandlerFlags & (EH_UNWINDING | EH_EXIT_UNWIND)) … … 3387 3515 PVOID pvWhatEver) 3388 3516 { 3389 __ asm__ ("cld"); /* usual paranoia.*/3517 __KLIBC_CLEAR_DIR_FLAG(); /* paranoia. */ 3390 3518 3391 3519 if (pXcptRepRec->fHandlerFlags & (EH_UNWINDING | EH_EXIT_UNWIND)) -
trunk/libc/src/kNIX/os2/logstrict.c
r3860 r3861 1431 1431 XRepRec.ExceptionAddress = (void*)&__libc_LogAssert; 1432 1432 if (DosRaiseException(&XRepRec)) 1433 __ asm__ __volatile__("int $3");1433 __KLIBC_BREAKPOINT(); 1434 1434 } 1435 1435 } … … 2276 2276 */ 2277 2277 if ( pParent->hFile != pChild->hFile 2278 && pParent->hFile >= 02279 && pChild->hFile >= 0)2278 && (LONG)pParent->hFile >= 0 2279 && (LONG)pChild->hFile >= 0) 2280 2280 { 2281 2281 HFILE hNew = pParent->hFile; -
trunk/libc/src/kNIX/os2/safesems.c
r2929 r3861 133 133 static int __libc_back_safesemStackChecker(void) 134 134 { 135 #if 0 135 136 char volatile *pch; 136 137 unsigned u; … … 143 144 "movl %1, -2048(%0)\n\t" 144 145 : "=r" (pch), "=r" (u)); 146 #else 147 register char volatile *pch; 148 register unsigned char u; 149 char volatile szTmp[16]; 150 pch = &szTmp[15]; 151 u = pch[4]; 152 pch[4] = u; 153 u = pch[-1024]; 154 pch[-1024] = u; 155 u = pch[-2048]; 156 pch[-2048] = u; 157 #endif 145 158 return 0; 146 159 } -
trunk/libc/src/kNIX/os2/sharedpm.c
r3860 r3861 68 68 //#define SPM_ASSERT_PTR_NULL(ptr) LIBC_ASSERTM(SPM_VALID_PTR_NULL(ptr), "Invalid pointer %p. expr='%s'\n", (void *)(ptr), #ptr); 69 69 #define SPM_ASSERT_PTR_NULL(ptr) (SPM_VALID_PTR_NULL(ptr) ? (void)0 \ 70 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __ PRETTY_FUNCTION__, __FILE__, __LINE__, #ptr, \70 : __libc_LogAssert(__LIBC_LOG_INSTANCE, __LIBC_LOG_GROUP, __FUNCTION__, __FILE__, __LINE__, #ptr, \ 71 71 "Invalid pointer %p. expr='%s'\n", (void *)(ptr), #ptr)) 72 72 … … 891 891 * Validate input. 892 892 */ 893 if ( uid < 0)893 if ((long)uid < 0) 894 894 LIBCLOG_RETURN_P(-EINVAL); 895 895 … … 4074 4074 do { if (fVerbose) LIBCLOG_REL(__VA_ARGS__); } while (0) 4075 4075 #define CHECK_FAILED(...) \ 4076 do { CHECK_LOG(__VA_ARGS__); if (fBreakpoint) __ asm__ __volatile__("int3\n"); cErrors++; } while (0)4076 do { CHECK_LOG(__VA_ARGS__); if (fBreakpoint) __KLIBC_BREAKPOINT(); cErrors++; } while (0) 4077 4077 #define CHECK_PTR(ptr, msg) \ 4078 4078 do { if (!SPM_VALID_PTR(ptr)) { CHECK_FAILED("Invalid pointer %p (%s). %s\n", (void *)ptr, #ptr, msg); } } while (0) -
trunk/libc/src/kNIX/os2/signals.c
r3860 r3861 647 647 unsigned __libc_back_signalSemIsOwner(void) 648 648 { 649 FS_VAR() 649 FS_VAR(); 650 650 PTIB pTib; 651 651 PPIB pPib; … … 1892 1892 /* release, switch and call. */ 1893 1893 __libc_back_signalSemRelease(); 1894 #ifdef __WATCOMC__ 1895 extern void signalDeliverOtherStack(uintptr_t *pStack, __siginfohandler_t *pfnSigAction); 1896 # pragma aux signalDeliverOtherStack = \ 1897 "mov [eax + 12], esp" \ 1898 "mov esp, eax" \ 1899 "call dword ptr edx" \ 1900 "mov esp, [esp + 12]" \ 1901 parm [eax] [edx] modify [eax ecx eax] 1902 #elif defined(_MSC_VER) 1903 __asm { 1904 mov eax, [pStack] 1905 lea ecx, [eax + 12] 1906 mov edx, [SigAction.__sigaction_u.__sa_sigaction] 1907 mov [ecx], esp 1908 mov esp, eax 1909 call edx 1910 mov esp, [esp + 12] 1911 }; 1912 #else 1894 1913 __asm__ __volatile__ ( 1895 1914 "mov %%esp, %0\n\t" … … 1901 1920 "d" (SigAction.__sigaction_u.__sa_sigaction) 1902 1921 : "eax" ); 1922 #endif 1903 1923 1904 1924 /* Restore tib and release the stack. */ … … 2000 2020 __libc_Back_panic(__LIBC_PANIC_SIGNAL | __LIBC_PANIC_NO_SPM_TERM, pCtx, "Killed by unknown signal %d\n", iSignalNo); 2001 2021 LIBCLOG_MSG("panic failed\n"); /* shuts up gcc */ 2002 asm("int3");2022 __KLIBC_BREAKPOINT(); 2003 2023 } 2004 2024 -
trunk/libc/src/kNIX/os2/sysv_sem.c
r2929 r3861 162 162 * semaphore info struct 163 163 */ 164 st atic struct seminfo seminfo = {164 struct seminfo seminfo = { 165 165 SEMMAP, /* # of entries in semaphore map */ 166 166 SEMMNI, /* # of semaphore identifiers */ -
trunk/libc/src/kNIX/os2/tcpipver.c
r3804 r3861 1345 1345 #undef __LIBC_LOG_GROUP 1346 1346 #define __LIBC_LOG_GROUP __LIBC_LOG_GRP_INITTERM 1347 _CRT_INIT1(tcpipInit)1348 1347 1349 1348 /** … … 1359 1358 LIBCLOG_RETURN_VOID(); 1360 1359 } 1360 _CRT_INIT1(tcpipInit); 1361 1361 1362 1362 -
trunk/libc/src/kNIX/os2/timebomb.c
r3804 r3861 29 29 30 30 #ifdef TIMEBOMB 31 _CRT_INIT1(__libc_Timebomb) 31 _CRT_INIT1(__libc_Timebomb); 32 32 #endif 33 33 -
trunk/libc/src/libc/app/stdio.c
r3804 r3861 163 163 } 164 164 165 _CRT_INIT1(_init_streams) 166 _CRT_EXIT1(_exit_streams) 165 _CRT_INIT1(_init_streams); 166 _CRT_EXIT1(_exit_streams); 167 167 168 168 -
trunk/libc/src/libc/io/_tmp.c
r3804 r3861 22 22 23 23 24 _CRT_INIT1(_init1_tmp) 24 _CRT_INIT1(_init1_tmp); 25 25 26 26 /** Initialize the semaphore -- this function will be called by
Note:
See TracChangeset
for help on using the changeset viewer.