<?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>Library function reentrancy?</title><link>https://community.arm.com/developer/tools-software/tools/f/keil-forum/36613/library-function-reentrancy</link><description> I&amp;#39;m sure it&amp;#39;s written somewhere and I&amp;#39;m not opposed to looking for it. However I have looked and found nothing so I&amp;#39;ll ask. 
 
There are a host of &amp;quot;behind the scenes&amp;quot; library functions that perform such magic as right or left shifts of various data types</description><dc:language>en-US</dc:language><generator>Telligent Community 10</generator><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/141379?ContentTypeID=1</link><pubDate>Wed, 19 May 2004 08:01:01 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:61ab1209-ef66-49d5-a8fe-460cebad2adb</guid><dc:creator>Stephen Ciricillo</dc:creator><description>&lt;p&gt;OK,&lt;br /&gt;
Duh, my bad.&lt;br /&gt;
&lt;br /&gt;
Sorry, Jon.  Did a little research and I learned that you work for Keil.  Thanks for the help :)&lt;br /&gt;
Steve C.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/137845?ContentTypeID=1</link><pubDate>Wed, 19 May 2004 07:50:07 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:26a0a34b-a9dc-409c-b6f7-bad1e4a61a33</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;Jon, ... what is the basis for your comment?&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
I think Jon has inside information...  ;-)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/137848?ContentTypeID=1</link><pubDate>Wed, 19 May 2004 07:49:06 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:03782c2b-fe29-4cfe-b5a6-1973d7e260c3</guid><dc:creator>John Donaldson</dc:creator><description>&lt;p&gt;&amp;quot;According to the link that Dan posted (&lt;a href="http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm&lt;/a&gt;) - and what I also found in the C51 manual:&lt;br /&gt;
Many of the routines in the C51 standard library are reentrant and/or intrinsic.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
If you read the two sentences following that you will understand how to find out *which* routines are reentrant:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;Many of the routines in the C51 standard library are reentrant and/or intrinsic. These specifications are listed in the following tables. Unless otherwise noted, routines are non-reentrant and non-intrinsic.&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;quot;And it says nothing of the of the other hidden functions.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Why do you care if the hidden functions are reentrant? Why would there be any need to know if they are reentrant?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/129870?ContentTypeID=1</link><pubDate>Wed, 19 May 2004 07:00:05 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:a7f303d9-12f5-4e5e-9530-6d0d67f426fc</guid><dc:creator>Stephen Ciricillo</dc:creator><description>&lt;p&gt;Thanks Andy,&lt;br /&gt;
&lt;br /&gt;
You understand the question.&lt;br /&gt;
&lt;br /&gt;
Jon,&lt;br /&gt;
&lt;i&gt;The run-time routines in the library use only registers and are therefore reentrant.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Are you refering to the hidden functions that I&amp;#39;m talking about?  If so, what is the basis for your comment?  I too can conclude that the functions must be reentrant or we&amp;#39;d all be in a world of hurt.  But where does it say that?&lt;br /&gt;
&lt;br /&gt;
According to the link that Dan posted (&lt;a href="http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm&lt;/a&gt;) - and what I also found in the C51 manual:&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Many&lt;/b&gt; of the routines in the C51 &lt;b&gt;standard library&lt;/b&gt; are reentrant and/or intrinsic.&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Many, but not ALL.  And it says nothing of the of the other hidden functions.&lt;br /&gt;
&lt;br /&gt;
Thanks for all of your replies.&lt;br /&gt;
Steve C.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/122390?ContentTypeID=1</link><pubDate>Tue, 18 May 2004 21:15:57 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:77b45be6-08c5-4735-95b8-2833241c1838</guid><dc:creator>Jon Ward</dc:creator><description>&lt;p&gt;The run-time routines in the library use only registers and are therefore reentrant.&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Jon&lt;/b&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/110883?ContentTypeID=1</link><pubDate>Tue, 18 May 2004 19:11:39 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:88f014b1-dd49-4675-909f-3478636fa951</guid><dc:creator>Andy Neil</dc:creator><description>&lt;p&gt;&lt;i&gt;&amp;quot;These &lt;b&gt;are&lt;/b&gt; documented in the &amp;quot;Routines By Category&amp;quot; section of the C51 User&amp;#39;s Guide&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
That covers only the &amp;quot;public&amp;quot; functions from the standard ANSI library (and some Keil intrinsics) - not the &amp;quot;hidden&amp;quot; helper functions that the OP was actually after:&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&amp;quot;The underlying run time library functions that implement pointer conversions, switch statement logic, integer division, rotates, shifts, etc.&amp;quot;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Since there are no warnings about reentrancy issues with these, one would hope that there are no issues - but, as the OP said, it would be nice to have it in black and white...!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/96318?ContentTypeID=1</link><pubDate>Tue, 18 May 2004 19:02:26 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:481bd1e5-921e-4c51-aef3-5bb633e7f33c</guid><dc:creator>Dan Henry</dc:creator><description>&lt;p&gt;These &lt;b&gt;are&lt;/b&gt; documented in the &amp;quot;Routines By Category&amp;quot; section of the C51 User&amp;#39;s Guide.&lt;br /&gt;
&lt;br /&gt;
&lt;a href="http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm"&gt;http://www.keil.com/support/man/docs/c51/c51_lib_routines.htm&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/72494?ContentTypeID=1</link><pubDate>Tue, 18 May 2004 13:26:47 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:28001d02-fdc6-48a7-962d-2401a841d2bf</guid><dc:creator>Stephen Ciricillo</dc:creator><description>&lt;p&gt;Thanks Neil,&lt;br /&gt;
&lt;br /&gt;
I think library is exactly the term I&amp;#39;m looking for.  However, it needs to be stated that there are sort of 2 libraries here.&lt;br /&gt;
&lt;br /&gt;
1. The ANSI C standard library routines (requiring header files, STDIO.H, etc., functions like printf(), isalpha(), etc.) and&lt;br /&gt;
2. The underlying run time library functions that implement pointer conversions, switch statement logic, integer division, rotates, shifts, etc.&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;All&lt;/i&gt; of these functions are found in the Keil library files (such as C51S.LIB) but only the published ANSI functions (as listed in the various header files) are really directly user accessible.  My concern is with the other &amp;quot;hidden&amp;quot; functions.  It&amp;#39;s not always clear when and how they will get invoked.&lt;br /&gt;
&lt;br /&gt;
For example, a switch() statement (my previous example) will invoke CCASE.  A statement like &amp;quot;i = 0x8422 &amp;lt;&amp;lt; 7&amp;quot; may invoke some helper shift function as well.&lt;br /&gt;
&lt;br /&gt;
It&amp;#39;s widely understood that interrupt routines should contain as little code as possible for performance reasons.  I&amp;#39;m concerned about the nature of that code, not the amount.&lt;br /&gt;
&lt;br /&gt;
Again it would be nice to some some printed assurance regarding this point.&lt;br /&gt;
&lt;br /&gt;
Thanks for the reply.&lt;br /&gt;
Steve C.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Library function reentrancy?</title><link>https://community.arm.com/thread/42236?ContentTypeID=1</link><pubDate>Tue, 18 May 2004 11:55:56 GMT</pubDate><guid isPermaLink="false">dd9e70c8-6d3c-4c71-b136-2456382a7b5c:705bac97-86ab-4e54-8347-3eb5f05988c8</guid><dc:creator>Neil Kurzman</dc:creator><description>&lt;p&gt;Library may not be the exact term you are looking for.  They would be functions requiring includes.  And not all of those are re-entrant.  Normal C key words work in reentrant functions.  However go take care about how much work you do in an interrupt.  those calls may cause the compiler to push a lot of stuff on the stack. that and call can kill interrupt performance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>