Changeset 3880
- Timestamp:
- Jun 27, 2014, 6:01:08 PM (11 years ago)
- Location:
- trunk/libc
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/libc/include/emx/startup.h
r3861 r3880 68 68 # define _CRT_EXIT1(fun) void * __based(__segname("crtexit1")) __crtexit1__##fun##__ = (void *)fun 69 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 70 # define _CRT_INIT1(fun) \ 71 __Pragma(section("crtinit1", read)); \ 72 __declspec(allocate("crtinit1")) void * __crtinit1__##fun##__ = (void *)fun 73 # define _CRT_EXIT1(fun) \ 74 __Pragma(section("crtexit1", read)); \ 75 __declspec(allocate("crtexit1")) void * __crtexit1__##fun##__ = (void *)fun 72 76 # else 73 77 # define _CRT_INIT1(fun) void *__crtinit1__##fun##__ __attribute__((__section__("crtinit1"))) = (void *)fun -
trunk/libc/include/sys/sysctl.h
r3802 r3880 214 214 __libc_sysctl_##parent##_##name##_children 215 215 216 #undef DATA_SET 217 #define DATA_SET(set, data) __asm__ (".stabs \"___libc_" #set "__\", 25, 0, 0, _" #data) 216 #undef SYSCTL_DATA_SET 217 #ifdef __OS2__ 218 # ifdef __WATCOMC__ 219 # define SYSCTL_DATA_SET(data) void * __based(__segname("SET2___libc_sysctl_set__")) __libc_sysctl_##data##__ = (void *)&data 220 # else 221 # define SYSCTL_DATA_SET(data) __asm__ (".stabs \"___libc_sysctl_set__\", 25, 0, 0, _" #data) 222 # endif 223 224 #elif defined(__NT__) || defined(__WIN32__) || defined(__WIN64__) 225 # if defined(__WATCOMC__) 226 # define SYSCTL_DATA_SET(data) void * __based(__segname("sysctl")) __libc_sysctl_##data##__ = (void *)&data 227 # elif defined(_MSC_VER) 228 # define SYSCTL_DATA_SET(data) \ 229 __Pragma(section("sysctl", read)); \ 230 __declspec(allocate("sysctl")) void * __libc_sysctl_##data##__ = (void *)&data 231 # else 232 # error "port me" 233 # define SYSCTL_DATA_SET(data) __asm__ (".stabs \"___libc_sysctl_set__\", 25, 0, 0, _" #data) 234 # endif 235 #endif 218 236 219 237 #if __GNUC_PREREQ__(4,2) … … 228 246 &__libc_sysctl_##parent##_children, { &__libc_sysctl__##parent##_##name }, \ 229 247 nbr, kind, a1, a2, #name, handler, fmt, 0, descr }; \ 230 DATA_SET(sysctl_set,__libc_sysctl__##parent##_##name)248 SYSCTL_DATA_SET(__libc_sysctl__##parent##_##name) 231 249 232 250 -
trunk/libc/include/unidef.h
r3870 r3880 372 372 __END_DECLS 373 373 374 #endif /* __UNIDEF_H__ */374 #endif /* !__UNIDEF_H__ */ -
trunk/libc/src/libc/misc/Makefile.kmk
r3879 r3880 147 147 $(PATH_LIBC_SRC)/libc/misc/_uflags.c \ 148 148 149 ifndef CFG_LIBC_USE_WATCOM ## port me 149 150 libc_libc_misc_SOURCES.x86 = \ 150 151 $(PATH_LIBC_SRC)/libc/misc/386/div.s \ … … 152 153 $(PATH_LIBC_SRC)/libc/misc/386/setjmp.s \ 153 154 $(PATH_LIBC_SRC)/libc/misc/386/sigsetjm.s \ 154 $(PATH_LIBC_SRC)/libc/misc/386/uldiv.s \ 155 $(PATH_LIBC_SRC)/libc/misc/386/uldiv.s 156 endif 155 157 156 158 libc_libc_misc_SOURCES.os2 = \ -
trunk/libc/src/libc/misc/abort.c
r3879 r3880 17 17 18 18 if (getenv("LIBC_BREAKPOINT_ABORT")) 19 __ asm__ __volatile__("int $3");19 __KLIBC_BREAKPOINT(); 20 20 21 21 … … 62 62 exit(3); 63 63 } 64 -
trunk/libc/src/libc/misc/bsearch.c
r3879 r3880 10 10 const void *element; 11 11 12 if (width <= 0)12 if (width == 0) 13 13 return NULL; 14 14 left = 1; right = num; -
trunk/libc/src/libc/misc/sysctl_mib.c
r3879 r3880 56 56 #undef security 57 57 58 #ifdef __OS2__ 58 59 /* start the set. */ 60 # ifndef __WATCOMC__ 59 61 asm (".stabs \"___libc_sysctl_set__\", 21, 0, 0, 0xffffffff\n"); 60 #ifdef __OS2__ 62 # endif 63 61 64 /* hack to drag in sysctl_os2.c */ 65 extern struct sysctl_oid_list SYSCTL_NODE_CHILDREN(,os2); 66 # ifdef __WATCOMC__ 67 # pragma extref __libc_sysctl__os2_children; 68 # else 62 69 asm (".stabs \"___libc_sysctl__os2_children\",1,0,0,0\n"); /* (extrn) */ 70 # endif 63 71 #endif 64 72 -
trunk/libc/src/libc/misc/sysctl_os2.c
r3879 r3880 62 62 * stable number. 63 63 */ 64 unsignedcWraps = 0;64 int cWraps = 0; 65 65 union 66 66 { … … 141 141 char szModel[17]; 142 142 uint32_t uRegs[4]; 143 } u; 144 if (!u.szModel[0]) 145 { 143 } s_u; 144 if (!s_u.szModel[0]) 145 { 146 /** @todo check if the CPU support CPUID. */ 147 #ifdef __WATCOMC__ 148 extern void getmodel(uint32_t *paValues); 149 # pragma aux getmodel = \ 150 "xor eax, eax" \ 151 "xor ecx, ecx" \ 152 "cpuid" \ 153 "mov [esi + 0], ebx" \ 154 "mov [esi + 4], edx" \ 155 "mov [esi + 8], ecx" \ 156 parm [esi] modify exact [eax ebx ecx edx] 157 getmodel(s_u.uRegs); 158 #else 146 159 int i; 147 160 asm ("cpuid\n" 148 161 : "=a" (i), 149 "=b" ( u.uRegs[0]),150 "=c" ( u.uRegs[2]),151 "=d" ( u.uRegs[1])162 "=b" (s_u.uRegs[0]), 163 "=c" (s_u.uRegs[2]), 164 "=d" (s_u.uRegs[1]) 152 165 : "a" (0) 153 166 ); 167 #endif 154 168 } 155 169 156 return (sysctl_handle_string(oidp, u.szModel, sizeof(u.szModel), req));170 return (sysctl_handle_string(oidp, s_u.szModel, sizeof(s_u.szModel), req)); 157 171 } 158 172
Note:
See TracChangeset
for help on using the changeset viewer.