Split generic mutator context module into two parts: one for generic operating system (prmcan.c) and one for generic architecture (prmcanan.c).

Copied from Perforce
 Change: 192583
 ServerID: perforce.ravenbrook.com
This commit is contained in:
Gareth Rees 2016-10-14 13:25:14 +01:00
parent a53d45c5c7
commit ce8e22cd8e
11 changed files with 87 additions and 27 deletions

View file

@ -10,6 +10,7 @@ PFM = anangc
MPMPF = \
lockan.c \
prmcan.c \
prmcanan.c \
protan.c \
span.c \
ssan.c \

View file

@ -10,6 +10,7 @@ PFM = ananll
MPMPF = \
lockan.c \
prmcan.c \
prmcanan.c \
protan.c \
span.c \
ssan.c \

View file

@ -10,6 +10,7 @@ PFMDEFS = /DCONFIG_PF_ANSI /DCONFIG_THREAD_SINGLE
MPMPF = \
[lockan] \
[prmcan] \
[prmcanan] \
[protan] \
[span] \
[ssan] \

View file

@ -9,7 +9,7 @@ PFM = fri3gc
MPMPF = \
lockix.c \
prmcan.c \
prmcanan.c \
prmcfri3.c \
prmcix.c \
protix.c \

View file

@ -9,7 +9,7 @@ PFM = fri3ll
MPMPF = \
lockix.c \
prmcan.c \
prmcanan.c \
prmcfri3.c \
prmcix.c \
protix.c \

View file

@ -9,7 +9,7 @@ PFM = fri6gc
MPMPF = \
lockix.c \
prmcan.c \
prmcanan.c \
prmcfri6.c \
prmcix.c \
protix.c \

View file

@ -9,7 +9,7 @@ PFM = fri6ll
MPMPF = \
lockix.c \
prmcan.c \
prmcanan.c \
prmcfri6.c \
prmcix.c \
protix.c \

View file

@ -106,7 +106,8 @@
#include "than.c" /* generic threads manager */
#include "vman.c" /* malloc-based pseudo memory mapping */
#include "protan.c" /* generic memory protection */
#include "prmcan.c" /* generic mutator context */
#include "prmcan.c" /* generic operating system mutator context */
#include "prmcanan.c" /* generic architecture mutator context */
#include "span.c" /* generic stack probe */
#include "ssan.c" /* generic stack scanner */
@ -150,7 +151,7 @@
#include "vmix.c" /* Posix virtual memory */
#include "protix.c" /* Posix protection */
#include "protsgix.c" /* Posix signal handling */
#include "prmcan.c" /* generic mutator context */
#include "prmcanan.c" /* generic architecture mutator context */
#include "prmcix.c" /* Posix mutator context */
#include "prmcfri3.c" /* 32-bit Intel for FreeBSD mutator context */
#include "span.c" /* generic stack probe */
@ -166,7 +167,7 @@
#include "vmix.c" /* Posix virtual memory */
#include "protix.c" /* Posix protection */
#include "protsgix.c" /* Posix signal handling */
#include "prmcan.c" /* generic mutator context */
#include "prmcanan.c" /* generic architecture mutator context */
#include "prmcix.c" /* Posix mutator context */
#include "prmcfri6.c" /* 64-bit Intel for FreeBSD mutator context */
#include "span.c" /* generic stack probe */

View file

@ -1,11 +1,11 @@
/* prmcan.c: MUTATOR CONTEXT (ANSI)
/* prmcan.c: MUTATOR CONTEXT (GENERIC OPERATING SYSTEM)
*
* $Id$
* Copyright (c) 2001-2016 Ravenbrook Limited. See end of file for license.
*
* .purpose: Implement the mutator context module. See <design/prmc/>.
* In this ANSI version none of the functions have a useful
* implementation.
* In this version, for a generic operating system, none of the
* functions have a useful implementation.
*/
#include "mpm.h"
@ -21,22 +21,6 @@ Bool MutatorContextCheck(MutatorContext context)
}
Bool MutatorContextCanStepInstruction(MutatorContext context)
{
UNUSED(context);
return FALSE;
}
Res MutatorContextStepInstruction(MutatorContext context)
{
UNUSED(context);
return ResUNIMPL;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2001-2016 Ravenbrook Limited <http://www.ravenbrook.com/>.

71
mps/code/prmcanan.c Normal file
View file

@ -0,0 +1,71 @@
/* prmcanan.c: MUTATOR CONTEXT (GENERIC PROCESSOR ARCHITECTURE)
*
* $Id$
* Copyright (c) 2016 Ravenbrook Limited. See end of file for license.
*
* .purpose: Implement the mutator context module. See <design/prmc/>.
* In this version for a generic processor architecture, none of the
* functions have a useful implementation.
*/
#include "mpm.h"
SRCID(prmcanan, "$Id$");
Bool MutatorContextCanStepInstruction(MutatorContext context)
{
UNUSED(context);
return FALSE;
}
Res MutatorContextStepInstruction(MutatorContext context)
{
UNUSED(context);
return ResUNIMPL;
}
/* C. COPYRIGHT AND LICENSE
*
* Copyright (C) 2016 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

@ -164,7 +164,8 @@ lockan.c Lock implementation for standard C.
lockix.c Lock implementation for POSIX.
lockw3.c Lock implementation for Windows.
prmc.h Mutator context interface. See design.mps.prmc_.
prmcan.c Mutator context implementation for standard C.
prmcan.c Mutator context implementation for generic operating system.
prmcanan.c Mutator context implementation for generic architecture.
prmcfri3.c Mutator context implementation for FreeBSD, IA-32.
prmcfri6.c Mutator context implementation for FreeBSD, x86-64.
prmci3.c Mutator context implementation for IA-32.