Mail Archives: djgpp/1999/12/13/15:15:36
At 06:33 PM 12/13/99 +0100, Pierre Muller wrote:
> Are you sure that you cannot have the same problem
>with a single callback ?
>(ie that its called again while you are still inside it ?)
>That happens to the data in that case ?
It appears that it gets overwritten. Currently this problem is avoided in
the DJGPP library code by leaving interrupts disabled throughout the
callback procedure.
According to the comments in src/libc/go32/gormcb.c:
"This code really can't be nested since the RMCB structure isn't copied,
so the stack check isn't really useful. But someone may fix it someday.
On entry CS is known to be ours, ES is probably ours (since we passed it),
SS:ESP is locked 4K stack. ES:EDI is regs structure, DS:ESI is RM SS:SP.
Do NOT enable interrupts in the user routine. Thanks to ctm AT ardi DOT com for
the improvements. C. Sandmann 3/95"
So perhaps I need to be the one to "fix it someday" by copying the RMCB
structure? It might be nice to do this even if the separate NT workaround
(as originally planned or as you envisioned) is still included, while we're
changing the code in that module. Thoughts, Eli? Does this discussion
need to be moved to the developers list? We probably need to talk to
Charles Sandmann about this...
> Nevertheless try to use selectors only if needed...
Yes, we're doing exactly that. The plan is to detect NT and only use the
workaround if running under NT. Also, the new code will not allocate a
selector if the passed registers structure is already below the 64K barrier.
Peter Johnson
- Raw text -