Mail Archives: djgpp/1995/09/12/23:58:55
On Tue, 12 Sep 1995, Mat Hostetter wrote:
> 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).
>
You can _DO_ That? (Successfully, I mean?) Wow! I would have
expected the compiler to outsmart me somehow and put things in a
different order or something.
/***************************************************************
*** Jesse Morris *** enrico AT max DOT tiac DOT net *** jmorris AT ace DOT com ***
***************** Cuthalion / Sliced Bread *******************/
- Raw text -