It feels as though this should be able to be cleanly modelled with a
single global state array
BOOLEAN mSavedInterruptState[TPL_HIGH_LEVEL]
(or possibly a bitmask, though using the array avoids having to disable
interrupts just to write a value).
I still need to think through the subtleties, to make sure it could cope
with pathological edge cases such as
OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL);
...
gBS->RestoreTPL (OldTpl);
gBS->RestoreTPL (OldTpl);
or
OldTpl = gBS->RaiseTPL (TPL_HIGH_LEVEL - 1);
gBS->RaiseTPL (TPL_HIGH_LEVEL);
..
gBS->RestoreTPL (OldTpl);
I think that at least one of the above pathological usage patterns would
break the existing mInterruptedTplMask patches, since they currently
clear state in RestoreTPL() and so will not correctly handle a duplicate
call to RestoreTPL().
I'll try to get a patch put together over the weekend.
Thanks,
Michael
You receive all messages sent to this group.
View/Reply Online (#116238) |
|
Mute This Topic
| New Topic
Your Subscription |
Contact Group Owner |
Unsubscribe
[rebecca@openfw.io]