This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Q about HAL_INTERRUPT_MASK/UNMASK.
- From: Sergei Organov <osv at javad dot ru>
- To: ecos-discuss at sourceware dot cygnus dot com
- Date: 21 Jan 2002 20:48:58 +0300
- Subject: [ECOS] Q about HAL_INTERRUPT_MASK/UNMASK.
Hello,
Is it required by the HAL interface that implementation of HAL_INTERRUPT_MASK
and HAL_INTERRUPT_UNMASK be reentrant?
Consider simple interrupt controller having an interrupt enable register (IER)
where single bit is dedicated for every interrupt source. Suppose also that
processor doesn't have atomic "set bit"/"clear bit" instructions.
Implementation of mentioned macros for such an architecture wold look like
this:
1. Read IER to a temporary;
2. Set/Clear bit in the temporary;
3. Write temporary back to IER;
Once this sequence is interrupted between (1) and (3) and interrupting code
also invokes one of these macros we are in trouble.
So the question is: is it required to disable/enable processor interrupts at
the beginning/end of these macros when implementing HAL for such architecture?
If no, please teach me what I've missed.
Thanks in advance.
BR,
Sergei Organov.