This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] CYG_ISR_CALL_DSR vs CYG_ISR_HANDLED.


Gary Thomas <gary@mlbassoc.com> writes:
> On Fri, 2005-11-18 at 16:59 +0300, osv wrote:
>> Hello,
>> 
>> In the eCos reference manual one can read:
>> 
>>   The return value of an ISR is normally one of CYG_ISR_CALL_DSR or
>>   CYG_ISR_HANDLED. The former indicates that further processing is
>>   required at DSR level, and the interrupt handlerâs DSR will be run as
>>   soon as possible. The latter indicates that the interrupt has been
>>   fully handled and no further effort is required.
>
> This is poorly worded I think.

Well, so here is a patch to fix this in the kernel documentation (IO
documentation seems to be OK):

Index: packages/kernel/current/ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/ChangeLog,v
retrieving revision 1.127
diff -u -r1.127 ChangeLog
--- packages/kernel/current/ChangeLog	23 Oct 2005 14:53:38 -0000	1.127
+++ packages/kernel/current/ChangeLog	23 Nov 2005 19:03:36 -0000
@@ -1,3 +1,8 @@
+2005-11-23  Sergei Organov  <osv@javad.com>
+
+	* doc/kernel.sgml: Fix description of CYG_ISR_CALL_DSR and
+	CYG_ISR_HANDLED. Fix example isr_function() accordingly.
+
 2005-10-23  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* include/flag.hxx: We need thread.inl for the empty() function
Index: packages/kernel/current/doc/kernel.sgml
===================================================================
RCS file: /cvs/ecos/ecos/packages/kernel/current/doc/kernel.sgml,v
retrieving revision 1.11
diff -u -r1.11 kernel.sgml
--- packages/kernel/current/doc/kernel.sgml	14 Apr 2004 09:32:05 -0000	1.11
+++ packages/kernel/current/doc/kernel.sgml	23 Nov 2005 18:58:44 -0000
@@ -4380,7 +4380,9 @@
 
     &hellip;
 
-    return dsr_required ? CYG_ISR_CALL_DSR : CYG_ISR_HANDLED;
+    return dsr_required ?
+        (CYG_ISR_CALL_DSR | CYG_ISR_HANDLED) :
+        CYG_ISR_HANDLED;
 }
           </programlisting>
           <para>
@@ -4409,12 +4411,15 @@
 are especially important, so their ISRs will be as short as possible.
           </para>
           <para>
-The return value of an ISR is normally one of
+The return value of an ISR is normally a bit mask containing one or
+both of the following bits:
 <literal>CYG_ISR_CALL_DSR</literal> or
 <literal>CYG_ISR_HANDLED</literal>. The former indicates that further
 processing is required at DSR level, and the interrupt handler's DSR
 will be run as soon as possible. The latter indicates that the
-interrupt has been fully handled and no further effort is required.
+interrupt was handled by this ISR and is used by chained interrupts to
+determine if another ISR (which shares the same interrupt) should be
+run.
           </para>
           <para>
 An ISR is allowed to make very few kernel calls. It can manipulate the
@@ -4429,8 +4434,8 @@
           <term>cyg_DSR_t <parameter>dsr</parameter></term>
           <listitem><para>
 If an interrupt has occurred and the ISR has returned a value
-<literal>CYG_ISR_CALL_DSR</literal>, the system will call the
-deferred service routine or DSR associated with this interrupt
+with <literal>CYG_ISR_CALL_DSR</literal> bit being set, the system
+will call the DSR associated with this interrupt
 handler. If the scheduler is not currently locked then the DSR will
 run immediately. However if the interrupted thread was in the middle
 of a kernel call and had locked the scheduler, then the DSR will be

--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]