USER_ENTER_CRITICAL()
Posted: Fri Jun 30, 2017 6:53 pm
My hardware platform is MOD54415.
Environment is NBEclipse 2.7.3
from "ucosmcfc.h"
macro:
"USER_ENTER_CRITICAL()"
asm(" nop"); \
asm(" move.w #0x2700,%sr "); \
asm(" addq.l #1,critical_count ");\
I place that macro name in my code
I build "myproject"
I create a listing of "myproject"
(I used: m68k-elf-objdump -S -G myproject.elf > myproject.txt)
I find the actual code is:
400119c0: 4e71 nop
400119c2: 46fc movew %d4,%sr
400119c4: 2700 movel %d0,%a3@-
400119c6: 52b9 8000 0650 addql #1,80000650 <critical_count>
I could be wrong, but I don't think the assembler is doing what 'they' think it will do.
("They" being whoever wrote that macro.)
I have written other assembly routines and have noticed similar behavior.
Questions:
1. The actual executed code is NOT what was expected - right ??
2. Does that macro need to be fixed ??
3. Am I doing something wrong ??
Thanks for looking.
Environment is NBEclipse 2.7.3
from "ucosmcfc.h"
macro:
"USER_ENTER_CRITICAL()"
asm(" nop"); \
asm(" move.w #0x2700,%sr "); \
asm(" addq.l #1,critical_count ");\
I place that macro name in my code
I build "myproject"
I create a listing of "myproject"
(I used: m68k-elf-objdump -S -G myproject.elf > myproject.txt)
I find the actual code is:
400119c0: 4e71 nop
400119c2: 46fc movew %d4,%sr
400119c4: 2700 movel %d0,%a3@-
400119c6: 52b9 8000 0650 addql #1,80000650 <critical_count>
I could be wrong, but I don't think the assembler is doing what 'they' think it will do.
("They" being whoever wrote that macro.)
I have written other assembly routines and have noticed similar behavior.
Questions:
1. The actual executed code is NOT what was expected - right ??
2. Does that macro need to be fixed ??
3. Am I doing something wrong ??
Thanks for looking.