Changeset 38
- Timestamp:
- Jun 21, 2010, 9:13:56 PM (15 years ago)
- Location:
- trunk/openjdk/jdk/src/windows/hpi/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/openjdk/jdk/src/windows/hpi/src/sys_api_md.c
r2 r38 32 32 #include <limits.h> 33 33 34 #ifdef __EMX__ 35 36 #ifdef __WIN32OS2__ 37 #include <os2wrap2.h> 38 #endif 39 #include <windows.h> 40 #include <wincon.h> 41 42 #define _stati64 stat 43 #define _fstati64 fstat 44 #define _lseeki64 lseek 45 46 #endif /* EMX */ 47 34 48 #include "hpi_impl.h" 35 49 … … 97 111 * 98 112 */ 113 #ifdef __WIN32OS2__ 114 os2_AVAILDATA avail = { 0, 0 }; 115 os2_ULONG pipeState; 116 os2_APIRET arc = DosPeekNPipe(0, NULL, 0, NULL, &avail, &pipeState); 117 // note that even if ERROR_INVALID_PARAMETER, it seems to return the 118 // correct values in avail and state (undocumented) 119 if (arc != NO_ERROR && arc != ERROR_INVALID_PARAMETER) { 120 *pbytes = avail.cbpipe; 121 return TRUE; 122 } 123 124 return FALSE; 125 #else 99 126 HANDLE han; 100 127 … … 116 143 } 117 144 return TRUE; 145 #endif 118 146 } 119 147 … … 183 211 int 184 212 sysSync(int fd) { 213 #ifdef __EMX__ 214 return fsync(fd); 215 #else /* __EMX__ */ 185 216 /* 186 217 * From the documentation: … … 208 239 } 209 240 return 0; 241 #endif /* __EMX__ */ 210 242 } 211 243 … … 213 245 int 214 246 sysSetLength(int fd, jlong length) { 247 #ifdef __EMX__ 248 return ftruncate(fd, length); 249 #else /* __EMX__ */ 215 250 HANDLE h = (HANDLE)_get_osfhandle(fd); 216 251 long high = (long)(length >> 32); … … 224 259 if (SetEndOfFile(h) == FALSE) return -1; 225 260 return 0; 261 #endif /* __EMX__ */ 226 262 } 227 263 … … 236 272 (*size) = buf64.st_size; 237 273 274 #ifndef __EMX__ 238 275 if (*size & 0xFFFFFFFF00000000) { 239 276 /* … … 266 303 267 304 } 305 #endif /* !__EMX__ */ 268 306 return 0; 269 307 } -
trunk/openjdk/jdk/src/windows/hpi/src/system_md.c
r2 r38 29 29 #include <time.h> /* For _tzset() and _ftime() */ 30 30 #include <errno.h> 31 32 #ifdef __EMX__ 33 #include <io.h> 34 #include <memory.h> 35 #endif /* __EMX__ */ 31 36 32 37 #include "hpi_impl.h" … … 109 114 * to, but by doing this here we ensure other dll's don't override. 110 115 */ 116 #ifdef __EMX__ 117 _control87(MCW_EM | RC_NEAR | PC_53, MCW_EM | MCW_RC | MCW_PC); 118 #else 111 119 _control87(_MCW_EM | _RC_NEAR | _PC_53, _MCW_EM | _MCW_RC | _MCW_PC); 120 #endif /* __EMX__ */ 112 121 113 122 InitializeMem(); -
trunk/openjdk/jdk/src/windows/hpi/src/threads_md.c
r2 r38 68 68 #ifndef _WIN64 69 69 PNT_TIB nt_tib; 70 #ifdef __EMX__ 71 asm("movl %%fs:0x18, %%eax\n\t" 72 "mov %%eax, %0\n\t" 73 : "=m" (nt_tib) : : "%eax"); 74 #else /* __EMX__ */ 70 75 __asm { 71 76 mov eax, dword ptr fs:[18h]; 72 77 mov nt_tib, eax; 73 78 } 79 #endif /* __EMX__ */ 74 80 tid->nt_tib = nt_tib; 75 81 #else … … 216 222 } 217 223 224 #ifdef __EMX__ 225 asm("mov %%ss, %%ax\n\t" 226 "mov %%ax, %0\n\t" 227 : "=m" (__current_SS) : : "%ax"); 228 #else /* __EMX__ */ 218 229 __asm { 219 230 mov ax, ss; 220 231 mov __current_SS, ax; 221 232 } 233 #endif /* __EMX__ */ 222 234 223 235 if (context.SegSs == __current_SS && … … 317 329 tid->start_proc(tid->start_parm); 318 330 sysThreadFree(); 331 #ifdef __EMX__ 332 // @todo probably need to cause some per-thread LIBC termination routine 333 ExitThread(0); 334 #else /* __EMX__ */ 319 335 _endthreadex(0); 336 #endif /* __EMX__ */ 320 337 /* not reached */ 321 338 return 0; … … 342 359 * Start the new thread. 343 360 */ 361 #ifdef __EMX__ 362 // @todo probably need to cause some per-thread LIBC initialization routine 363 tid->handle = CreateThread(NULL, stack_size, (LPTHREAD_START_ROUTINE)_start, 364 tid, CREATE_SUSPENDED, (LPDWORD)&tid->id); 365 366 #else /* __EMX__ */ 344 367 tid->handle = (HANDLE)_beginthreadex(NULL, stack_size, _start, tid, 345 368 CREATE_SUSPENDED, &tid->id); 369 #endif /* __EMX__ */ 346 370 if (tid->handle == 0) { 347 371 return SYS_NORESOURCE; /* Will be treated as though SYS_NOMEM */
Note:
See TracChangeset
for help on using the changeset viewer.