This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: diag_printf


Pete Barrie wrote:
At 14:19 05/03/2003 -0700, you wrote:

On Wed, 2003-03-05 at 14:08, Pete Barrie wrote:
> At 13:58 05/03/2003 -0700, you wrote:
> >On Wed, 2003-03-05 at 13:53, Pete Barrie wrote:
> > > Can somebody tell me what the mutual exclusion issues are with
> > diag_printf()
> > > I cannot find anything specific in the documentation.
> >
> >What sort of issues are you thinking about?
>
> I was wondering whether it was thread-safe.
> I take it that it isn't...
>

It is because interrupts are always off for the duration of
the call to diag_printf().

Admittedly, that's not always true. If you haven't got a BSD network stack in your configuration (don't ask), and aren't doing output to GDB (using the GDB remote protocol in other words) I don't believe interrupts are disabled at all. I don't even think there's a scheduler lock. If an individual HAL console needs interrupts disabled or any other sort of mutual exclusion, it's up to it to do that if diag output is to be reliable. That includes ethernet drivers.


But really you shouldn't make use of the diag stuff heavily for application output - you should use "real" drivers.... it's only "diagnostic" after all!

Jifl
--
eCosCentric    http://www.eCosCentric.com/    The eCos and RedBoot experts
--[ "You can complain because roses have thorns, or you ]--
--[  can rejoice because thorns have roses." -Lincoln   ]-- Opinions==mine


-- Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]