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


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

patch #6500: Reentrant code faq

Submitted by:  Mark Litwack <mlitwack>
Submitted on:  Wed Apr 30 22:56:18 2008  
Category: NonePriority: 5 - Normal
Status: DonePrivacy: Public
Assigned to: Eric Weddington <arcanum>Open/Closed: Closed

Tue Aug 19 19:44:35 2008, 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 May 1 14:32:30 2008, 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 Apr 30 22:56:18 2008, 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: -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 (6kB - text/x-patch - Added clearerr() fdevopen() fclose(). This patch supersedes the previous.)
file #15573:  avr-doc-reentrant-v3.diff added by mlitwack (5kB - text/x-patch - Incorporated Anatoly's comment (thanks!). This patch supersedes the previous.)
file #15572:  avr-doc-reentrant-v2.diff added by mlitwack (5kB - text/x-patch - Found another issue. This patch supersedes the previous.)
file #15568:  avr-doc-reentrant.diff added by mlitwack (5kB - text/x-patch)


Depends on the following items: None found

Items that depend on this one: None found


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

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

    Only logged-in users can vote.


    Please enter the title of George Orwell's famous dystopian book (it's a date):



    Follow 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue Aug 19 19:44:35 2008arcanumStatusNone=>Done
      Assigned toNone=>arcanum
    Wed May 7 09:51:41 2008mlitwackAttached File-=>Added avr-doc-reentrant-v4.diff, #15629
    Thu May 1 15:14:32 2008mlitwackAttached File-=>Added avr-doc-reentrant-v3.diff, #15573
    Thu May 1 14:12:05 2008mlitwackAttached File-=>Added avr-doc-reentrant-v2.diff, #15572
    Wed Apr 30 22:56:18 2008mlitwackAttached File-=>Added avr-doc-reentrant.diff, #15568

    Back to the top

    Powered by Savane 3.1-cleanup1