This is the mail archive of the
ecos-bugs@sourceware.org
mailing list for the eCos project.
[Bug 1001153] New: HAL_DISABLE_INTERRUPTS not working as expected
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-bugs at ecos dot sourceware dot org
- Date: Wed, 16 Feb 2011 13:42:58 +0000
- Subject: [Bug 1001153] New: HAL_DISABLE_INTERRUPTS not working as expected
- Auto-submitted: auto-generated
Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001153
Summary: HAL_DISABLE_INTERRUPTS not working as expected
Product: eCos
Version: CVS
Platform: stm32e_eval (ST STM3210E EVAL board)
OS/Version: Cortex-M
Status: UNCONFIRMED
Severity: critical
Priority: low
Component: HAL
AssignedTo: unassigned@bugs.ecos.sourceware.org
ReportedBy: uholeschak@bihl-wiedemann.de
CC: ecos-bugs@ecos.sourceware.org
Class: Advice Request
The macro
# define HAL_DISABLE_INTERRUPTS(__old) \
__asm__ volatile ( \
"mrs %0, basepri \n" \
"mov r1,%1 \n" \
"msr basepri,r1 \n" \
: "=r" (__old) \
: "r" (CYGNUM_HAL_CORTEXM_PRIORITY_MAX)\
: "r1" \
);
is not working as expected if the compiler uses the same register for input and
output argument. In this case the basepri is not modified because the input
register is overwritten with the old basepri value before the assignment.
The following modification fixes this problem:
# define HAL_DISABLE_INTERRUPTS(__old) \
__asm__ volatile ( \
"mrs r2, basepri \n" \
"mov r1,%1 \n" \
"msr basepri,r1 \n" \
"mov %0, r2 \n" \
: "=r" (__old) \
: "r" (CYGNUM_HAL_CORTEXM_PRIORITY_MAX)\
: "r1", "r2" \
);
--
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.