1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-28 16:21:07 -08:00
emacs/mps/code/ssw3i3.c
Richard Brooksby c0bb4cd3cd Removing hopenames from the master sources.
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
2001-12-07 13:19:25 +00:00

45 lines
1.1 KiB
C

/* impl.c.ssw3i3: WIN32/INTEL STACK SCANNING
*
* $Id$
* Copyright (c) 2001 Ravenbrook Limited.
*
* This scans the stack and fixes the registers which may contain
* roots. See design.mps.thread-manager
*
* The registers edi, esi, ebx are the registers defined to be preserved
* across function calls and therefore may contain roots.
* These are pushed on the stack for scanning.
*
* ASSUMPTIONS
*
* .align: The stack pointer is assumed to be aligned on a word
* boundary.
*/
#include "mpm.h"
SRCID(ssw3i3, "$Id$");
Res StackScan(ScanState ss, Addr *stackBot)
{
Addr *stackTop;
Res res;
__asm {
push edi /* these registers are the save registers */
push esi /* and so may contain roots. They are pushed */
push ebx /* for scanning */
mov stackTop, esp /* stack pointer */
}
AVER(AddrIsAligned((Addr)stackTop, sizeof(Addr))); /* .align */
res = TraceScanArea(ss, stackTop, stackBot);
__asm {
add esp, 0xc /* pop 3 registers to restore the stack pointer */
}
return res;
}