Changeset 10030


Ignore:
Timestamp:
Jul 15, 2008, 1:15:30 PM (11 years ago)
Author:
gb
Message:

Solaris-isms. Can (sort of) load a Linux image (skipping over the
platform check in the image loader), run a little bit of lisp code
and handle some faults before getting into shared-lib reinitialization
code (which needs to be re-worked for Solaris.)

UnProtectMemory?(): Solaris kludges are just that. Something else is
going on here, and whatever it is likely has a better solution. (For
the time being, use mprotect() to make a single page writable, else
use mmap(). Some calls to mprotect on multiple pages claim that pages
in the range aren't mapped, which doesn't sound right.)

Note that dlsym() and friends will need different (from Linux) pseudo-handle
constants.

Location:
trunk/source/lisp-kernel
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/memory.c

    r10022 r10030  
    9191{
    9292#ifdef SOLARIS
    93   return addr == mmap(addr,nbytes,PROT_READ|PROT_WRITE|PROT_EXEC,
    94                       MAP_PRIVATE | MAP_FIXED | MAP_ANON,-1,0);
    95 #else
     93  if (nbytes > page_size) {
     94    return addr != mmap(addr,nbytes,PROT_READ|PROT_WRITE|PROT_EXEC,
     95                        MAP_PRIVATE | MAP_FIXED | MAP_ANON,-1,0);
     96  }
     97#endif
    9698  return mprotect(addr, nbytes, PROT_READ|PROT_WRITE|PROT_EXEC);
    97 #endif
     99
    98100}
    99101
  • trunk/source/lisp-kernel/pmcl-kernel.c

    r10010 r10030  
    351351#endif
    352352#ifdef SOLARIS
    353 #define MAXIMUM_MAPPABLE_MEMORY (1024L<<30L)
     353#define MAXIMUM_MAPPABLE_MEMORY (128L<<30L)
    354354#endif
    355355#ifdef LINUX
     
    681681  fixed_map_ok = true;
    682682#endif
    683   raise_limit();
     683  raise_limit();                /* From Andi Kleen: observe rlimits */
    684684  start = mmap((void *)want,
    685685               totalsize + heap_segment_size,
     
    19591959xFindSymbol(void* handle, char *name)
    19601960{
    1961 #if defined(LINUX) || defined(FREEBSD)
     1961#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS)
    19621962  return dlsym(handle, name);
    19631963#endif
     
    19881988get_r_debug()
    19891989{
    1990 #if defined(LINUX) || defined(FREEBSD)
     1990#if defined(LINUX) || defined(FREEBSD) || defined(SOLARIS)
    19911991#if WORD_SIZE == 64
    19921992  extern Elf64_Dyn _DYNAMIC[];
  • trunk/source/lisp-kernel/x86-exceptions.h

    r10025 r10030  
    148148#ifdef SOLARIS
    149149#define SIGNUM_FOR_INTN_TRAP SIGSEGV
    150 #define IS_MAYBE_INT_TRAP(info,xp) (((info->si_code) &0x7f) == 0)
    151 #define SIGRETURN(context)
     150#define IS_MAYBE_INT_TRAP(info,xp) (((info)->si_code) == SEGV_MAPERR)
     151#define SIGRETURN(context) setcontext(context)
    152152#endif
    153153
Note: See TracChangeset for help on using the changeset viewer.