patchAVR C Runtime Library - Patches: patch #6500, Reentrant code faq


You are not allowed to post comments on this tracker with your current authentication level.

patch #6500: Reentrant code faq

Submitted by:  Mark Litwack <mlitwack>
Submitted on:  Wed 30 Apr 2008 10:56:18 PM UTC  
Category:  None Priority:  5 - Normal
Status:  Done Privacy:  Public
Assigned to:  Eric Weddington <arcanum> Open/Closed:  Closed

Tue 19 Aug 2008 07:44:35 PM UTC, comment #2:

Committed version 4 of this patch. I did not include Anatoly's comments if they were not included in this version of the patch.

Thanks Mark!

Eric Weddington <arcanum>
Project AdministratorIn charge of this item.
Thu 01 May 2008 02:32:30 PM UTC, comment #1:

+ <tr>
+ <td>pgm_*_far()</td>
+ <td>Accesses I/O register RAMPZ.</td>
+ <td>Protect calls with cli()/sei(), ATOMIC_BLOCK(), or use OS locking.</td>
+ </tr>

The GCC starting from 4.3 save RAMPZ register in interrupt handler routines, and don't demand protect RAMPZ register accesses and 'pgm_*_far' calls.

Certainly, RT-OSes should be changed, and save the RAMPZ register at context switching.


Anatoly Sokolov <aesok>
Project Administrator
Wed 30 Apr 2008 10:56:18 PM UTC, original submission:

Date: Mon, 7 Apr 2008 08:56:59 -0600
Message-ID: <>
In-Reply-To: <>
Thread-Topic: AW: [avr-gcc-list] reentrant interrupt service routine
Thread-Index: AciYu0Kz/U2G9VocRI+0Qcm5/ksRvwAA+KbQ
References: <><><> <>
From: "Weddington, Eric" <>
To: "Mark Litwack" <>,
Status: R


> -----Original Message-----
> From:=20
> [
> org] On Behalf Of Mark Litwack
> Sent: Monday, April 07, 2008 8:23 AM
> To: -email is unavailable-
> Subject: Re: AW: [avr-gcc-list] reentrant interrupt service routine
> I don't mean to carry on a conversation with myself, so if
> no one else is interested in reentrant/non-reentrant I'll be
> quiet now, but I would appreciate any other non-reentrant
> issues that people know about. It's hard to find these
> things when they happen.
> =20

Yes, I think other are interested (I'm interested at least), but it's
just that other developers haven't had the time to look into it.

Since you're going through this, what would be extremely helpful is if
you could do these things:

- Create a list of functions that are known re-entrant, and not
re-entrant. This could be put into the avr-libc user manual for other
users. Better to put it in the docs, then left to rot in an email
- For those functions that are not re-entrant open up a bug report, set
it the Priority (I think it's that field) to "1-Wish". That way it's on
a list to add such re-entrant functions (where possible) at some point,
but at least it's in the system.

Eric Weddington

Mark Litwack <mlitwack>


Attached Files
file #15629:  avr-doc-reentrant-v4.diff added by mlitwack (6KiB - text/x-patch - Added clearerr() fdevopen() fclose(). This patch supersedes the previous.)
file #15573:  avr-doc-reentrant-v3.diff added by mlitwack (5KiB - text/x-patch - Incorporated Anatoly's comment (thanks!). This patch supersedes the previous.)
file #15572:  avr-doc-reentrant-v2.diff added by mlitwack (5KiB - text/x-patch - Found another issue. This patch supersedes the previous.)
file #15568:  avr-doc-reentrant.diff added by mlitwack (5KiB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by arcanum (Posted a comment)
  • -email is unavailable- added by aesok (Posted a comment)
  • -email is unavailable- added by mlitwack (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.




    Follow 7 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2008-08-19 arcanum StatusNone => Done
        Assigned toNone => arcanum
        Open/ClosedOpen => Closed
    2008-05-07 mlitwack Attached File- => Added avr-doc-reentrant-v4.diff, #15629
    2008-05-01 mlitwack Attached File- => Added avr-doc-reentrant-v3.diff, #15573
    2008-05-01 mlitwack Attached File- => Added avr-doc-reentrant-v2.diff, #15572
    2008-04-30 mlitwack Attached File- => Added avr-doc-reentrant.diff, #15568

    Back to the top

    Powered by Savane 3.3