mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-19 20:30:29 -08:00
This change will be integrated but ignored (-ay) to the gg-epcore/union sources, so that they retain HopeNames. Copied from Perforce Change: 24911 ServerID: perforce.ravenbrook.com
78 lines
1.3 KiB
C
78 lines
1.3 KiB
C
/* impl.c.protan: ANSI MEMORY PROTECTION
|
|
*
|
|
* $Id$
|
|
* 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);
|
|
}
|