Ignore:
Timestamp:
Oct 10, 2009, 2:40:11 PM (11 years ago)
Author:
gz
Message:

more windows/mac changes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/working-0711/ccl/lisp-kernel/pmcl-kernel.c

    r12989 r12990  
    9090#include <mach/port.h>
    9191#include <sys/sysctl.h>
    92 
    93 Boolean running_under_rosetta = false;
    94 
    9592#include <dlfcn.h>
    9693#endif
     
    10141011
    10151012#ifdef WINDOWS
     1013wchar_t *
     1014determine_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
    10161031wchar_t *
    10171032ensure_real_path(wchar_t *path)
     
    14571472    exit(1);
    14581473  }
    1459 #ifdef PPC
    1460 #ifdef DARWIN
    1461   {
    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 #endif
    1470 #endif
    14711474#endif
    14721475}
     
    16901693  check_os_version(argv[0]);
    16911694#ifdef WINDOWS
    1692   real_executable_name = utf_16_argv[0];
     1695  real_executable_name = determine_executable_name();
    16931696#else
    16941697  real_executable_name = determine_executable_name(argv[0]);
     
    19511954xMakeDataExecutable(void *start, unsigned long nbytes)
    19521955{
     1956#ifndef X86
    19531957  extern void flush_cache_lines();
    19541958  natural ustart = (natural) start, base, end;
     
    19561960  base = (ustart) & ~(cache_block_size-1);
    19571961  end = (ustart + nbytes + cache_block_size - 1) & ~(cache_block_size-1);
    1958 #ifdef DARWIN
    1959   if (running_under_rosetta) {
    1960     /* We probably need to flush something's cache even if running
    1961        under Rosetta, but (a) this is agonizingly slow and (b) we're
    1962        dying before we get to the point where this would matter.
    1963     */
    1964     return;
    1965   }
    1966 #endif
    1967 #ifndef X86
    19681962  flush_cache_lines(base, (end-base)/cache_block_size, cache_block_size);
    19691963#endif
Note: See TracChangeset for help on using the changeset viewer.