а OS_main - это что?
Цитата
Код
This patch add "OS_main" and 'OS_task' attributes in GCC .... Function with
"OS_main" and 'OS_task' attributes do not save any "call-saved" registers.
1. "OS_main" attribute used when there IS guarantee that interrupts are
disabled at that time when function is called. For example "main" function in
avr-libc. If this function has local variables that a prologue will look so:
in r28, 0x3d; 61
in r29, 0x3e; 62
sbiw r28, 0x08; 8
out 0x3e, r29; 62
out 0x3d, r28; 61
No save/clear/restore "I" flag.
2. "OS_task" attribute used when there is NO guarantee that interrupts are
disabled at that time when function is called. For example task functions
multi-threading operating systems. In this case save/clear/restore "I" flag is
need for changing SP register. Prologue (if this function has local variables)
will look so:
in r28, 0x3d; 61
in r29, 0x3e; 62
sbiw r28, 0x08; 8
in r0, 0x3f; 63
cli
out 0x3e, r29; 62
out 0x3f, r0; 63
out 0x3d, r28; 61
"OS_main" and 'OS_task' attributes do not save any "call-saved" registers.
1. "OS_main" attribute used when there IS guarantee that interrupts are
disabled at that time when function is called. For example "main" function in
avr-libc. If this function has local variables that a prologue will look so:
in r28, 0x3d; 61
in r29, 0x3e; 62
sbiw r28, 0x08; 8
out 0x3e, r29; 62
out 0x3d, r28; 61
No save/clear/restore "I" flag.
2. "OS_task" attribute used when there is NO guarantee that interrupts are
disabled at that time when function is called. For example task functions
multi-threading operating systems. In this case save/clear/restore "I" flag is
need for changing SP register. Prologue (if this function has local variables)
will look so:
in r28, 0x3d; 61
in r29, 0x3e; 62
sbiw r28, 0x08; 8
in r0, 0x3f; 63
cli
out 0x3e, r29; 62
out 0x3f, r0; 63
out 0x3d, r28; 61