### -*-Midas-*-
###
-### $Id: i386.m4,v 1.58 2002/07/02 18:13:28 cph Exp $
+### $Id: i386.m4,v 1.59 2002/08/21 02:21:56 cph Exp $
###
### Copyright (c) 1992-2002 Massachusetts Institute of Technology
###
### what you're doing.
### DISABLE_387
### If defined, do not generate 387 floating-point instructions.
+### VALGRIND_MODE
+### If defined, modify code to make it work with valgrind.
\f
#### Utility macros and definitions
IF387(`
# OP(mov,l) TW(REG(cr0),REG(ecx)) # Test for 387 presence
+ifdef(`VALGRIND_MODE',`',`
smsw REG(cx)
OP(mov,l) TW(IMM(HEX(12)),REG(edx))
OP(and,l) TW(REG(edx),REG(ecx))
OP(cmp,l) TW(REG(edx),REG(ecx))
jne i386_initialize_no_fp
+')
OP(inc,l) REG(eax) # 387 available
OP(sub,l) TW(IMM(4),REG(esp))
fclex
dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
dnl 02111-1307, USA.
-AC_REVISION([$Id: configure.in,v 11.16 2002/03/15 04:07:43 cph Exp $])
+AC_REVISION([$Id: configure.in,v 11.17 2002/08/21 02:21:06 cph Exp $])
AC_INIT(boot.c)
AC_CONFIG_HEADER(config.h)
[ --enable-static-libs Link some libraries statically [no]])
AC_ARG_ENABLE(dynamic-crypto,
[ --enable-dynamic-crypto Link crypto primitives dynamically [yes]])
+AC_ARG_ENABLE(valgrind-mode,
+[ --enable-valgrind-mode Support running under valgrind [no]])
AC_ARG_WITH(openssl,
[ --with-openssl Use the OpenSSL crypto library if available [yes]])
AC_ARG_WITH(mhash,
STATIC_LIBS="${STATIC_LIBS}${QUASI_STATIC_LIBS}"
fi
+if test "${enable_valgrind_mode:-no}" != "no"; then
+ SCHEME_DEFS="${SCHEME_DEFS} -DVALGRIND_MODE"
+ M4_FLAGS="${M4_FLAGS} -P VALGRIND_MODE,1"
+fi
+
dnl Add support for X if present.
if test "${no_x}" = "yes"; then
LIB_X11=
/* -*-C-*-
-$Id: ux.c,v 1.20 2000/12/05 21:23:48 cph Exp $
+$Id: ux.c,v 1.21 2002/08/21 02:21:35 cph Exp $
-Copyright (c) 1990-2000 Massachusetts Institute of Technology
+Copyright (c) 1990-2002 Massachusetts Institute of Technology
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
-Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
+USA.
*/
#include "ux.h"
{
unsigned long ps = (getpagesize ());
void * addr
- = (mmap (((void *) ps),
+ = (mmap (((void *)
+#ifndef VALGRIND_MODE
+ ps
+#else
+ 0x10000
+#endif
+ ),
(((requested_length + (ps - 1)) / ps) * ps),
(PROT_EXEC | PROT_READ | PROT_WRITE),
(MAP_PRIVATE | MAP_ANONYMOUS | MAP_FIXED),