bon at elektron.ikp.physik.tu-darmstadt.de
Tue Jan 16 13:41:48 CET 2018
>>>>> "Dušan" == Dušan <dferbas at etech.cz> writes:
Dušan> Uwe, I feel we've got on a wrong path :-).
Dušan> Why you concentrate on the NutEnterCriticalLevel ? Let's forget
Dušan> about it for a while. I suggest to start with NutEnterCritical
Dušan> for m68k platform. This is the initially issue, we started to
Dušan> talk about. I attached 2 emails below.
Dušan> Let's look at the include\arch\arm\ atom.h. Here ccodes are also
Dušan> stored into a temp variable.
No, this temp variable is only used to not destroy R0. Look at the log entry
for Rev 1897:
"Bug #1757410 fixed. NutEnter/ExitCritical destroyed ARM register R0."
temp is also only inside a stack frame, so it is lost when NutEnter|Exit
Critical() when the stack frame and that function is exited.
Dušan> That's exactly what we are doing on the m68k platform.
Dušan> ---------- But with m68k gcc, we have a problem, when there is a
Dušan> nested NutEnterCritical. The temp variable is compiled as 2
Dušan> different registers, 1st level goes e.g. into d1, 2nd level into
Dušan> d2. Then leaving the 2nd level restores status word from d1,
Dušan> which is a problem This is why we started to use NutUseCritical
I don't see any nested NutEnterCritical in the common code. Can you point
me at such a use?
If not, I think that some form of nested critical section is a case for a
new function, but not for NutEnterCritical().
You can implement that new function for your arch as you like. Name it like
NutEnterCriticalLevel or NutEnterNestedCritical, etc.
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 1623569 ------- Fax. 06151 1623305 ---------
More information about the En-Nut-Discussion