Notice: We have migrated to GitLab launching 2024-05-01 see here: https://gitlab.rtems.org/

#1347 closed defect (fixed)

Timer Server TSR Context Not as Intended

Reported by: Joel Sherrill Owned by: Joel Sherrill
Priority: normal Milestone: 4.10
Component: score Version: 4.10
Severity: normal Keywords:
Cc: Blocked By:
Blocking:

Description

The Timer Server was implemented to provide a mechanism for user applications to
execute TSRs which needed to perform operations which were illegal to
perform in ISRs. The original end user needed to execute Ada methods as the
TSR. With their pre-4.6 RTEMS tools, the Ada routine did nothing which
prevented it from running in a ISR TSR. With the 4.6 tools, it attempted
to lock mutexes and allocate memory which required executing this code
from a task.

The Timer Server task mimicked the ISR environment from which TSRs were
executed and disabled dispatching when invoking the TSRs.

This user is updating their application to 4.9. Since 4.6, there have
been changes in RTEMS which highlight the fact the disabling dispatching
while invoking task based TSRs is incorrect and makes it impossible to
do the types of operations we have explicitly said were OK to do from
a Server based TSR. For example,

+ You can't malloc() because when dispatching is disabled, malloc() now returns

a NULL.

+ You can't lock a mutex/semaphore. A fatal error will be generated.
+ You can't block because dispatching is disabled

In short, the implementation worked based upon the implementation of the
tools and RTEMS at the time but did not really provide the intended
run-time environment for Task based TSRs.

Attachments (2)

pr1347-cvs.diff (38.8 KB) - added by Joel Sherrill on 12/03/08 at 19:50:18.
Patch to rework timer server (CVS)
pr1347-49.diff (54.1 KB) - added by Joel Sherrill on 12/03/08 at 19:52:49.
Patch to rework timer server (CVS)

Download all attachments as: .zip

Change History (3)

Changed on 12/03/08 at 19:50:18 by Joel Sherrill

Attachment: pr1347-cvs.diff added

Patch to rework timer server (CVS)

Changed on 12/03/08 at 19:52:49 by Joel Sherrill

Attachment: pr1347-49.diff added

Patch to rework timer server (CVS)

comment:1 Changed on 12/03/08 at 20:01:29 by Joel Sherrill

Resolution: fixed
Status: newclosed

Committed to 4.9 and CVS.

Note: See TracTickets for help on using tickets.