1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

Mps: mpslib via client callbacks. mpslib.c

Copied from Perforce
 Change: 143314
 ServerID: perforce.ravenbrook.com
This commit is contained in:
David Jones 2005-02-07 14:50:11 +00:00
parent f19932dace
commit 3ae15c0e8b
5 changed files with 483 additions and 33 deletions

View file

@ -268,7 +268,7 @@ all: mpmss sacss amcss amcsshe amsss amssshe segsmss awlut awluthe \
mpsicv lockcov poolncv locv qs apss \
finalcv finaltest arenacv bttest teletest \
abqtest cbstest btcv mv2test messtest steptest \
eventcnv walkt0 \
eventcnv walkt0 libcbt \
mps.a
swall: mmsw.a replaysw
@ -293,6 +293,7 @@ mpmss sacss amcss amcssth amcsshe amsss amssshe segsmss awlut awlutth \
awluthe mpsicv lockcov poolncv locv qs apss \
finalcv finaltest arenacv bttest teletest \
expt825 \
libcbt \
abqtest cbstest btcv mv2test \
messtest steptest \
walkt0 \
@ -349,98 +350,103 @@ endif
ifdef VARIETY
$(PFM)/$(VARIETY)/finalcv: $(PFM)/$(VARIETY)/finalcv.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/finaltest: $(PFM)/$(VARIETY)/finaltest.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/expt825: $(PFM)/$(VARIETY)/expt825.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/libcbt: $(PFM)/$(VARIETY)/libcbt.o \
$(PFM)/$(VARIETY)/mpslibcb.o \
$(PFM)/$(VARIETY)/mpsioan.o \
$(MPMOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/locv: $(PFM)/$(VARIETY)/locv.o \
$(MPMOBJ) $(LOOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(LOOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/mpmss: $(PFM)/$(VARIETY)/mpmss.o \
$(MPMOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/apss: $(PFM)/$(VARIETY)/apss.o \
$(MPMOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/sacss: $(PFM)/$(VARIETY)/sacss.o \
$(MPMOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(MVFFOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/bttest: $(PFM)/$(VARIETY)/bttest.o \
$(MPMOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/teletest: $(PFM)/$(VARIETY)/teletest.o \
$(MPMOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/lockcov: $(PFM)/$(VARIETY)/lockcov.o \
$(MPMOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/mpsicv: $(PFM)/$(VARIETY)/mpsicv.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ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LIBOBJ)
$(PFM)/$(VARIETY)/btcv: $(PFM)/$(VARIETY)/btcv.o \
$(MPMOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/mv2test: $(PFM)/$(VARIETY)/mv2test.o \
$(PFM)/$(VARIETY)/poolmv2.o $(PFM)/$(VARIETY)/abq.o \
$(MPMOBJ) $(TESTLIBOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/messtest: $(PFM)/$(VARIETY)/messtest.o \
$(MPMOBJ) $(PLINTHOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/steptest: $(PFM)/$(VARIETY)/steptest.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/walkt0: $(PFM)/$(VARIETY)/walkt0.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/exposet0: $(PFM)/$(VARIETY)/exposet0.o \
$(FMTDYTSTOBJ) $(MPMOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(FMTDYTSTOBJ) $(MPMOBJ) $(PLINTHOBJ) $(AMCOBJ) $(TESTLIBOBJ)
$(PFM)/$(VARIETY)/eventcnv: $(PFM)/$(VARIETY)/eventcnv.o \
$(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o
@ -448,7 +454,8 @@ $(PFM)/$(VARIETY)/eventcnv: $(PFM)/$(VARIETY)/eventcnv.o \
$(PFM)/$(VARIETY)/replay: $(PFM)/$(VARIETY)/replay.o \
$(PFM)/$(VARIETY)/eventrep.o \
$(PFM)/$(VARIETY)/eventpro.o $(PFM)/$(VARIETY)/table.o \
$(MPMOBJ) $(AWLOBJ) $(AMSOBJ) $(POOLNOBJ) $(AMCOBJ) $(SNCOBJ) $(MVFFOBJ)
$(MPMOBJ) $(PLINTHOBJ) $(AWLOBJ) $(AMSOBJ) $(POOLNOBJ) \
$(AMCOBJ) $(SNCOBJ) $(MVFFOBJ)
$(PFM)/$(VARIETY)/mps.a: $(MPMOBJ) $(AMCOBJ) $(SNCOBJ) $(MVFFOBJ)

69
mps/code/libcbt.c Normal file
View file

@ -0,0 +1,69 @@
/* libcbt: MPS LIBRARY CALLBACK TEST
*
* $Header$
* Copyright (C) 2005 Ravenbrook Limited. See end of file for license.
*
* This is a simple test of the MPS Library Callback interface
* (mpslibcb.h). */
#include "mps.h"
#include "mpsavm.h"
#include "mpslib.h"
#include "mpslibcb.h"
#include "testlib.h"
#include <stdio.h>
#include <stdlib.h>
void libcbt_assert_fail(const char *);
mps_clock_t libcbt_clock(void);
int main(void)
{
int res;
int defects = 0;
mps_arena_t arena;
res = mps_lib_callback_register("not a callback", (void(*)(void))0);
if(MPS_RES_OK == res) {
printf("mps_lib_callback_register claims to successfully register\n"
"an interface that does not exist.\n");
++ defects;
}
die(mps_lib_callback_register("mps_lib_assert_fail",
(void(*)(void))libcbt_assert_fail),
"register assert_fail");
/* The following functions are registered in the order that you get by
* providing no functions and then providing functions as they are
* required by assertionn failures.
* Interestingly, for this very simple test, only mps_clock is
* required. */
die(mps_lib_callback_register("mps_clock",
(mps_lib_function_t)libcbt_clock),
"register clock");
die(mps_arena_create(&arena, mps_arena_class_vm(), 1000*1000),
"mps_arena_create");
if(defects) {
printf("Conclusion: Defects detected.\n");
} else {
printf("Conclusion: Failed to find any defects.\n");
}
return 0;
}
void libcbt_assert_fail(const char *message)
{
fflush(stdout);
fprintf(stderr, "\nMPS ASSERTION FAILURE (TEST): %s\n", message);
fflush(stderr);
abort();
}
mps_clock_t libcbt_clock(void)
{
static mps_clock_t c = 0;
++ c;
return c;
}

316
mps/code/mpslibcb.c Normal file
View file

@ -0,0 +1,316 @@
/* mpslibcb.c: RAVENBROOK MEMORY POOL SYSTEM LIBRARY INTERFACE (CALLBACK)
*
* $Header$
* Copyright (c) 2005 Ravenbrook Limited. See end of file for license.
*
* .purpose: The purpose of this code is
* 1. permit the MPS Library Interface to be used conveniently when
* the MPS is packaged as a dynamic library (and in particular a
* Windows DLL).
*
* .readership: For MPS client application developers and MPS developers.
* .sources: <design/lib/>
*
* .freestanding: This is designed to be deployed in a freestanding
* environment, so we can't use strcmp from <string.h>, so we have to
* roll our own (in fact we only ever need equality so we define a
* simpler interface).
*/
#include "mpslibcb.h"
#include "mpslib.h"
#include "mpm.h"
/* Forward declarations. */
int mps_lib_callback_default_get_EOF(void);
mps_lib_FILE *mps_lib_callback_default_get_stderr(void);
mps_lib_FILE *mps_lib_callback_default_get_stdout(void);
int mps_lib_callback_default_fputc(int c_, mps_lib_FILE *f_);
int mps_lib_callback_default_fputs(const char *s_, mps_lib_FILE *f_);
void *mps_lib_callback_default_memset(void *p_, int c_, size_t n_);
void *mps_lib_callback_default_memcpy(void *p_, const void *q_, size_t n_);
int mps_lib_callback_default_memcmp(const void *p_, const void *q_, size_t n_);
mps_clock_t mps_lib_callback_default_clock(void);
mps_clock_t mps_lib_callback_default_clocks_per_sec(void);
unsigned long mps_lib_callback_default_telemetry_control(void);
int mps_lib_callback_streq(const char *, const char *);
#define EQ(p, q) (mps_lib_callback_streq((p), (q)))
struct mps_lib_callback_s
{
int (*lib_get_EOF)(void);
mps_lib_FILE * (*lib_get_stderr)(void);
mps_lib_FILE * (*lib_get_stdout)(void);
int (*lib_fputc)(int, mps_lib_FILE *);
int (*lib_fputs)(const char *, mps_lib_FILE *);
void (*lib_assert_fail)(const char *);
void * (*lib_memset)(void *, int, size_t);
void * (*lib_memcpy)(void *, const void *, size_t);
int (*lib_memcmp)(const void *, const void *, size_t);
mps_clock_t (*clock)(void);
mps_clock_t (*clocks_per_sec)(void);
unsigned long (*lib_telemetry_control)(void);
};
/* The default functions are stubs that assert. Except for the
* assert_fail function (which is called when assertions fail) which
* will be NULL. This means: if you provide assert_fail and forget
* something else, you'll know about it. If you do not provide
* assert_fail then it will probably stop anyway.
*
* These functions really do need to fail even if checks are off
* (CHECK_NONE), so we reach under the hood of check.h and call ASSERT
* directly. */
struct mps_lib_callback_s mps_lib_callback_global = {
mps_lib_callback_default_get_EOF,
mps_lib_callback_default_get_stderr,
mps_lib_callback_default_get_stdout,
mps_lib_callback_default_fputc,
mps_lib_callback_default_fputs,
NULL, /* assert_fail */
mps_lib_callback_default_memset,
mps_lib_callback_default_memcpy,
mps_lib_callback_default_memcmp,
mps_lib_callback_default_clock,
mps_lib_callback_default_clocks_per_sec,
mps_lib_callback_default_telemetry_control
};
int mps_lib_callback_register(const char *name, mps_lib_function_t f)
{
if(NULL == name) {
return ResFAIL;
}
if(0) {
/* just to make the "else if" neater. */
} else if(EQ(name, "mps_lib_get_EOF")) {
mps_lib_callback_global.lib_get_EOF = (int(*)(void))f;
} else if(EQ(name, "mps_lib_get_stderr")) {
mps_lib_callback_global.lib_get_stderr = (mps_lib_FILE *(*)(void))f;
} else if(EQ(name, "mps_lib_get_stdout")) {
mps_lib_callback_global.lib_get_stdout = (mps_lib_FILE *(*)(void))f;
} else if(EQ(name, "mps_lib_fputc")) {
mps_lib_callback_global.lib_fputc = (int(*)(int, mps_lib_FILE *))f;
} else if(EQ(name, "mps_lib_fputs")) {
mps_lib_callback_global.lib_fputs =
(int(*)(const char *, mps_lib_FILE *))f;
} else if(EQ(name, "mps_lib_assert_fail")) {
mps_lib_callback_global.lib_assert_fail = (void(*)(const char *))f;
} else if(EQ(name, "mps_lib_memset")) {
mps_lib_callback_global.lib_memset = (void *(*)(void *, int, size_t))f;
} else if(EQ(name, "mps_lib_memcpy")) {
mps_lib_callback_global.lib_memcpy =
(void *(*)(void *, const void *, size_t))f;
} else if(EQ(name, "mps_lib_memcmp")) {
mps_lib_callback_global.lib_memcmp =
(int(*)(const void *, const void *, size_t))f;
} else if(EQ(name, "mps_clock")) {
mps_lib_callback_global.clock = (mps_clock_t(*)(void))f;
} else if(EQ(name, "mps_clocks_per_sec")) {
mps_lib_callback_global.clocks_per_sec = (mps_clock_t(*)(void))f;
} else if(EQ(name, "mps_lib_telemetry_control")) {
mps_lib_callback_global.lib_telemetry_control =
(unsigned long(*)(void))f;
} else {
return ResUNIMPL;
}
return ResOK;
}
/* Return non-zero if and only if string p equals string q. */
int mps_lib_callback_streq(const char *p, const char *q)
{
do {
if(*p == '\0' && *q == '\0') {
return 1;
}
} while(*p++ == *q++);
return 0;
}
int mps_lib_callback_default_get_EOF(void)
{
ASSERT(0, "mps_lib_get_EOF needs to be provided");
return 0;
}
mps_lib_FILE *mps_lib_callback_default_get_stderr(void)
{
ASSERT(0, "mps_lib_get_stderr needs to be provided");
return NULL;
}
mps_lib_FILE *mps_lib_callback_default_get_stdout(void)
{
ASSERT(0, "mps_lib_get_stdout needs to be provided");
return NULL;
}
int mps_lib_callback_default_fputc(int c_, mps_lib_FILE *f_)
{
UNUSED(c_);
UNUSED(f_);
ASSERT(0, "mps_lib_fputc needs to be provided");
return 0;
}
int mps_lib_callback_default_fputs(const char *s_, mps_lib_FILE *f_)
{
UNUSED(s_);
UNUSED(f_);
ASSERT(0, "mps_lib_fputs needs to be provided");
return 0;
}
/* No default implementation for mps_lib_assert_fail */
void *mps_lib_callback_default_memset(void *p_, int c_, size_t n_)
{
UNUSED(p_);
UNUSED(c_);
UNUSED(n_);
ASSERT(0, "mps_lib_memset needs to be provided");
return NULL;
}
void *mps_lib_callback_default_memcpy(void *p_, const void *q_, size_t n_)
{
UNUSED(p_);
UNUSED(q_);
UNUSED(n_);
ASSERT(0, "mps_lib_memcpy needs to be provided");
return NULL;
}
int mps_lib_callback_default_memcmp(const void *p_, const void *q_, size_t n_)
{
UNUSED(p_);
UNUSED(q_);
UNUSED(n_);
ASSERT(0, "mps_lib_memcmp needs to be provided");
return 0;
}
mps_clock_t mps_lib_callback_default_clock(void)
{
ASSERT(0, "mps_clock needs to be provided");
return 0;
}
mps_clock_t mps_lib_callback_default_clocks_per_sec(void)
{
ASSERT(0, "mps_clocks_per_sec needs to be provided");
return 0;
}
unsigned long mps_lib_callback_default_telemetry_control(void)
{
ASSERT(0, "mps_lib_telemetry_control needs to be provided");
return 0;
}
int mps_lib_get_EOF(void)
{
return mps_lib_callback_global.lib_get_EOF();
}
mps_lib_FILE *mps_lib_get_stderr(void)
{
return mps_lib_callback_global.lib_get_stderr();
}
mps_lib_FILE *mps_lib_get_stdout(void)
{
return mps_lib_callback_global.lib_get_stdout();
}
int mps_lib_fputc(int c, mps_lib_FILE *f)
{
return mps_lib_callback_global.lib_fputc(c, f);
}
int mps_lib_fputs(const char *s, mps_lib_FILE *f)
{
return mps_lib_callback_global.lib_fputs(s, f);
}
void mps_lib_assert_fail(const char *m)
{
mps_lib_callback_global.lib_assert_fail(m);
}
void *(mps_lib_memset)(void *p, int c, size_t n)
{
return mps_lib_callback_global.lib_memset(p, c, n);
}
void *(mps_lib_memcpy)(void *p, const void *q, size_t n)
{
return mps_lib_callback_global.lib_memcpy(p, q, n);
}
int (mps_lib_memcmp)(const void *p, const void *q, size_t n)
{
return mps_lib_callback_global.lib_memcmp(p, q, n);
}
mps_clock_t mps_clock(void)
{
return mps_lib_callback_global.clock();
}
mps_clock_t mps_clocks_per_sec(void)
{
return mps_lib_callback_global.clocks_per_sec();
}
unsigned long mps_lib_telemetry_control(void)
{
return mps_lib_callback_global.lib_telemetry_control();
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2005 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Redistributions in any form must be accompanied by information on how
* to obtain complete source code for this software and any accompanying
* software that uses this software. The source code must either be
* included in the distribution or be available for no more than the cost
* of distribution plus a nominal fee, and must be freely redistributable
* under reasonable conditions. For an executable file, complete source
* code means the source code for all modules it contains. It does not
* include source code for modules or files that typically accompany the
* major components of the operating system on which the executable file
* runs.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

58
mps/code/mpslibcb.h Normal file
View file

@ -0,0 +1,58 @@
/* mpslibcb.h: RAVENBROOK MEMORY POOL SYSTEM LIBRARY CALLBACK INTERFACE
*
* $Header$
* Copyright (c) 2005 Ravenbrook Limited. See end of file for license.
*
* .readership: MPS client application developers, MPS developers.
*
*/
#ifndef mpslibcb_h
#define mpslibcb_h
typedef void (*mps_lib_function_t)(void);
int mps_lib_callback_register(const char *, mps_lib_function_t);
#endif /* mpslibcb_h */
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2005 Ravenbrook Limited <http://www.ravenbrook.com/>.
* All rights reserved. This is an open source license. Contact
* Ravenbrook for commercial licensing options.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are
* met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* 3. Redistributions in any form must be accompanied by information on how
* to obtain complete source code for this software and any accompanying
* software that uses this software. The source code must either be
* included in the distribution or be available for no more than the cost
* of distribution plus a nominal fee, and must be freely redistributable
* under reasonable conditions. For an executable file, complete source
* code means the source code for all modules it contains. It does not
* include source code for modules or files that typically accompany the
* major components of the operating system on which the executable file
* runs.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
* PURPOSE, OR NON-INFRINGEMENT, ARE DISCLAIMED. IN NO EVENT SHALL THE
* COPYRIGHT HOLDERS AND CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

View file

@ -5,7 +5,7 @@
PFM = xcppgc
MPMPF = mpsliban.c mpsioan.c lockan.c than.c vmxc.c \
MPMPF = lockan.c than.c vmxc.c \
protan.c prmcan.c span.c ssan.c
SWPF = than.c vmxc.c protsw.c prmcan.c ssan.c