Changeset 12990
- Timestamp:
- Oct 10, 2009, 7:40:11 AM (15 years ago)
- Location:
- branches/working-0711/ccl/lisp-kernel
- Files:
-
- 11 edited
-
lisp-debug.c (modified) (7 diffs)
-
lisp.h (modified) (1 diff)
-
m4macros.m4 (modified) (1 diff)
-
pmcl-kernel.c (modified) (6 diffs)
-
thread_manager.c (modified) (2 diffs)
-
x86-asmutils64.s (modified) (2 diffs)
-
x86-constants.s (modified) (1 diff)
-
x86-constants64.s (modified) (1 diff)
-
x86-exceptions.c (modified) (3 diffs)
-
x86-spentry64.s (modified) (17 diffs)
-
x86-subprims64.s (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/working-0711/ccl/lisp-kernel/lisp-debug.c
r12198 r12990 28 28 #include <stdio.h> 29 29 30 #ifndef WINDOWS 30 #ifdef WINDOWS 31 #include <fcntl.h> 32 #else 31 33 #include <sys/socket.h> 32 34 #include <dlfcn.h> … … 51 53 if (f) { 52 54 if (setvbuf(f, NULL, _IONBF, 0) == 0) { 55 #ifdef WINDOWS 56 if (fileno(stdin) < 0) { 57 stdin->_file = 0; 58 } 59 #endif 53 60 dbgout = f; 54 61 return true; … … 100 107 (fd0stat.st_dev == devnullstat.st_dev)); 101 108 } 102 103 #endif 109 #endif 110 111 #ifdef WINDOWS 112 Boolean 113 stdin_is_dev_null() 114 { 115 HANDLE stdIn; 116 stdIn = GetStdHandle(STD_INPUT_HANDLE); 117 return (stdIn == NULL); 118 } 119 #endif 120 121 122 104 123 105 124 char * … … 145 164 switch(c) { 146 165 case '\n': 166 continue; 167 case '\r': 147 168 continue; 148 169 case EOF: … … 694 715 { 695 716 717 696 718 #ifdef PPC 697 719 #ifdef PPC64 … … 1120 1142 debug_command_return state = debug_continue; 1121 1143 1144 1145 if (stdin_is_dev_null()) { 1146 return -1; 1147 } 1148 1122 1149 va_start(args,message); 1123 1150 vfprintf(dbgout, message, args); 1124 1151 fprintf(dbgout, "\n"); 1125 1152 va_end(args); 1126 1127 1128 #ifndef WINDOWS 1129 if (stdin_is_dev_null()) { 1130 return -1; 1131 } 1132 #endif 1153 1133 1154 if (threads_initialized) { 1134 1155 suspend_other_threads(false); … … 1175 1196 fprintf(dbgout, "[%d] Clozure CL kernel debugger: ", main_thread_pid); 1176 1197 #endif 1198 fflush(dbgout); /* dbgout should be unbuffered, so this shouldn't be necessary. But it can't hurt ... */ 1177 1199 state = apply_debug_command(xp, readc(), info, why); 1178 1200 } -
branches/working-0711/ccl/lisp-kernel/lisp.h
r12198 r12990 34 34 35 35 extern Boolean use_mach_exception_handling; 36 #ifdef DARWIN37 extern Boolean running_under_rosetta;38 #endif39 36 40 37 extern int page_size, log2_page_size; -
branches/working-0711/ccl/lisp-kernel/m4macros.m4
r11412 r12990 331 331 equate_if_defined([DARWIN_GS_HACK]) 332 332 333 equate_if_defined([TCR_IN_GPR]) 334 333 335 /* Well, so much for that. Maybe this will go away soon ? */ 334 336 equate_if_defined([WIN32_ES_HACK]) -
branches/working-0711/ccl/lisp-kernel/pmcl-kernel.c
r12989 r12990 90 90 #include <mach/port.h> 91 91 #include <sys/sysctl.h> 92 93 Boolean running_under_rosetta = false;94 95 92 #include <dlfcn.h> 96 93 #endif … … 1014 1011 1015 1012 #ifdef WINDOWS 1013 wchar_t * 1014 determine_executable_name() 1015 { 1016 DWORD nsize = 512, result; 1017 wchar_t *buf = malloc(nsize*sizeof(wchar_t)); 1018 1019 do { 1020 result = GetModuleFileNameW(NULL, buf, nsize); 1021 if (result == nsize) { 1022 nsize *= 2; 1023 buf = realloc(buf,nsize*sizeof(wchar_t)); 1024 } else { 1025 return buf; 1026 } 1027 } while (1); 1028 } 1029 1030 1016 1031 wchar_t * 1017 1032 ensure_real_path(wchar_t *path) … … 1457 1472 exit(1); 1458 1473 } 1459 #ifdef PPC1460 #ifdef DARWIN1461 {1462 char *hosttype = getenv("HOSTTYPE");1463 if (hosttype && !strncmp("intel", hosttype, 5)) {1464 running_under_rosetta = true;1465 use_mach_exception_handling = false;1466 reserved_area_size = 1U << 30;1467 }1468 }1469 #endif1470 #endif1471 1474 #endif 1472 1475 } … … 1690 1693 check_os_version(argv[0]); 1691 1694 #ifdef WINDOWS 1692 real_executable_name = utf_16_argv[0];1695 real_executable_name = determine_executable_name(); 1693 1696 #else 1694 1697 real_executable_name = determine_executable_name(argv[0]); … … 1951 1954 xMakeDataExecutable(void *start, unsigned long nbytes) 1952 1955 { 1956 #ifndef X86 1953 1957 extern void flush_cache_lines(); 1954 1958 natural ustart = (natural) start, base, end; … … 1956 1960 base = (ustart) & ~(cache_block_size-1); 1957 1961 end = (ustart + nbytes + cache_block_size - 1) & ~(cache_block_size-1); 1958 #ifdef DARWIN1959 if (running_under_rosetta) {1960 /* We probably need to flush something's cache even if running1961 under Rosetta, but (a) this is agonizingly slow and (b) we're1962 dying before we get to the point where this would matter.1963 */1964 return;1965 }1966 #endif1967 #ifndef X861968 1962 flush_cache_lines(base, (end-base)/cache_block_size, cache_block_size); 1969 1963 #endif -
branches/working-0711/ccl/lisp-kernel/thread_manager.c
r12799 r12990 2046 2046 } 2047 2047 } 2048 #if 0 2048 2049 } else { 2049 2050 if (tcr->valence == TCR_STATE_EXCEPTION_RETURN) { … … 2055 2056 tcr->valence = TCR_STATE_LISP; 2056 2057 } 2058 #endif 2057 2059 } 2058 2060 tcr->suspend_context = pcontext; -
branches/working-0711/ccl/lisp-kernel/x86-asmutils64.s
r12198 r12990 171 171 _endfn 172 172 173 _exportfn(C(put_vector_registers)) 174 _endfn 175 173 176 __ifdef([DARWIN]) 174 177 _exportfn(C(darwin_sigreturn)) … … 185 188 __endif 186 189 187 _exportfn(C(put_vector_registers))188 _endfn189 190 190 191 -
branches/working-0711/ccl/lisp-kernel/x86-constants.s
r12198 r12990 69 69 70 70 _struct(lisp_globals,lisp_globals_limit-(num_lisp_globals*node_size)) 71 _node(initial_tcr) /* initial thread tcr */72 _node(image_name) /* --image-name argument */73 _node(BADfpscr_save_high) /* high word of FP reg used to save FPSCR */71 _node(initial_tcr) /* initial thread tcr */ 72 _node(image_name) /* --image-name argument */ 73 _node(BADfpscr_save_high) /* high word of FP reg used to save FPSCR */ 74 74 _node(unwind_resume) /* _Unwind_Resume */ 75 _node(batch_flag) /* -b */75 _node(batch_flag) /* -b */ 76 76 _node(host_platform) /* for runtime platform-specific stuff */ 77 77 _node(argv) /* address of argv[0] */ -
branches/working-0711/ccl/lisp-kernel/x86-constants64.s
r11164 r12990 222 222 223 223 224 ifdef([ WINDOWS],[224 ifdef([TCR_IN_GPR],[ 225 225 /* We keep the TCR pointer in r11 */ 226 226 define([rcontext_reg], r11) -
branches/working-0711/ccl/lisp-kernel/x86-exceptions.c
r12988 r12990 2259 2259 #ifdef X8664 2260 2260 opcode load_allocptr_reg_from_tcr_save_allocptr_instruction[] = 2261 #ifdef WINDOWS2261 #ifdef TCR_IN_GPR 2262 2262 {0x49,0x8b,0x9b,0xd8,0x00,0x00,0x00} 2263 2263 #else … … 2266 2266 ; 2267 2267 opcode compare_allocptr_reg_to_tcr_save_allocbase_instruction[] = 2268 #ifdef WINDOWS2268 #ifdef TCR_IN_GPR 2269 2269 {0x49,0x3b,0x9b,0xe0,0x00,0x00,0x00} 2270 2270 #else … … 2278 2278 {0xcd,0xc5}; 2279 2279 opcode clear_tcr_save_allocptr_tag_instruction[] = 2280 #ifdef WINDOWS2280 #ifdef TCR_IN_GPR 2281 2281 {0x41,0x80,0xa3,0xd8,0x00,0x00,0x00,0xf0} 2282 2282 #else -
branches/working-0711/ccl/lisp-kernel/x86-spentry64.s
r12198 r12990 1234 1234 __(movq catch_frame._save1(%temp0),%save1) 1235 1235 __(movq catch_frame._save2(%temp0),%save2) 1236 __ifndef([ WINDOWS])1236 __ifndef([TCR_IN_GPR]) 1237 1237 __(movq catch_frame._save3(%temp0),%save3) 1238 1238 __endif … … 1280 1280 __(movq catch_frame._save1(%temp0),%save1) 1281 1281 __(movq catch_frame._save2(%temp0),%save2) 1282 __ifndef([ WINDOWS])1282 __ifndef([TCR_IN_GPR]) 1283 1283 __(movq catch_frame._save3(%temp0),%save3) 1284 1284 __endif … … 1337 1337 __(movq %save2,%rsp) 1338 1338 __(movq catch_frame.rbp(%temp0),%rbp) 1339 __ifndef([ WINDOWS])1339 __ifndef([TCR_IN_GPR]) 1340 1340 __(movq catch_frame._save3(%temp0),%save3) 1341 1341 __endif … … 1359 1359 __(push catch_frame._save1(%temp0)) 1360 1360 __(push catch_frame._save2(%temp0)) 1361 __ifndef([ WINDOWS])1361 __ifndef([TCR_IN_GPR]) 1362 1362 __(push catch_frame._save3(%temp0)) 1363 1363 __endif … … 1391 1391 __(jns local_label(_nthrowv_tpushloop)) 1392 1392 __(pop %xfn) 1393 __ifndef([ WINDOWS])1393 __ifndef([TCR_IN_GPR]) 1394 1394 __(pop %save3) 1395 1395 __endif … … 1469 1469 __(movq catch_frame.rsp(%temp0),%rsp) 1470 1470 __(movq catch_frame.rbp(%temp0),%rbp) 1471 __ifndef([ WINDOWS])1471 __ifndef([TCR_IN_GPR]) 1472 1472 __(movq catch_frame._save3(%temp0),%save3) 1473 1473 __endif … … 1493 1493 __(movq catch_frame._save1(%temp0),%save1) 1494 1494 __(movq catch_frame._save2(%temp0),%save2) 1495 __ifndef([ WINDOWS])1495 __ifndef([TCR_IN_GPR]) 1496 1496 __(movq catch_frame._save3(%temp0),%save3) 1497 1497 __endif … … 4016 4016 __(movq %csave2,%imm0) 4017 4017 __endif 4018 __ifdef([ WINDOWS])4018 __ifdef([TCR_IN_GPR]) 4019 4019 /* Preserve TCR pointer */ 4020 4020 __(movq %rcontext_reg, %csave0) … … 4054 4054 __(movq %csave2,%rdx) 4055 4055 __endif 4056 __ifdef([ WINDOWS])4056 __ifdef([TCR_IN_GPR]) 4057 4057 __(movq %csave0, %rcontext_reg) 4058 4058 __endif 4059 4059 __(movq %rsp,rcontext(tcr.foreign_sp)) 4060 __ifndef([ WINDOWS])4060 __ifndef([TCR_IN_GPR]) 4061 4061 __(clr %save3) 4062 4062 __endif … … 4236 4236 __(movq %csave3,%imm1) 4237 4237 __endif 4238 __ifdef([ WINDOWS])4238 __ifdef([TCR_IN_GPR]) 4239 4239 /* Preserve TCR pointer */ 4240 4240 __(movq %rcontext_reg, %csave1) … … 4274 4274 __(movsd 24(%csave0),%xmm1) 4275 4275 __endif 4276 __ifdef([ WINDOWS])4276 __ifdef([TCR_IN_GPR]) 4277 4277 __(movq %csave1, %rcontext_reg) 4278 4278 __endif 4279 4279 __(movq %rsp,rcontext(tcr.foreign_sp)) 4280 __ifndef([ WINDOWS])4280 __ifndef([TCR_IN_GPR]) 4281 4281 __(clr %save3) 4282 4282 __endif … … 4427 4427 __(movq (%rsp),%rbp) 4428 4428 __(addq $2*node_size,%rsp) 4429 __ifdef([TCR_IN_GPR]) 4430 __(movq %rcontext_reg,%csave0) 4431 __endif 4429 4432 __ifdef([WINDOWS]) 4430 __(movq %rcontext_reg,%csave0)4431 4433 __(pop %carg0) 4432 4434 __(pop %carg1) … … 4451 4453 __endif 4452 4454 __endif 4453 __ifdef([ WINDOWS])4455 __ifdef([TCR_IN_GPR]) 4454 4456 __(movq %csave0,%rcontext_reg) 4455 4457 __endif 4456 4458 __(movq %rbp,%rsp) 4457 4459 __(movq %rsp,rcontext(tcr.foreign_sp)) 4458 __ifndef([ WINDOWS])4460 __ifndef([TCR_IN_GPR]) 4459 4461 __(clr %save3) 4460 4462 __endif … … 4610 4612 __ifdef([HAVE_TLS]) 4611 4613 /* TCR initialized for lisp ? */ 4612 __ifndef([ WINDOWS]) /* FIXME */4614 __ifndef([TCR_IN_GPR]) /* FIXME */ 4613 4615 __(movq %fs:current_tcr@TPOFF+tcr.linear,%rax) 4614 4616 __(testq %rax,%rax) … … 4624 4626 __ifdef([WINDOWS]) 4625 4627 __(add $0x20, %rsp) 4628 __endif 4629 __ifdef([TCR_IN_GPR]) 4626 4630 __(movq %rax, %rcontext_reg) 4627 4631 __endif … … 4637 4641 __(movq %csave0,%rax) 4638 4642 __(movq %rsp,rcontext(tcr.foreign_sp)) 4639 __ifndef([ WINDOWS])4643 __ifndef([TCR_IN_GPR]) 4640 4644 __(clr %save3) 4641 4645 __endif … … 4659 4663 __(movq 8(%rsp),%save1) 4660 4664 __(movq 16(%rsp),%save2) 4661 __ifndef([ WINDOWS])4665 __ifndef([TCR_IN_GPR]) 4662 4666 __(movq 24(%rsp),%save3) 4663 4667 __endif -
branches/working-0711/ccl/lisp-kernel/x86-subprims64.s
r10944 r12990 97 97 __(push %csave5) 98 98 __(push %csave6) 99 __endif 100 __ifdef([TCR_IN_GPR]) 99 101 __(movq %carg0,%rcontext_reg) 100 102 __endif … … 115 117 __(clr %save1) 116 118 __(clr %save2) 117 __ifndef([ WINDOWS]) /* no %save3, r11 is %rcontext_reg */119 __ifndef([TCR_IN_GPR]) /* no %save3, r11 is %rcontext_reg */ 118 120 __(clr %save3) 119 121 __endif
Note:
See TracChangeset
for help on using the changeset viewer.
