1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-04-30 11:50:28 +02:00
guile/qt/md/i386.h
Stefan Jahn 8f99e3f38b 2001-11-04 Stefan Jahn <stefan@lkcc.org>
* NEWS: Corrected remarks about SCM_API.

        * configure.in: Defining USE_DLL_IMPORT definition to indicate
        usage of DLL import macros in `libguile/__scm.h'.
        (LIBOBJS): Removed `fileblocks.o' from the list of object files.
        Somehow Jim Blandy's patch from 1997 did not survive.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * configure.in (EXTRA_DEFS): Follow-up patch.  Using SCM_IMPORT
        instead of __SCM_IMPORT__.

        * readline.c (scm_readline_init_ports): Disable input/output
        stream redirection for Win32.  The readline package for Win32
        does not support this.  The guile-readline library works fine
        for command line editing.

        * readline.h (SCM_RL_API): Renamed __FOO__ macros into FOO.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * Makefile.am (libguile_la_LIBADD): Added $(THREAD_LIBS_LOCAL)
        here (was at guile_LDADD) which describes the dependency
        correctly and allows a clean build on Win32.

        * __scm.h (SCM_API): Follow-up patch.  Renamed __FOO__ macros
        into FOO.

        * __scm.h: USE_DLL_IMPORT indicates the usage of the DLL
        import macros for external libraries (libcrypt, libqthreads,
        libreadline and libregex).

        * coop-defs.h: Include <winsock2.h> for `struct timeval'.

        * posix.c (flock): Added support for flock() in M$-Windows.

        * guile.c (SCM_IMPORT): Follow-up patch.  Use SCM_IMPORT instead
        of __SCM_IMPORT__.

        * fports.c (getflags): Differentiate reading and writing pipes
        descriptors.

        * filesys.c (S_IS*): Redefine all of the S_IS*() macros for
        M$-Windows.

        * coop.c (coop_condition_variable_timed_wait_mutex): Use
        conditionalized error code if `ETIMEDOUT' is not available.
        (scm_thread_usleep): Remove bogus declaration of `struct timeval
        timeout'.

        * numbers.c (PTRDIFF_MIN): Moved this definition where it actually
        belongs.  That is because NO_PREPRO_MAGIC gets undefined after
        each inclusion of `num2integral.i.c'.
        (SIZE_MAX): Define NO_PREPRO_MAGIC if SIZE_MAX is undefined.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * md/Makefile.am (EXTRA_DIST): Added `i386.asm'.

        * md/i386.asm: New file.  Contains the Intel syntax version for
        nasm/tasm/masm of the file `i386.s'.

        * qt.h.in: Definition of QT_API, QT_IMPORT and QT_EXPORT.
        Prefixed each symbols which is meant to go into a DLL.

        * Makefile.am (libqthreads_la_LDFLAGS):  Put `-no-undefined'
        into LDFLAGS to support linkers which do not allow unresolved
        symbols inside shared libraries.
        (EXTRA_DIST): Add `libqthreads.def', which is an export file
        definition for M$-Windows.  It defines exported symbols.  This is
        necessary because the M$VC linker does not know how to export
        assembler symbols into a DLL.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * srfi-13.h, srfi-14.h, srfi-4.h: Follow-up patch.  Renamed
        __FOO__ macros into FOO.

2001-11-04  Stefan Jahn  <stefan@lkcc.org>

        * tests/ports.test: Run (close-port) before (delete-file) if
        necessary/advisory.
2001-11-04 15:52:30 +00:00

120 lines
2.7 KiB
C

/*
* QuickThreads -- Threads-building toolkit.
* Copyright (c) 1993 by David Keppel
*
* Permission to use, copy, modify and distribute this software and
* its documentation for any purpose and without fee is hereby
* granted, provided that the above copyright notice and this notice
* appear in all copies. This software is provided as a
* proof-of-concept and for demonstration purposes; there is no
* representation about the suitability of this software for any
* purpose.
*/
#ifndef QT_386_H
#define QT_386_H
typedef unsigned long qt_word_t;
/* Thread's initial stack layout on the i386:
non-varargs:
+---
| arg[2] === `userf' on startup
| arg[1] === `pt' on startup
| arg[0] === `pu' on startup
+---
| ret pc === qt_error
+---
| ret pc === `only' on startup
+---
| %ebp
| %esi
| %edi
| %ebx <--- qt_t.sp
+---
When a non-varargs thread is started, it ``returns'' directly to
the client's `only' function.
varargs:
+---
| arg[n-1]
| ..
| arg[0]
+---
| ret pc === `qt_vstart'
+---
| %ebp === `startup'
| %esi === `cleanup'
| %edi === `pt'
| %ebx === `vuserf' <--- qt_t.sp
+---
When a varargs thread is started, it ``returns'' to the `qt_vstart'
startup code. The startup code calls the appropriate functions. */
/* What to do to start a varargs thread running. */
QT_API void qt_vstart (void);
/* Hold 4 saved regs plus two return pcs (qt_error, qt_start) plus
three args. */
#define QT_STKBASE (9 * 4)
/* Hold 4 saved regs plus one return pc (qt_vstart). */
#define QT_VSTKBASE (5 * 4)
/* Stack must be 4-byte aligned. */
#define QT_STKALIGN (4)
/* Where to place various arguments. */
#define QT_ONLY_INDEX (QT_PC)
#define QT_USER_INDEX (QT_ARG2)
#define QT_ARGT_INDEX (QT_ARG1)
#define QT_ARGU_INDEX (QT_ARG0)
#define QT_VSTARTUP_INDEX (QT_EBP)
#define QT_VUSERF_INDEX (QT_EBX)
#define QT_VCLEANUP_INDEX (QT_ESI)
#define QT_VARGT_INDEX (QT_EDI)
#define QT_EBX 0
#define QT_EDI 1
#define QT_ESI 2
#define QT_EBP 3
#define QT_PC 4
/* The following are defined only for non-varargs. */
#define QT_RPC 5
#define QT_ARG0 6
#define QT_ARG1 7
#define QT_ARG2 8
/* Stack grows down. The top of the stack is the first thing to
pop off (preincrement, postdecrement). */
#define QT_GROW_DOWN
QT_API void qt_error (void);
/* Push on the error return address. */
#define QT_ARGS_MD(sto) \
(QT_SPUT (sto, QT_RPC, qt_error))
/* When varargs are pushed, allocate space for all the args. */
#define QT_VARGS_MD0(sto, nbytes) \
((qt_t *)(((char *)(sto)) - QT_STKROUNDUP(nbytes)))
#define QT_VARGS_MD1(sto) \
(QT_SPUT (sto, QT_PC, qt_vstart))
#define QT_VARGS_DEFAULT
#endif /* QT_386_H */