1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-01-09 13:10:57 -08:00
emacs/mps/code/protan.c
Richard Brooksby 3d5e2ca85f Adding hopenames back into the master sources, so that they can be included in the union sources along with the id keywords.
This was achieved by partially undoing changelist 24817, including an accidental corruption of eventgen.pl.

Copied from Perforce
 Change: 24877
 ServerID: perforce.ravenbrook.com
2001-12-06 18:14:02 +00:00

79 lines
1.3 KiB
C

/* impl.c.protan: ANSI MEMORY PROTECTION
*
* $Id$
* $HopeName: MMsrc!protan.c(trunk.9) $
* Copyright (c) 2001 Ravenbrook Limited.
*
*
* DESIGN
*
* design.mps.protan
*/
#include "mpm.h"
SRCID(protan, "$Id$");
/* ProtSetup -- global protection setup */
void ProtSetup(void)
{
NOOP;
}
/* ProtSet -- set the protection for a page */
void ProtSet(Addr base, Addr limit, AccessSet pm)
{
AVER(base < limit);
/* .improve.protset.check: There is nor AccessSetCheck, so we */
/* don't check it. */
UNUSED(pm);
NOOP;
}
/* ProtSync -- synchronize protection settings with hardware
*
* See design.mps.protan.fun.sync.
*/
void ProtSync(Arena arena)
{
Bool synced;
AVERT(Arena, arena);
do {
Seg seg;
synced = TRUE;
if (SegFirst(&seg, arena)) {
Addr base;
do {
base = SegBase(seg);
if (SegPM(seg) != AccessSetEMPTY) { /* design.mps.protan.fun.sync.seg */
ShieldEnter(arena);
TraceSegAccess(arena, seg, SegPM(seg));
ShieldLeave(arena);
synced = FALSE;
}
} while(SegNext(&seg, arena, base));
}
} while(!synced);
}
/* ProtTramp -- protection trampoline */
void ProtTramp(void **rReturn, void *(*f)(void *, size_t),
void *p, size_t s)
{
AVER(rReturn != NULL);
AVER(FUNCHECK(f));
/* Can't check p and s as they are interpreted by the client */
*(rReturn) = (*(f))(p, s);
}