Mail Archives: djgpp/1996/08/07/13:50:30
alaric AT abwillms DOT demon DOT co DOT uk (Alaric B. Williams) wrote:
>While we're at it, if we can put things easily into different
>sections, wouldn't that provide a nice easy method of locking memory
>for hardware interrupt handlers? Stick everything in a '.lock'
>section, with sentinel labels in it so that a "lock_everything()" call
>could lock the entire (guaranteed contiguous) section?
>BTW, is there a better way of getting the extent of a section? Some
>trickery with the linker ADDR and SIZE commands?
This seems to be quite a good idea. You would probably want a
lock_text and .lock_data section, and then you write a new linker
script file that just places these at the begining (or end) of the
text and .data sections respectively and defines the symbols
TextLockStart etc or similar. This is actually what happens for the
constructors in djgpp as the linker script file defines the start and
end of them.
eg.
...
TextLockStart = . ;
*(.ltext)
TextLockEnd = . ;
...
inside the text section, .ltext is the section name.
Malcolm
- Raw text -