Ignore:
Timestamp:
Feb 21, 2008, 4:22:15 PM (12 years ago)
Author:
andreas
Message:

Big #ifdef WINDOWS hack&slash: stub out every function that references
things unimplemented on Windows. This is mainly exception (a.k.a.
signal handling) stuff, pthread-related things and memory management.

Using this code, and the compiler from:


http://downloads.sourceforge.net/mingw-w64/mingw-w64-bin_x86_64-linux_20080203.tar.bz2?modtime=1202034209&big_mirror=0

I am able to cross-compile a Win64 executable from my Ubuntu. Of
course, it crashes pretty soon, but this was to be expected.

File:
1 edited

Legend:

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

    r8540 r8547  
    441441                  natural arg1, natural arg2, natural arg3, natural arg4, natural arg5)
    442442{
    443   sigset_t mask;
    444443  natural  callback_ptr, i;
    445444  int delta;
     
    627626}
    628627
     628#ifdef WINDOWS
     629Boolean
     630handle_fault(TCR *tcr, ExceptionInformation *xp, siginfo_t *info, int old_valence)
     631{
     632}
     633
     634Boolean
     635handle_floating_point_exception(TCR *tcr, ExceptionInformation *xp, siginfo_t *info)
     636{
     637}
     638#else
    629639Boolean
    630640handle_fault(TCR *tcr, ExceptionInformation *xp, siginfo_t *info, int old_valence)
     
    689699  }
    690700}
     701#endif
    691702
    692703Boolean
     
    791802}
    792803
     804#ifdef WINDOWS
     805Boolean
     806handle_exception(int signum, siginfo_t *info, ExceptionInformation  *context, TCR *tcr, int old_valence)
     807{
     808}
     809#else
    793810Boolean
    794811handle_exception(int signum, siginfo_t *info, ExceptionInformation  *context, TCR *tcr, int old_valence)
     
    913930  }
    914931}
    915 
     932#endif
    916933
    917934/*
     
    966983   that the thread sees it as soon as it's able to run.
    967984*/
     985#ifdef WINDOWS
     986void
     987raise_pending_interrupt(TCR *tcr)
     988{
     989}
     990void
     991exit_signal_handler(TCR *tcr, int old_valence)
     992{
     993}
     994void
     995signal_handler(int signum, siginfo_t *info, ExceptionInformation  *context, TCR *tcr, int old_valence)
     996{
     997}
     998#else
    968999void
    9691000raise_pending_interrupt(TCR *tcr)
     
    10291060#endif
    10301061}
     1062#endif
    10311063
    10321064#ifdef DARWIN
     
    10911123#endif
    10921124
     1125#ifdef WINDOWS
     1126LispObj *
     1127copy_ucontext(ExceptionInformation *context, LispObj *current, copy_ucontext_last_arg_t fp)
     1128{
     1129}
     1130#else
    10931131LispObj *
    10941132copy_ucontext(ExceptionInformation *context, LispObj *current, copy_ucontext_last_arg_t fp)
     
    11091147  return (LispObj *)dest;
    11101148}
     1149#endif
    11111150
    11121151LispObj *
     
    12401279}
    12411280
     1281#ifdef WINDOWS
     1282void
     1283interrupt_handler (int signum, siginfo_t *info, ExceptionInformation *context)
     1284{
     1285}
     1286#else
    12421287void
    12431288interrupt_handler (int signum, siginfo_t *info, ExceptionInformation *context)
     
    13101355  SIGRETURN(context);
    13111356}
     1357#endif
    13121358
    13131359#ifndef USE_SIGALTSTACK
     
    13641410#endif
    13651411
    1366 
     1412#ifdef WINDOWS
     1413void
     1414install_signal_handler(int signo, void * handler)
     1415{
     1416}
     1417#else
    13671418void
    13681419install_signal_handler(int signo, void * handler)
     
    13891440  sigaction(signo, &sa, NULL);
    13901441}
    1391 
    1392 
     1442#endif
     1443
     1444#ifdef WINDOWS
     1445void
     1446install_pmcl_exception_handlers()
     1447{
     1448}
     1449#else
    13931450void
    13941451install_pmcl_exception_handlers()
     
    14271484  signal(SIGPIPE, SIG_IGN);
    14281485}
     1486#endif
    14291487
    14301488#ifndef USE_SIGALTSTACK
     
    14861544#endif
    14871545
     1546#ifdef WINDOWS
     1547void
     1548quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     1549{
     1550}
     1551#else
    14881552void
    14891553quit_handler(int signum, siginfo_t *info, ExceptionInformation *xp)
     
    15181582  pthread_exit(NULL);
    15191583}
     1584#endif
    15201585
    15211586#ifndef USE_SIGALTSTACK
     
    15831648#endif
    15841649
     1650#ifdef WINDOWS
     1651void
     1652thread_signal_setup()
     1653{
     1654}
     1655#else
    15851656void
    15861657thread_signal_setup()
     
    15911662  install_signal_handler(SIGQUIT, (void *)QUIT_HANDLER);
    15921663}
    1593 
     1664#endif
    15941665
    15951666void
     
    17101781}
    17111782     
    1712  
     1783#ifdef WINDOWS 
     1784void
     1785pc_luser_xp(ExceptionInformation *xp, TCR *tcr, signed_natural *interrupt_displacement)
     1786{
     1787}
     1788#else
    17131789void
    17141790pc_luser_xp(ExceptionInformation *xp, TCR *tcr, signed_natural *interrupt_displacement)
     
    18731949  }
    18741950}
     1951#endif
    18751952
    18761953void
Note: See TracChangeset for help on using the changeset viewer.