<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://community.arm.com/utility/feedstylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>CARM-LCP2292: Function calls from within ISRs</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/42891/carm-lcp2292-function-calls-from-within-isrs</link><description> 
Greetings: 
I&amp;#39;m desperately chasing obscure bugs in somebody else&amp;#39;s code. I say
this before I state that some of the ISR&amp;#39;s are embarrassingly long,
and have multiple calls to utility functions. In a knowledge base
article ( http://www.keil.com/support</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: CARM-LCP2292: Function calls from within ISRs</title><link>https://community.arm.com/thread/46689?ContentTypeID=1</link><pubDate>Sun, 27 Aug 2006 16:43:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:36680168-25d7-4f6e-afca-0178d5468ed0</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;&lt;p&gt;
&lt;i&gt;&amp;quot;... some of the ISR&amp;#39;s are embarrassingly long, and have
multiple calls to utility functions.&amp;quot;&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
What are these &lt;b&gt;&lt;i&gt;utility functions&lt;/i&gt;&lt;/b&gt; of which you speak?
Are they C library functions or functions that somebody else
wrote?&lt;/p&gt;

&lt;p&gt;
If they are C library functions, note that not all library
functions are reentrant, so if those non-reentrant functions are
called from mainline code &lt;b&gt;and&lt;/b&gt; ISRs, you could have a problem.
The manual lists which library functions are reentrant:&lt;/p&gt;

&lt;p&gt;
&lt;a href="http://www.keil.com/support/man/docs/ca/ca_library.htm"&gt;http://www.keil.com/support/man/docs/ca/ca_library.htm&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;
On the other hand, if somebody else wrote the utility functions
and you have their source code, you should be able to judge for
yourself whether or not they are reentrant.&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CARM-LCP2292: Function calls from within ISRs</title><link>https://community.arm.com/thread/46682?ContentTypeID=1</link><pubDate>Sun, 27 Aug 2006 15:48:04 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:f600ebee-d4b4-4959-a806-3d768f14ca6a</guid><dc:creator>Mik Kleshov</dc:creator><description>&lt;p&gt;&lt;p&gt;
From the knowledgebase article:&lt;/p&gt;

&lt;p&gt;
&lt;i&gt;Yes, it is required to switch the CPU into the User/System
Mode. Otherwise it would be impossible to call other functions within
the interrupt service routine.&lt;/i&gt;&lt;/p&gt;

&lt;p&gt;
To be honest, I cannot see why it would be impossible to call
other functions. They should work just fine. Maybe someone else in
this forum can explain.&lt;br /&gt;
If one of those functions happens to be non-reentrant you can run
into obscure bugs. As usual, if there are variables shared between
ISRs and normal code, special care must be taken when accessing them
in normal code.&lt;/p&gt;

&lt;p&gt;
Regards,&lt;br /&gt;
- mike&lt;/p&gt;
&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>