aboutsummaryrefslogtreecommitdiffstats
path: root/mps/code
diff options
context:
space:
mode:
authorDavid Jones2005-02-16 12:30:11 +0000
committerDavid Jones2005-02-16 12:30:11 +0000
commit84501bf9fab90688a80ee40c7f009844972393a1 (patch)
tree2cf00142a51d6b46bcff8b21ad8b564370202f6f /mps/code
parent8a262a53812c97b591fb4596c2a710e12a734c57 (diff)
parent48b285a322b42b053197e09c14cb410f772221a0 (diff)
downloademacs-84501bf9fab90688a80ee40c7f009844972393a1.tar.gz
emacs-84501bf9fab90688a80ee40c7f009844972393a1.zip
Mps: merging branch/2004-12-15/dll
p4 integ -n -r -b mps/branch/2004-12-15/dll Copied from Perforce Change: 144824 ServerID: perforce.ravenbrook.com
Diffstat (limited to 'mps/code')
-rw-r--r--mps/code/comm.gmk71
-rw-r--r--mps/code/commpost.nmk20
-rw-r--r--mps/code/commpre.nmk8
-rw-r--r--mps/code/config.h13
-rwxr-xr-xmps/code/expgen.sh155
-rw-r--r--mps/code/libcbt.c69
-rw-r--r--mps/code/mps.h3
-rw-r--r--mps/code/mpsi.c6
-rw-r--r--mps/code/mpslibcb.c343
-rw-r--r--mps/code/mpslibcb.h58
-rwxr-xr-xmps/code/w3build.bat22
-rw-r--r--mps/code/w3gen.def141
-rw-r--r--mps/code/w3i3mv.nmk5
-rw-r--r--mps/code/xcppgc.gmk2
14 files changed, 867 insertions, 49 deletions
diff --git a/mps/code/comm.gmk b/mps/code/comm.gmk
index b9057e678dc..13e313fc16e 100644
--- a/mps/code/comm.gmk
+++ b/mps/code/comm.gmk
@@ -268,7 +268,7 @@ all: mpmss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
268 mpsicv lockcov poolncv locv qs apss \ 268 mpsicv lockcov poolncv locv qs apss \
269 finalcv finaltest arenacv bttest teletest \ 269 finalcv finaltest arenacv bttest teletest \
270 abqtest cbstest btcv mv2test messtest steptest \ 270 abqtest cbstest btcv mv2test messtest steptest \
271 eventcnv walkt0 \ 271 eventcnv walkt0 libcbt \
272 mps.a 272 mps.a
273 273
274swall: mmsw.a replaysw 274swall: mmsw.a replaysw
@@ -293,6 +293,7 @@ mpmss sacss amcss amcssth amcsshe amsss amssshe segsmss awlut awlutth \
293 awluthe mpsicv lockcov poolncv locv qs apss \ 293 awluthe mpsicv lockcov poolncv locv qs apss \
294 finalcv finaltest arenacv bttest teletest \ 294 finalcv finaltest arenacv bttest teletest \
295 expt825 \ 295 expt825 \
296 libcbt \
296 abqtest cbstest btcv mv2test \ 297 abqtest cbstest btcv mv2test \
297 messtest steptest \ 298 messtest steptest \
298 walkt0 \ 299 walkt0 \
@@ -349,98 +350,103 @@ endif
349ifdef VARIETY 350ifdef VARIETY
350 351
351$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \ 352$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \
352 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 353 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
353 354
354$(PFM)/$(VARIETY)/finaltest: $(PFM)/$(VARIETY)/finaltest.o \ 355$(PFM)/$(VARIETY)/finaltest: $(PFM)/$(VARIETY)/finaltest.o \
355 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 356 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
356 357
357$(PFM)/$(VARIETY)/expt825: $(PFM)/$(VARIETY)/expt825.o \ 358$(PFM)/$(VARIETY)/expt825: $(PFM)/$(VARIETY)/expt825.o \
358 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 359 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
360
361$(PFM)/$(VARIETY)/libcbt: $(PFM)/$(VARIETY)/libcbt.o \
362 $(PFM)/$(VARIETY)/mpslibcb.o \
363 $(PFM)/$(VARIETY)/mpsioan.o \
364 $(MPMOBJ) $(TESTLIBOBJ)
359 365
360$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \ 366$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \
361 $(MPMOBJ) $(LOOBJ) $(TESTLIBOBJ) 367 $(MPMOBJ) $(PLINTHOBJ) $(LOOBJ) $(TESTLIBOBJ)
362 368
363$(PFM)/$(VARIETY)/mpmss: $(PFM)/$(VARIETY)/mpmss.o \ 369$(PFM)/$(VARIETY)/mpmss: $(PFM)/$(VARIETY)/mpmss.o \
364 $(MPMOBJ) $(MVFFOBJ) $(TESTLIBOBJ) 370 $(MPMOBJ) $(PLINTHOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
365 371
366$(PFM)/$(VARIETY)/apss: $(PFM)/$(VARIETY)/apss.o \ 372$(PFM)/$(VARIETY)/apss: $(PFM)/$(VARIETY)/apss.o \
367 $(MPMOBJ) $(MVFFOBJ) $(TESTLIBOBJ) 373 $(MPMOBJ) $(PLINTHOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
368 374
369$(PFM)/$(VARIETY)/sacss: $(PFM)/$(VARIETY)/sacss.o \ 375$(PFM)/$(VARIETY)/sacss: $(PFM)/$(VARIETY)/sacss.o \
370 $(MPMOBJ) $(MVFFOBJ) $(TESTLIBOBJ) 376 $(MPMOBJ) $(PLINTHOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
371 377
372$(PFM)/$(VARIETY)/bttest: $(PFM)/$(VARIETY)/bttest.o \ 378$(PFM)/$(VARIETY)/bttest: $(PFM)/$(VARIETY)/bttest.o \
373 $(MPMOBJ) $(TESTLIBOBJ) 379 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
374 380
375$(PFM)/$(VARIETY)/teletest: $(PFM)/$(VARIETY)/teletest.o \ 381$(PFM)/$(VARIETY)/teletest: $(PFM)/$(VARIETY)/teletest.o \
376 $(MPMOBJ) $(TESTLIBOBJ) 382 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
377 383
378$(PFM)/$(VARIETY)/lockcov: $(PFM)/$(VARIETY)/lockcov.o \ 384$(PFM)/$(VARIETY)/lockcov: $(PFM)/$(VARIETY)/lockcov.o \
379 $(MPMOBJ) $(TESTLIBOBJ) 385 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
380 386
381$(PFM)/$(VARIETY)/mpsicv: $(PFM)/$(VARIETY)/mpsicv.o \ 387$(PFM)/$(VARIETY)/mpsicv: $(PFM)/$(VARIETY)/mpsicv.o \
382 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 388 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
383 389
384$(PFM)/$(VARIETY)/amcss: $(PFM)/$(VARIETY)/amcss.o \ 390$(PFM)/$(VARIETY)/amcss: $(PFM)/$(VARIETY)/amcss.o \
385 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 391 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
386 392
387$(PFM)/$(VARIETY)/amcssth: $(PFM)/$(VARIETY)/amcssth.o \ 393$(PFM)/$(VARIETY)/amcssth: $(PFM)/$(VARIETY)/amcssth.o \
388 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 394 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
389 395
390$(PFM)/$(VARIETY)/amcsshe: $(PFM)/$(VARIETY)/amcsshe.o \ 396$(PFM)/$(VARIETY)/amcsshe: $(PFM)/$(VARIETY)/amcsshe.o \
391 $(FMTHETSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 397 $(FMTHETSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
392 398
393$(PFM)/$(VARIETY)/amsss: $(PFM)/$(VARIETY)/amsss.o \ 399$(PFM)/$(VARIETY)/amsss: $(PFM)/$(VARIETY)/amsss.o \
394 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMSOBJ) $(TESTLIBOBJ) 400 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMSOBJ) $(TESTLIBOBJ)
395 401
396$(PFM)/$(VARIETY)/amssshe: $(PFM)/$(VARIETY)/amssshe.o \ 402$(PFM)/$(VARIETY)/amssshe: $(PFM)/$(VARIETY)/amssshe.o \
397 $(FMTHETSTOBJ) $(MPMOBJ) $(AMSOBJ) $(TESTLIBOBJ) 403 $(FMTHETSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMSOBJ) $(TESTLIBOBJ)
398 404
399$(PFM)/$(VARIETY)/segsmss: $(PFM)/$(VARIETY)/segsmss.o \ 405$(PFM)/$(VARIETY)/segsmss: $(PFM)/$(VARIETY)/segsmss.o \
400 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMSOBJ) $(TESTLIBOBJ) 406 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMSOBJ) $(TESTLIBOBJ)
401 407
402$(PFM)/$(VARIETY)/awlut: $(PFM)/$(VARIETY)/awlut.o \ 408$(PFM)/$(VARIETY)/awlut: $(PFM)/$(VARIETY)/awlut.o \
403 $(FMTDYTSTOBJ) $(MPMOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ) 409 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ)
404 410
405$(PFM)/$(VARIETY)/awluthe: $(PFM)/$(VARIETY)/awluthe.o \ 411$(PFM)/$(VARIETY)/awluthe: $(PFM)/$(VARIETY)/awluthe.o \
406 $(FMTHETSTOBJ) $(MPMOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ) 412 $(FMTHETSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ)
407 413
408$(PFM)/$(VARIETY)/awlutth: $(PFM)/$(VARIETY)/awlutth.o \ 414$(PFM)/$(VARIETY)/awlutth: $(PFM)/$(VARIETY)/awlutth.o \
409 $(FMTDYTSTOBJ) $(MPMOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ) 415 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(LOOBJ) $(AWLOBJ) $(TESTLIBOBJ)
410 416
411$(PFM)/$(VARIETY)/poolncv: $(PFM)/$(VARIETY)/poolncv.o \ 417$(PFM)/$(VARIETY)/poolncv: $(PFM)/$(VARIETY)/poolncv.o \
412 $(MPMOBJ) $(TESTLIBOBJ) $(POOLNOBJ) 418 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ) $(POOLNOBJ)
413 419
414$(PFM)/$(VARIETY)/qs: $(PFM)/$(VARIETY)/qs.o \ 420$(PFM)/$(VARIETY)/qs: $(PFM)/$(VARIETY)/qs.o \
415 $(AMCOBJ) $(MPMOBJ) $(TESTLIBOBJ) 421 $(AMCOBJ) $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
416 422
417$(PFM)/$(VARIETY)/arenacv: $(PFM)/$(VARIETY)/arenacv.o \ 423$(PFM)/$(VARIETY)/arenacv: $(PFM)/$(VARIETY)/arenacv.o \
418 $(MPMOBJ) $(TESTLIBOBJ) 424 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
419 425
420$(PFM)/$(VARIETY)/abqtest: $(PFM)/$(VARIETY)/abqtest.o \ 426$(PFM)/$(VARIETY)/abqtest: $(PFM)/$(VARIETY)/abqtest.o \
421 $(PFM)/$(VARIETY)/abq.o $(MPMOBJ) $(TESTLIBOBJ) 427 $(PFM)/$(VARIETY)/abq.o $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
422 428
423$(PFM)/$(VARIETY)/cbstest: $(PFM)/$(VARIETY)/cbstest.o \ 429$(PFM)/$(VARIETY)/cbstest: $(PFM)/$(VARIETY)/cbstest.o \
424 $(MPMOBJ) $(TESTLIBOBJ) 430 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
425 431
426$(PFM)/$(VARIETY)/btcv: $(PFM)/$(VARIETY)/btcv.o \ 432$(PFM)/$(VARIETY)/btcv: $(PFM)/$(VARIETY)/btcv.o \
427 $(MPMOBJ) $(TESTLIBOBJ) 433 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
428 434
429$(PFM)/$(VARIETY)/mv2test: $(PFM)/$(VARIETY)/mv2test.o \ 435$(PFM)/$(VARIETY)/mv2test: $(PFM)/$(VARIETY)/mv2test.o \
430 $(PFM)/$(VARIETY)/poolmv2.o $(PFM)/$(VARIETY)/abq.o \ 436 $(PFM)/$(VARIETY)/poolmv2.o $(PFM)/$(VARIETY)/abq.o \
431 $(MPMOBJ) $(TESTLIBOBJ) 437 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
432 438
433$(PFM)/$(VARIETY)/messtest: $(PFM)/$(VARIETY)/messtest.o \ 439$(PFM)/$(VARIETY)/messtest: $(PFM)/$(VARIETY)/messtest.o \
434 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ) 440 $(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
435 441
436$(PFM)/$(VARIETY)/steptest: $(PFM)/$(VARIETY)/steptest.o \ 442$(PFM)/$(VARIETY)/steptest: $(PFM)/$(VARIETY)/steptest.o \
437 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 443 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
438 444
439$(PFM)/$(VARIETY)/walkt0: $(PFM)/$(VARIETY)/walkt0.o \ 445$(PFM)/$(VARIETY)/walkt0: $(PFM)/$(VARIETY)/walkt0.o \
440 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 446 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
441 447
442$(PFM)/$(VARIETY)/exposet0: $(PFM)/$(VARIETY)/exposet0.o \ 448$(PFM)/$(VARIETY)/exposet0: $(PFM)/$(VARIETY)/exposet0.o \
443 $(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ) 449 $(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
444 450
445$(PFM)/$(VARIETY)/eventcnv: $(PFM)/$(VARIETY)/eventcnv.o \ 451$(PFM)/$(VARIETY)/eventcnv: $(PFM)/$(VARIETY)/eventcnv.o \
446 $(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o 452 $(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o
@@ -448,7 +454,8 @@ $(PFM)/$(VARIETY)/eventcnv: $(PFM)/$(VARIETY)/eventcnv.o \
448$(PFM)/$(VARIETY)/replay: $(PFM)/$(VARIETY)/replay.o \ 454$(PFM)/$(VARIETY)/replay: $(PFM)/$(VARIETY)/replay.o \
449 $(PFM)/$(VARIETY)/eventrep.o \ 455 $(PFM)/$(VARIETY)/eventrep.o \
450 $(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o \ 456 $(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o \
451 $(MPMOBJ) $(AWLOBJ) $(AMSOBJ) $(POOLNOBJ) $(AMCOBJ) $(SNCOBJ) $(MVFFOBJ) 457 $(MPMOBJ) $(PLINTHOBJ) $(AWLOBJ) $(AMSOBJ) $(POOLNOBJ) \
458 $(AMCOBJ) $(SNCOBJ) $(MVFFOBJ)
452 459
453$(PFM)/$(VARIETY)/mps.a: $(MPMOBJ) $(AMCOBJ) $(SNCOBJ) $(MVFFOBJ) 460$(PFM)/$(VARIETY)/mps.a: $(MPMOBJ) $(AMCOBJ) $(SNCOBJ) $(MVFFOBJ)
454 461
diff --git a/mps/code/commpost.nmk b/mps/code/commpost.nmk
index 4025b8bf8e5..a205a1a618c 100644
--- a/mps/code/commpost.nmk
+++ b/mps/code/commpost.nmk
@@ -37,7 +37,8 @@ mpmss.exe amcss.exe amcsshe.exe amsss.exe amssshe.exe segsmss.exe awlut.exe awlu
37 walkt0.exe locbwcss.exe locusss.exe \ 37 walkt0.exe locbwcss.exe locusss.exe \
38 exposet0.exe \ 38 exposet0.exe \
39 replay.exe replaysw.exe eventcnv.exe \ 39 replay.exe replaysw.exe eventcnv.exe \
40 mmdw.lib mmsw.lib mps.lib mpsplan.lib: 40 mmdw.lib mmsw.lib mps.lib mpsplan.lib mpsplcb.lib \
41 mpsdy.dll:
41!IFDEF VARIETY 42!IFDEF VARIETY
42 $(MAKE) /nologo /f $(PFM).nmk TARGET=$@ variety 43 $(MAKE) /nologo /f $(PFM).nmk TARGET=$@ variety
43!ELSE 44!ELSE
@@ -252,10 +253,27 @@ $(PFM)\$(VARIETY)\mps.lib: $(MPMOBJ) $(AMCOBJ) $(LOOBJ) $(SNCOBJ) \
252 $(ECHO) $@ 253 $(ECHO) $@
253 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $** 254 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $**
254 255
256# We would like to use $** in the linker command line here, but we
257# cannot because the target, mpsdy.dll, depends on the w3gen.def file,
258# but this is not to be treated as an object on the linker line. Sorry
259# about the repetition of the object list.
260$(PFM)\$(VARIETY)\mpsdy.dll: $(PFM)\$(VARIETY)\mpslibcb.obj \
261 $(MPMOBJ) $(AMCOBJ) $(LOOBJ) $(SNCOBJ) \
262 $(MVFFOBJ) $(AMSOBJ) $(AWLOBJ) w3gen.def
263 $(ECHO) $@
264 $(LINKER) $(LINKFLAGS) /def:w3gen.def /dll /OUT:$@ \
265 $(PFM)\$(VARIETY)\mpslibcb.obj \
266 $(MPMOBJ) $(AMCOBJ) $(LOOBJ) $(SNCOBJ) \
267 $(MVFFOBJ) $(AMSOBJ) $(AWLOBJ)
268
255$(PFM)\$(VARIETY)\mpsplan.lib: $(PLINTHOBJ) 269$(PFM)\$(VARIETY)\mpsplan.lib: $(PLINTHOBJ)
256 $(ECHO) $@ 270 $(ECHO) $@
257 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $** 271 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $**
258 272
273$(PFM)\$(VARIETY)\mpsplcb.lib: $(PFM)\$(VARIETY)\mpslibcb.obj
274 $(ECHO) $@
275 $(LIBMAN) $(LIBFLAGS) /OUT:$@ $**
276
259!ENDIF 277!ENDIF
260 278
261 279
diff --git a/mps/code/commpre.nmk b/mps/code/commpre.nmk
index 7e6cf8abc3e..c10da3de76d 100644
--- a/mps/code/commpre.nmk
+++ b/mps/code/commpre.nmk
@@ -129,8 +129,14 @@ CFLAGSCOMMONPOST = $(CFLAGSTARGETPOST)
129 129
130# Flags for use in the variety combinations 130# Flags for use in the variety combinations
131CFLAGSHOT = /Ox /DNDEBUG 131CFLAGSHOT = /Ox /DNDEBUG
132# We used to have /GZ here (stack probe).
132# Note that GZ is specific to version 12 of the cl tool. drj 2003-11-04 133# Note that GZ is specific to version 12 of the cl tool. drj 2003-11-04
133CFLAGSCOOL = /Od /GZ 134# It is ignored on earlier versions of the cl tool.
135# /GZ here generates a dependency on the C library and when we are
136# building a DLL, mpsdy.dll, the linker step will fail (error LNK2001:
137# unresolved external symbol __chkesp). See
138# http://support.microsoft.com/kb/q191669/
139CFLAGSCOOL = /Od
134CFLAGSINTERNAL = /Zi 140CFLAGSINTERNAL = /Zi
135CFLAGSEXTERNAL = 141CFLAGSEXTERNAL =
136 142
diff --git a/mps/code/config.h b/mps/code/config.h
index 75ceb2131c0..6c4f8a49e0d 100644
--- a/mps/code/config.h
+++ b/mps/code/config.h
@@ -268,11 +268,6 @@
268#elif defined(CONFIG_PROD_DYLAN) 268#elif defined(CONFIG_PROD_DYLAN)
269#define MPS_PROD_STRING "dylan" 269#define MPS_PROD_STRING "dylan"
270#define MPS_PROD_DYLAN 270#define MPS_PROD_DYLAN
271/* .prod.arena-size: ARENA_SIZE is currently set larger for the
272 * MM/Dylan product as an interim solution.
273 * See request.dylan.170170.sol.patch and change.dylan.buffalo.170170.
274 */
275#define ARENA_SIZE ((Size)1<<30)
276#define ARENA_INIT_SPARE_COMMIT_LIMIT ((Size)10uL*1024uL*1024uL) 271#define ARENA_INIT_SPARE_COMMIT_LIMIT ((Size)10uL*1024uL*1024uL)
277#define THREAD_MULTI 272#define THREAD_MULTI
278#define PROTECTION 273#define PROTECTION
@@ -292,6 +287,14 @@
292#error "No target product configured." 287#error "No target product configured."
293#endif 288#endif
294 289
290/* .prod.arena-size: ARENA_SIZE is currently set larger for the
291 * MM/Dylan product as an interim solution.
292 * See request.dylan.170170.sol.patch and change.dylan.buffalo.170170.
293 * Note that this define is only used by the implementation of the
294 * deprecated mps_space_create interface.
295 */
296#define ARENA_SIZE ((Size)1<<30)
297
295/* if CHECK_DEFAULT hasn't been defined already (e.g. by a variety, or 298/* if CHECK_DEFAULT hasn't been defined already (e.g. by a variety, or
296 * in a makefile), take the value from the product. */ 299 * in a makefile), take the value from the product. */
297 300
diff --git a/mps/code/expgen.sh b/mps/code/expgen.sh
new file mode 100755
index 00000000000..69e790aeb15
--- /dev/null
+++ b/mps/code/expgen.sh
@@ -0,0 +1,155 @@
1#!/bin/sh
2# $Header$
3#
4# Copyright (C) 2004 Ravenbrook Limited. All rights reserved.
5#
6# expgen.sh
7#
8# Export Generator
9#
10# This is a script to generate the a list of exports that is required
11# for Windows DLL creation.
12#
13# It processed the mps header files and produces a .DEF file that is
14# suitable for use with the linker when producing a DLL file on Windows.
15#
16# When run, this script produces the following output files:
17# expgen - a plain text list of functions declared in the header files.
18# w3gen.def - a .def file suitable for use in the linker stage when
19# building a Windows .DLL.
20#
21# Procedure for rebuilding a new w3gen.def
22#
23# This procedure should be carried out when the contents of w3gen.def
24# would change. This is a bit tricky to say exactly when, but certainly
25# when:
26# a) new functions are declared in public header files.
27# b) different header files are released to a client.
28#
29# Procedure:
30#
31# 1) Ensure that the sources for w3gen.def are submitted. w3gen.def
32# must be built from versioned sources.
33# The sources are:
34# expgen.sh
35# w3build.bat
36# all the headers that get included.
37# For safety's sake better to ensure that no files are open:
38# p4 opened ...
39# should say '... - file(s) not opened on this client.'
40#
41# 2) Open w3gen.def for edit (making it writable)
42# p4 open w3gen.def
43#
44# 3) Run this script.
45# sh expgen.sh
46# There should be no output when successful.
47#
48# 4) Eyeball the diff.
49# p4 diff ...
50# Check the that resulting diff is sane. For most changes it should
51# just consist of a new symbol being included (plus some Header related
52# junk).
53#
54# 5) Submit the change.
55# p4 submit ...
56#
57#
58# Design
59#
60# The script works by using the -fdump-translation-unit option of gcc.
61# This produces a more easily parseable rendering of the header files.
62# A fairly simple awk script is used to process the output.
63#
64#
65# Dependencies
66#
67# This script currently depends fairly heavily on being run in a
68# Unix-like environment with access to the GNU compiler.
69#
70# It's also fairly sensitive to changes in the undocumented format
71# produced by gcc -fdump-translation-unit. Hopefully it is fairly easy
72# to adapt to changes in this output.
73#
74# Assumes it can freely write to the files "fun", "name-s".
75#
76#
77# Awk crash course
78#
79# Awk processes files line-by-line, thus the entire script is executed
80# for each line of the input file (more complex awk scripts can control
81# this using "next" and "getline" and so on).
82#
83# In awk $exp identifies a field within the line. $1 is the first
84# field, $2 is the second and so on. $0 is the whole line. By default
85# fields are separated by whitespace.
86#
87# string ~ RE is a matching expression and evaulated to true iff the
88# string is matched by the regular expression.
89#
90# REFERENCES
91#
92# [SUSV3] Single UNIX Specification Version 3,
93# http://www.unix.org/single_unix_specification/
94#
95# For documenation of the standard utilities: sh, awk, join, sort, sed
96#
97# [MSDN-LINKER-DEF] Module-Definition (.def) files,
98# http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore/html/_core_module.2d.definition_files.asp
99#
100# For documentation on the format of .def files.
101
102tu () {
103 # if invoked on a file called spong.h will produce a file named
104 # spong.h.tu
105 gcc -fdump-translation-unit -o /dev/null "$@"
106}
107
108# This list of header files is produced by
109# awk '/^copy.*\.h/{print $2}' w3build.bat
110# followed by manual removal of mpsw3.h mpswin.h (which gcc on UNIX
111# cannot parse). Also removed are mpsio.h mpslib.h as they defined
112# interfaces that mps _uses_ not defines. Also removed is mpscmvff.h as
113# it does not get included in mps.lib
114# The functions declared in mpsw3.h have to be added to the .def file by
115# hand later in this script.
116f='mps.h
117mpsavm.h
118mpsacl.h
119mpscamc.h
120mpscams.h
121mpscawl.h
122mpsclo.h
123mpscmv.h
124mpscsnc.h
125mpslibcb.h
126mpstd.h'
127
128tu $f
129
130>expgen
131
132for a in $f
133do
134 >fun
135 awk '
136 $2=="function_decl" && $7=="srcp:" && $8 ~ /^'$a':/ {print $4 >"fun"}
137 $2=="identifier_node"{print $1,$4}
138 ' $a.tu |
139 sort -k 1 >name-s
140
141 echo ';' $a >>expgen
142 sort -k 1 fun |
143 join -o 2.2 - name-s >>expgen
144done
145
146{
147 printf '; %sHeader%s\n' '$' '$'
148 echo '; DO NOT EDIT. Automatically generated by $Header$' | sed 's/\$/!/g'
149 echo 'EXPORTS'
150 cat expgen
151 # This is where we manually the functions declared in mpsw3.h
152 echo ';' mpsw3.h - by hand
153 echo mps_SEH_filter
154 echo mps_SEH_handler
155} > w3gen.def
diff --git a/mps/code/libcbt.c b/mps/code/libcbt.c
new file mode 100644
index 00000000000..a865795f19c
--- /dev/null
+++ b/mps/code/libcbt.c
@@ -0,0 +1,69 @@
1/* libcbt: MPS LIBRARY CALLBACK TEST
2 *
3 * $Header$
4 * Copyright (C) 2005 Ravenbrook Limited. See end of file for license.
5 *
6 * This is a simple test of the MPS Library Callback interface
7 * (mpslibcb.h). */
8
9#include "mps.h"
10#include "mpsavm.h"
11#include "mpslib.h"
12#include "mpslibcb.h"
13
14#include "testlib.h"
15
16#include <stdio.h>
17#include <stdlib.h>
18
19void libcbt_assert_fail(const char *);
20mps_clock_t libcbt_clock(void);
21
22int main(void)
23{
24 int res;
25 int defects = 0;
26 mps_arena_t arena;
27
28 res = mps_lib_callback_register("not a callback", (void(*)(void))0);
29 if(MPS_RES_OK == res) {
30 printf("mps_lib_callback_register claims to successfully register\n"
31 "an interface that does not exist.\n");
32 ++ defects;
33 }
34 die(mps_lib_callback_register("mps_lib_assert_fail",
35 (void(*)(void))libcbt_assert_fail),
36 "register assert_fail");
37 /* The following functions are registered in the order that you get by
38 * providing no functions and then providing functions as they are
39 * required by assertionn failures.
40 * Interestingly, for this very simple test, only mps_clock is
41 * required. */
42 die(mps_lib_callback_register("mps_clock",
43 (mps_lib_function_t)libcbt_clock),
44 "register clock");
45 die(mps_arena_create(&arena, mps_arena_class_vm(), 1000*1000),
46 "mps_arena_create");
47 if(defects) {
48 printf("Conclusion: Defects detected.\n");
49 } else {
50 printf("Conclusion: Failed to find any defects.\n");
51 }
52 return 0;
53}
54
55void libcbt_assert_fail(const char *message)
56{
57 fflush(stdout);
58 fprintf(stderr, "\nMPS ASSERTION FAILURE (TEST): %s\n", message);
59 fflush(stderr);
60 abort();
61}
62
63mps_clock_t libcbt_clock(void)
64{
65 static mps_clock_t c = 0;
66
67 ++ c;
68 return c;
69}
diff --git a/mps/code/mps.h b/mps/code/mps.h
index 53edb1a9fed..8952ebe1d32 100644
--- a/mps/code/mps.h
+++ b/mps/code/mps.h
@@ -273,7 +273,10 @@ extern mps_bool_t mps_arena_has_addr(mps_arena_t, mps_addr_t);
273 273
274/* Client memory arenas */ 274/* Client memory arenas */
275extern mps_res_t mps_arena_extend(mps_arena_t, mps_addr_t, size_t); 275extern mps_res_t mps_arena_extend(mps_arena_t, mps_addr_t, size_t);
276#if 0
277/* There's no implementation for this function. */
276extern mps_res_t mps_arena_retract(mps_arena_t, mps_addr_t, size_t); 278extern mps_res_t mps_arena_retract(mps_arena_t, mps_addr_t, size_t);
279#endif
277 280
278 281
279/* Object Formats */ 282/* Object Formats */
diff --git a/mps/code/mpsi.c b/mps/code/mpsi.c
index 53fda434dd1..9bf1a478ff4 100644
--- a/mps/code/mpsi.c
+++ b/mps/code/mpsi.c
@@ -443,12 +443,11 @@ mps_res_t mps_arena_create_v(mps_arena_t *mps_arena_o,
443 return MPS_RES_OK; 443 return MPS_RES_OK;
444} 444}
445 445
446#ifdef MPS_PROD_DYLAN 446/* DEPRECATED */
447mps_res_t mps_space_create(mps_space_t *mps_space_o) 447mps_res_t mps_space_create(mps_space_t *mps_space_o)
448{ 448{
449 return mps_arena_create(mps_space_o, mps_arena_class_vm(), ARENA_SIZE); 449 return mps_arena_create(mps_space_o, mps_arena_class_vm(), ARENA_SIZE);
450} 450}
451#endif
452 451
453 452
454/* mps_arena_destroy -- destroy an arena object */ 453/* mps_arena_destroy -- destroy an arena object */
@@ -461,12 +460,11 @@ void mps_arena_destroy(mps_arena_t mps_arena)
461 ArenaDestroy(arena); 460 ArenaDestroy(arena);
462} 461}
463 462
464#ifdef MPS_PROD_DYLAN 463/* DEPRECATED */
465void mps_space_destroy(mps_space_t mps_space) 464void mps_space_destroy(mps_space_t mps_space)
466{ 465{
467 mps_arena_destroy(mps_space); 466 mps_arena_destroy(mps_space);
468} 467}
469#endif
470 468
471 469
472/* mps_arena_has_addr -- is this address managed by this arena? */ 470/* mps_arena_has_addr -- is this address managed by this arena? */
diff --git a/mps/code/mpslibcb.c b/mps/code/mpslibcb.c
new file mode 100644
index 00000000000..41bf5bcb6c7
--- /dev/null
+++ b/mps/code/mpslibcb.c
@@ -0,0 +1,343 @@
1/* mpslibcb.c: RAVENBROOK MEMORY POOL SYSTEM LIBRARY INTERFACE (CALLBACK)
2 *
3 * $Header$
4 * Copyright (c) 2005 Ravenbrook Limited. See end of file for license.
5 *
6 * .purpose: The purpose of this code is
7 * 1. permit the MPS Library Interface to be used conveniently when
8 * the MPS is packaged as a dynamic library (and in particular a
9 * Windows DLL).
10 *
11 * .readership: For MPS client application developers and MPS developers.
12 * .sources: <design/lib/>
13 *
14 * .freestanding: This is designed to be deployed in a freestanding
15 * environment, so we can't use strcmp from <string.h>, so we have to
16 * roll our own (in fact we only ever need equality so we define a
17 * simpler interface).
18 *
19 * .mpm.not: This module occupies a halfway house between the MPM and
20 * the client. Let's make it clearer: this module should not use any
21 * services of the MPM. That is, it should be written as if the client
22 * could have, in principle, written it. .mpm.not.why: Perhaps the most
23 * compelling reason is that if config.h is included (via mpm.h) then
24 * the compile breaks on platform.w3i3mv because of "#define
25 * mps_lib_memset memset" in config.h.
26 */
27
28#include "mpslibcb.h"
29#include "mpslib.h"
30#include "mps.h"
31
32/* Forward declarations. */
33
34int mps_lib_callback_default_get_EOF(void);
35mps_lib_FILE *mps_lib_callback_default_get_stderr(void);
36mps_lib_FILE *mps_lib_callback_default_get_stdout(void);
37int mps_lib_callback_default_fputc(int c_, mps_lib_FILE *f_);
38int mps_lib_callback_default_fputs(const char *s_, mps_lib_FILE *f_);
39void *mps_lib_callback_default_memset(void *p_, int c_, size_t n_);
40void *mps_lib_callback_default_memcpy(void *p_, const void *q_, size_t n_);
41int mps_lib_callback_default_memcmp(const void *p_, const void *q_, size_t n_);
42mps_clock_t mps_lib_callback_default_clock(void);
43mps_clock_t mps_lib_callback_default_clocks_per_sec(void);
44unsigned long mps_lib_callback_default_telemetry_control(void);
45int mps_lib_callback_streq(const char *, const char *);
46
47/* Macros */
48
49/* See .freestanding */
50#define EQ(p, q) (mps_lib_callback_streq((p), (q)))
51/* We use this to call mps_lib_asssert_fail (which we only ever do
52 * unconditionally). See .mpm.not on why we cannot use ASSERT from
53 * mpm.h */
54#define AFAIL mps_lib_assert_fail
55/* Replaced UNUSED from mpm.h, see .mpm.not */
56#define UNUSED(x) ((void)(x))
57
58/* Structures and Types */
59
60struct mps_lib_callback_s
61{
62 int (*lib_get_EOF)(void);
63 mps_lib_FILE * (*lib_get_stderr)(void);
64 mps_lib_FILE * (*lib_get_stdout)(void);
65 int (*lib_fputc)(int, mps_lib_FILE *);
66 int (*lib_fputs)(const char *, mps_lib_FILE *);
67 void (*lib_assert_fail)(const char *);
68 void * (*lib_memset)(void *, int, size_t);
69 void * (*lib_memcpy)(void *, const void *, size_t);
70 int (*lib_memcmp)(const void *, const void *, size_t);
71 mps_clock_t (*clock)(void);
72 mps_clock_t (*clocks_per_sec)(void);
73 unsigned long (*lib_telemetry_control)(void);
74};
75
76/* Globals */
77
78/* .global.why: A global is necessary so that we can store the function
79 * pointers that the client gives us. The functions in the mpslib.h
80 * interface _are_ global. There is no scope for having one memset
81 * function for one Arena and a different memset function for another.
82 * */
83
84/* The default functions are stubs that assert. Except for the
85 * assert_fail function (which is called when assertions fail) which
86 * will be NULL. This means: if you provide assert_fail and forget
87 * something else, you'll know about it. If you do not provide
88 * assert_fail then it will probably stop anyway.
89 *
90 * These functions really do need to fail, so they subvert the checking
91 * mechanism (which is in mpm.h and not available to us, see .mpm.not)
92 */
93
94struct mps_lib_callback_s mps_lib_callback_global = {
95 mps_lib_callback_default_get_EOF,
96 mps_lib_callback_default_get_stderr,
97 mps_lib_callback_default_get_stdout,
98 mps_lib_callback_default_fputc,
99 mps_lib_callback_default_fputs,
100 NULL, /* assert_fail */
101 mps_lib_callback_default_memset,
102 mps_lib_callback_default_memcpy,
103 mps_lib_callback_default_memcmp,
104 mps_lib_callback_default_clock,
105 mps_lib_callback_default_clocks_per_sec,
106 mps_lib_callback_default_telemetry_control
107};
108
109/* Functions */
110
111int mps_lib_callback_register(const char *name, mps_lib_function_t f)
112{
113 if(NULL == name) {
114 return MPS_RES_FAIL;
115 }
116 if(EQ(name, "mps_lib_get_EOF")) {
117 mps_lib_callback_global.lib_get_EOF = (int(*)(void))f;
118 } else if(EQ(name, "mps_lib_get_stderr")) {
119 mps_lib_callback_global.lib_get_stderr = (mps_lib_FILE *(*)(void))f;
120 } else if(EQ(name, "mps_lib_get_stdout")) {
121 mps_lib_callback_global.lib_get_stdout = (mps_lib_FILE *(*)(void))f;
122 } else if(EQ(name, "mps_lib_fputc")) {
123 mps_lib_callback_global.lib_fputc = (int(*)(int, mps_lib_FILE *))f;
124 } else if(EQ(name, "mps_lib_fputs")) {
125 mps_lib_callback_global.lib_fputs =
126 (int(*)(const char *, mps_lib_FILE *))f;
127 } else if(EQ(name, "mps_lib_assert_fail")) {
128 mps_lib_callback_global.lib_assert_fail = (void(*)(const char *))f;
129 } else if(EQ(name, "mps_lib_memset")) {
130 mps_lib_callback_global.lib_memset = (void *(*)(void *, int, size_t))f;
131 } else if(EQ(name, "mps_lib_memcpy")) {
132 mps_lib_callback_global.lib_memcpy =
133 (void *(*)(void *, const void *, size_t))f;
134 } else if(EQ(name, "mps_lib_memcmp")) {
135 mps_lib_callback_global.lib_memcmp =
136 (int(*)(const void *, const void *, size_t))f;
137 } else if(EQ(name, "mps_clock")) {
138 mps_lib_callback_global.clock = (mps_clock_t(*)(void))f;
139 } else if(EQ(name, "mps_clocks_per_sec")) {
140 mps_lib_callback_global.clocks_per_sec = (mps_clock_t(*)(void))f;
141 } else if(EQ(name, "mps_lib_telemetry_control")) {
142 mps_lib_callback_global.lib_telemetry_control =
143 (unsigned long(*)(void))f;
144 } else {
145 return MPS_RES_UNIMPL;
146 }
147 return MPS_RES_OK;
148}
149
150/* Return non-zero if and only if string p equals string q. */
151int mps_lib_callback_streq(const char *p, const char *q)
152{
153 do {
154 if(*p == '\0' && *q == '\0') {
155 return 1;
156 }
157 } while(*p++ == *q++);
158 return 0;
159}
160
161int mps_lib_callback_default_get_EOF(void)
162{
163 AFAIL("mps_lib_get_EOF needs to be provided");
164 return 0;
165}
166
167mps_lib_FILE *mps_lib_callback_default_get_stderr(void)
168{
169 AFAIL("mps_lib_get_stderr needs to be provided");
170 return NULL;
171}
172
173mps_lib_FILE *mps_lib_callback_default_get_stdout(void)
174{
175 AFAIL("mps_lib_get_stdout needs to be provided");
176 return NULL;
177}
178
179int mps_lib_callback_default_fputc(int c_, mps_lib_FILE *f_)
180{
181 UNUSED(c_);
182 UNUSED(f_);
183 AFAIL("mps_lib_fputc needs to be provided");
184 return 0;
185}
186
187int mps_lib_callback_default_fputs(const char *s_, mps_lib_FILE *f_)
188{
189 UNUSED(s_);
190 UNUSED(f_);
191 AFAIL("mps_lib_fputs needs to be provided");
192 return 0;
193}
194
195/* No default implementation for mps_lib_assert_fail */
196
197void *mps_lib_callback_default_memset(void *p_, int c_, size_t n_)
198{
199 UNUSED(p_);
200 UNUSED(c_);
201 UNUSED(n_);
202 AFAIL("mps_lib_memset needs to be provided");
203 return NULL;
204}
205
206void *mps_lib_callback_default_memcpy(void *p_, const void *q_, size_t n_)
207{
208 UNUSED(p_);
209 UNUSED(q_);
210 UNUSED(n_);
211 AFAIL("mps_lib_memcpy needs to be provided");
212 return NULL;
213}
214
215int mps_lib_callback_default_memcmp(const void *p_, const void *q_, size_t n_)
216{
217 UNUSED(p_);
218 UNUSED(q_);
219 UNUSED(n_);
220 AFAIL("mps_lib_memcmp needs to be provided");
221 return 0;
222}
223
224mps_clock_t mps_lib_callback_default_clock(void)
225{
226 AFAIL("mps_clock needs to be provided");
227 return 0;
228}
229
230mps_clock_t mps_lib_callback_default_clocks_per_sec(void)
231{
232 AFAIL("mps_clocks_per_sec needs to be provided");
233 return 0;
234}
235
236unsigned long mps_lib_callback_default_telemetry_control(void)
237{
238 AFAIL("mps_lib_telemetry_control needs to be provided");
239 return 0;
240}
241
242int mps_lib_get_EOF(void)
243{
244 return mps_lib_callback_global.lib_get_EOF();
245}
246
247mps_lib_FILE *mps_lib_get_stderr(void)
248{
249 return mps_lib_callback_global.lib_get_stderr();
250}
251
252mps_lib_FILE *mps_lib_get_stdout(void)
253{
254 return mps_lib_callback_global.lib_get_stdout();
255}
256
257int mps_lib_fputc(int c, mps_lib_FILE *f)
258{
259 return mps_lib_callback_global.lib_fputc(c, f);
260}
261
262int mps_lib_fputs(const char *s, mps_lib_FILE *f)
263{
264 return mps_lib_callback_global.lib_fputs(s, f);
265}
266
267void mps_lib_assert_fail(const char *m)
268{
269 mps_lib_callback_global.lib_assert_fail(m);
270}
271
272void *(mps_lib_memset)(void *p, int c, size_t n)
273{
274 return mps_lib_callback_global.lib_memset(p, c, n);
275}
276
277void *(mps_lib_memcpy)(void *p, const void *q, size_t n)
278{
279 return mps_lib_callback_global.lib_memcpy(p, q, n);
280}
281
282int (mps_lib_memcmp)(const void *p, const void *q, size_t n)
283{
284 return mps_lib_callback_global.lib_memcmp(p, q, n);
285}
286
287mps_clock_t mps_clock(void)
288{
289 return mps_lib_callback_global.clock();
290}
291
292mps_clock_t mps_clocks_per_sec(void)
293{
294 return mps_lib_callback_global.clocks_per_sec();
295}
296
297unsigned long mps_lib_telemetry_control(void)
298{
299 return mps_lib_callback_global.lib_telemetry_control();
300}
301
302
303
304/* C. COPYRIGHT AND LICENSE
305 *
306 * Copyright (C) 2005 Ravenbrook Limited <http://www.ravenbrook.com/>.
307 * All rights reserved. This is an open source license. Contact
308 * Ravenbrook for commercial licensing options.
309 *
310 * Redistribution and use in source and binary forms, with or without
311 * modification, are permitted provided that the following conditions are
312 * met:
313 *
314 * 1. Redistributions of source code must retain the above copyright
315 * notice, this list of conditions and the following disclaimer.
316 *
317 * 2. Redistributions in binary form must reproduce the above copyright
318 * notice, this list of conditions and the following disclaimer in the
319 * documentation and/or other materials provided with the distribution.
320 *
321 * 3. Redistributions in any form must be accompanied by information on how
322 * to obtain complete source code for this software and any accompanying
323 * software that uses this software. The source code must either be
324 * included in the distribution or be available for no more than the cost
325 * of distribution plus a nominal fee, and must be freely redistributable
326 * under reasonable conditions. For an executable file, complete source
327 * code means the source code for all modules it contains. It does not
328 * include source code for modules or files that typically accompany the
329 * major components of the operating system on which the executable file
330 * runs.
331 *
332 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
333 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
334 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
335 * PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
336 * COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
337 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
338 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
339 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
340 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
341 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
342 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
343 */
diff --git a/mps/code/mpslibcb.h b/mps/code/mpslibcb.h
new file mode 100644
index 00000000000..140448e2482
--- /dev/null
+++ b/mps/code/mpslibcb.h
@@ -0,0 +1,58 @@
1/* mpslibcb.h: RAVENBROOK MEMORY POOL SYSTEM LIBRARY CALLBACK INTERFACE
2 *
3 * $Header$
4 * Copyright (c) 2005 Ravenbrook Limited. See end of file for license.
5 *
6 * .readership: MPS client application developers, MPS developers.
7 *
8 */
9
10#ifndef mpslibcb_h
11#define mpslibcb_h
12
13typedef void (*mps_lib_function_t)(void);
14int mps_lib_callback_register(const char *, mps_lib_function_t);
15
16#endif /* mpslibcb_h */
17
18
19/* C. COPYRIGHT AND LICENSE
20 *
21 * Copyright (C) 2005 Ravenbrook Limited <http://www.ravenbrook.com/>.
22 * All rights reserved. This is an open source license. Contact
23 * Ravenbrook for commercial licensing options.
24 *
25 * Redistribution and use in source and binary forms, with or without
26 * modification, are permitted provided that the following conditions are
27 * met:
28 *
29 * 1. Redistributions of source code must retain the above copyright
30 * notice, this list of conditions and the following disclaimer.
31 *
32 * 2. Redistributions in binary form must reproduce the above copyright
33 * notice, this list of conditions and the following disclaimer in the
34 * documentation and/or other materials provided with the distribution.
35 *
36 * 3. Redistributions in any form must be accompanied by information on how
37 * to obtain complete source code for this software and any accompanying
38 * software that uses this software. The source code must either be
39 * included in the distribution or be available for no more than the cost
40 * of distribution plus a nominal fee, and must be freely redistributable
41 * under reasonable conditions. For an executable file, complete source
42 * code means the source code for all modules it contains. It does not
43 * include source code for modules or files that typically accompany the
44 * major components of the operating system on which the executable file
45 * runs.
46 *
47 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
48 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
49 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
50 * PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
51 * COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
52 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
53 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
54 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
55 * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
56 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
57 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 */
diff --git a/mps/code/w3build.bat b/mps/code/w3build.bat
index 3d6c879cca0..15f508bb516 100755
--- a/mps/code/w3build.bat
+++ b/mps/code/w3build.bat
@@ -2,12 +2,13 @@
2@rem 2@rem
3@rem $HopeName: !gathconf.bat(trunk.1) $ 3@rem $HopeName: !gathconf.bat(trunk.1) $
4@rem Copyright (C) 2000 Harlequin Limited. All rights reserved. 4@rem Copyright (C) 2000 Harlequin Limited. All rights reserved.
5@rem Copyright (C) 2005 Ravenbrook Limited. All rights reserved.
5 6
6rmdir /q/s w3i3mv 7rmdir /q/s w3i3mv
7nmake /f w3i3mv.nmk VARIETY=we mps.lib mpsplan.lib 8nmake /f w3i3mv.nmk VARIETY=we mps.lib mpsplan.lib mpsplcb.lib mpsdy.dll
8nmake /f w3i3mv.nmk VARIETY=wi mps.lib mpsplan.lib 9nmake /f w3i3mv.nmk VARIETY=wi mps.lib mpsplan.lib mpsplcb.lib mpsdy.dll
9nmake /f w3i3mv.nmk VARIETY=ce mps.lib mpsplan.lib 10nmake /f w3i3mv.nmk VARIETY=ce mps.lib mpsplan.lib mpsplcb.lib mpsdy.dll
10nmake /f w3i3mv.nmk VARIETY=ci mps.lib mpsplan.lib 11nmake /f w3i3mv.nmk VARIETY=ci mps.lib mpsplan.lib mpsplcb.lib mpsdy.dll
11mkdir release 12mkdir release
12mkdir release\include 13mkdir release\include
13mkdir release\lib 14mkdir release\lib
@@ -29,6 +30,7 @@ copy mpscmvff.h release\include
29copy mpscsnc.h release\include 30copy mpscsnc.h release\include
30copy mpsio.h release\include 31copy mpsio.h release\include
31copy mpslib.h release\include 32copy mpslib.h release\include
33copy mpslibcb.h release\include
32copy mpstd.h release\include 34copy mpstd.h release\include
33copy mpsw3.h release\include 35copy mpsw3.h release\include
34copy mpswin.h release\include 36copy mpswin.h release\include
@@ -36,9 +38,21 @@ copy w3i3mv\we\mps.lib release\lib\w3i3\we
36copy w3i3mv\ce\mps.lib release\lib\w3i3\ce 38copy w3i3mv\ce\mps.lib release\lib\w3i3\ce
37copy w3i3mv\we\mpsplan.lib release\lib\w3i3\we 39copy w3i3mv\we\mpsplan.lib release\lib\w3i3\we
38copy w3i3mv\ce\mpsplan.lib release\lib\w3i3\ce 40copy w3i3mv\ce\mpsplan.lib release\lib\w3i3\ce
41copy w3i3mv\we\mpsplcb.lib release\lib\w3i3\we
42copy w3i3mv\ce\mpsplcb.lib release\lib\w3i3\ce
43copy w3i3mv\we\mpsdy.dll release\lib\w3i3\we
44copy w3i3mv\ce\mpsdy.dll release\lib\w3i3\ce
45copy w3i3mv\we\mpsdy.lib release\lib\w3i3\we
46copy w3i3mv\ce\mpsdy.lib release\lib\w3i3\ce
39copy w3i3mv\wi\mps.lib release\lib\w3i3\wi 47copy w3i3mv\wi\mps.lib release\lib\w3i3\wi
40copy w3i3mv\ci\mps.lib release\lib\w3i3\ci 48copy w3i3mv\ci\mps.lib release\lib\w3i3\ci
41copy w3i3mv\wi\mpsplan.lib release\lib\w3i3\wi 49copy w3i3mv\wi\mpsplan.lib release\lib\w3i3\wi
42copy w3i3mv\ci\mpsplan.lib release\lib\w3i3\ci 50copy w3i3mv\ci\mpsplan.lib release\lib\w3i3\ci
51copy w3i3mv\wi\mpsplcb.lib release\lib\w3i3\wi
52copy w3i3mv\ci\mpsplcb.lib release\lib\w3i3\ci
53copy w3i3mv\wi\mpsdy.dll release\lib\w3i3\wi
54copy w3i3mv\ci\mpsdy.dll release\lib\w3i3\ci
55copy w3i3mv\wi\mpsdy.lib release\lib\w3i3\wi
56copy w3i3mv\ci\mpsdy.lib release\lib\w3i3\ci
43copy mpsliban.c release\src 57copy mpsliban.c release\src
44copy mpsioan.c release\src 58copy mpsioan.c release\src
diff --git a/mps/code/w3gen.def b/mps/code/w3gen.def
new file mode 100644
index 00000000000..d9ebcf013e0
--- /dev/null
+++ b/mps/code/w3gen.def
@@ -0,0 +1,141 @@
1; $Header$
2; DO NOT EDIT. Automatically generated by !Header: //info.ravenbrook.com/project/mps/branch/2004-12-15/dll/code/expgen.sh#4 !
3EXPORTS
4; mps.h
5mps_ap_fill_with_reservoir_permit
6mps_ap_fill
7mps_commit
8mps_reserve
9mps_ap_destroy
10mps_ap_create_v
11mps_ap_create
12mps_free
13mps_alloc_v
14mps_alloc
15mps_chain_destroy
16mps_chain_create
17mps_pool_destroy
18mps_pool_create_v
19mps_pool_create
20mps_fmt_destroy
21mps_fmt_create_fixed
22mps_fmt_create_auto_header
23mps_fmt_create_B
24mps_fmt_create_A
25mps_arena_extend
26mps_arena_has_addr
27mps_space_committed
28mps_space_reserved
29mps_arena_formatted_objects_walk
30mps_arena_spare_commit_limit
31mps_arena_spare_commit_limit_set
32mps_arena_commit_limit_set
33mps_arena_commit_limit
34mps_arena_spare_committed
35mps_arena_committed
36mps_arena_reserved
37mps_space_destroy
38mps_space_create
39mps_arena_destroy
40mps_arena_create_v
41mps_arena_create
42mps_space_collect
43mps_space_park
44mps_space_release
45mps_space_clamp
46mps_arena_step
47mps_arena_collect
48mps_arena_start_collect
49mps_arena_unsafe_restore_protection
50mps_arena_unsafe_expose_remember_protection
51mps_arena_expose
52mps_arena_park
53mps_arena_release
54mps_arena_clamp
55mps_telemetry_flush
56mps_fix
57mps_pool_check_fenceposts
58mps_telemetry_label
59mps_telemetry_intern
60mps_telemetry_control
61mps_definalize
62mps_finalize
63mps_message_gc_not_condemned_size
64mps_message_gc_condemned_size
65mps_message_gc_live_size
66mps_message_finalization_ref
67mps_message_type
68mps_message_queue_type
69mps_message_discard
70mps_message_get
71mps_message_type_disable
72mps_message_type_enable
73mps_message_poll
74mps_collections
75mps_ld_isstale
76mps_ld_merge
77mps_ld_add
78mps_ld_reset
79mps_thread_dereg
80mps_thread_reg
81mps_tramp
82mps_stack_scan_ambig
83mps_root_destroy
84mps_root_create_reg
85mps_root_create_fmt
86mps_root_create_table_masked
87mps_root_create_table
88mps_root_create
89mps_reserve_with_reservoir_permit
90mps_reservoir_available
91mps_reservoir_limit
92mps_arena_roots_walk
93mps_reservoir_limit_set
94mps_sac_empty
95mps_pool_check_free_space
96mps_sac_fill
97mps_sac_flush
98mps_sac_free
99mps_sac_alloc
100mps_sac_destroy
101mps_sac_create
102mps_rank_weak
103mps_ap_alloc_pattern_reset
104mps_rank_exact
105mps_ap_alloc_pattern_end
106mps_rank_ambig
107mps_ap_alloc_pattern_begin
108mps_alloc_pattern_ramp_collect_all
109mps_alloc_pattern_ramp
110mps_ap_trip
111mps_ap_frame_pop
112mps_ap_frame_push
113; mpsavm.h
114mps_arena_class_vmnz
115mps_arena_class_vm
116; mpsacl.h
117mps_arena_class_cl
118; mpscamc.h
119mps_class_amc
120mps_amc_apply
121mps_class_amcz
122; mpscams.h
123mps_class_ams_debug
124mps_class_ams
125; mpscawl.h
126mps_class_awl
127; mpsclo.h
128mps_class_lo
129; mpscmv.h
130mps_mv_size
131mps_class_mv_debug
132mps_mv_free_size
133mps_class_mv
134; mpscsnc.h
135mps_class_snc
136; mpslibcb.h
137mps_lib_callback_register
138; mpstd.h
139; mpsw3.h - by hand
140mps_SEH_filter
141mps_SEH_handler
diff --git a/mps/code/w3i3mv.nmk b/mps/code/w3i3mv.nmk
index f3b98dbdea7..3f2c8cfce50 100644
--- a/mps/code/w3i3mv.nmk
+++ b/mps/code/w3i3mv.nmk
@@ -8,7 +8,10 @@ PFM = w3i3mv
8RAINBOWPATH = MSVISUAL\WIN32\I386 8RAINBOWPATH = MSVISUAL\WIN32\I386
9DONGLELIB = $(RAINBOWPATH)\spromeps.lib 9DONGLELIB = $(RAINBOWPATH)\spromeps.lib
10 10
11PFMDEFS = /DWIN32 /D_WINDOWS /I$(RAINBOWPATH) 11# /Gs appears to be necessary to suppress stack checks. Stack checks
12# (if not suppressed) generate a dependency on the C library, __chkesp,
13# which causes the linker step to fail when building the DLL, mpsdy.dll.
14PFMDEFS = /DWIN32 /D_WINDOWS /Gs /I$(RAINBOWPATH)
12 15
13MPM = <ring> <mpm> <bt> <protocol> <boot> \ 16MPM = <ring> <mpm> <bt> <protocol> <boot> \
14 <arenavm> <arenacl> <locus> <arena> <global> <tract> <reserv> \ 17 <arenavm> <arenacl> <locus> <arena> <global> <tract> <reserv> \
diff --git a/mps/code/xcppgc.gmk b/mps/code/xcppgc.gmk
index a160a700224..f26f10fc064 100644
--- a/mps/code/xcppgc.gmk
+++ b/mps/code/xcppgc.gmk
@@ -5,7 +5,7 @@
5 5
6PFM = xcppgc 6PFM = xcppgc
7 7
8MPMPF = mpsliban.c mpsioan.c lockan.c than.c vmxc.c \ 8MPMPF = lockan.c than.c vmxc.c \
9 protan.c prmcan.c span.c ssan.c 9 protan.c prmcan.c span.c ssan.c
10SWPF = than.c vmxc.c protsw.c prmcan.c ssan.c 10SWPF = than.c vmxc.c protsw.c prmcan.c ssan.c
11 11