Mail Archives: djgpp/1995/09/12/13:10:40
>>>>> "Paul" == Paul <digisoft AT eis DOT net DOT au> writes:
Paul> How can you get the size of a piece of "C" code that
Paul> services the interrupt so that it can be locked. Up till
Paul> now I just lock it all to be safe.
As a TOTALLY EVIL hack, you can do something like:
----------------------------------------------------------------------
void interrupt_memory_start (void) { }
void my_interrupt_handler (void)
{
...
}
void interrupt_memory_end (void) { }
----------------------------------------------------------------------
and then lock:
(char *) interrupt_memory_end - (char *) interrupt_memory_start
bytes, starting at:
(char *) interrupt_memory_start
Of course, there's no guarantee that this will work (I think even
casting a function pointer to a char * is forbidden) but it happens to
be the case that this works with the latest djgpp (just make sure all
of your functions are non-static).
-Mat
- Raw text -