Hi Kusti,

> I'll test this later today.
>
> You wrote: "partially emulate"
>
> What do you mean by that, what __critical -functionality would
> disabling all interrupt not emulate?

Well, you cannot emulate

void func(void) __critical
{
// something
}

using

void func(void)
{
   CRITICAL(
   //something
   )
}

as this would not protect the prologue and epilogue. You *could* use

void func(void)
{
   CRITICAL(real_func());
}

and implement // something in real_func instead to solve that, but
it is more costly and less convenient.

With partly I meant that __critical (if implemented) adds value
that cannot completely be obtained using standard stuff such as
macros. In other words, __critical is not mere syntactic sugar.

> Or are you talking abou things like using a 'return/break' statement
> inside disabled section in which case of course the re-enabling of
> interrupts would not happen?

This is another good point. Yes, I meant such things.

Best wishes,
Raphael

------------------------------------------------------------------------------
This SF.net email is sponsored by:
SourcForge Community
SourceForge wants to tell your story.
http://p.sf.net/sfu/sf-spreadtheword
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to