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: hal_diag serial driver: using XON/XOFF flow control?


Heiko Panther <hpanther@mac.com> writes:

> Hm, it might be hacking while it's not officially supported by the
> common HAL.

It will never be supported officially, we have proper serial device
drivers to do this. The HAL code is intended to provide polled-only
IO.

> Still, /dev/haldiag is a proper device driver, only that
> it relies on the HAL routines. 

/dev/haldiag is present only to give the illusion of device-level
access to the HAL IO routines, so that stdio will work through the
HAL, for example. When proper serial handling is required, switch to
a proper device driver.

> Do you suggest copying the HAL
> routines into another serial device driver?

While the work you have done in writing the HAL routines will help in
writing the serial device driver, the code cannot really be reused
since the structure of the driver is totally different.

> 
> I also get your point that the HAL driver should be as simple as
> possible. However, many HAL drivers already contain ISR support for
> CTRLC interrupts.

This is *only* there to allow GDB to interrupt a running program.

> 
> It looks to me as if there is a generally unused field in the call
> to the hal_diag ISR, a CYG_ADDRWORD __data. This could be used to
> pass a pointer to return the received char. hal_if.c:hal_ctrlc_isr()
> could then call the serial channel's rcv_char() to add the char to
> the channel's buffer.
> 
> So I see 3 minor additions: the platform HAL puts the received char
> into the space provided, the common HAL probably needs a hook for a
> serial driver to register for interrupt chars, and hal_ctrlc_isr
> needs to call a registered serial driver. Do you really think that
> would add too much complexity?

This is all totally unnecessary. If you want interrupt driven IO,
write a proper driver for it! Don't try and hack it into code that was
never intended to support it.


-- 
Nick Garnett                    eCos Kernel Architect
http://www.ecoscentric.com/     The eCos and RedBoot experts


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


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