This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: docs on using free bsd API port ?
- From: "Gary D. Thomas" <gary dot thomas at mind dot be>
- To: Philippe Moutarlier <philippe at alliantnetworks dot com>
- Cc: Ecos list <ecos-discuss at sources dot redhat dot com>
- Date: 18 Jul 2003 09:01:09 -0600
- Subject: Re: [ECOS] docs on using free bsd API port ?
- Organization:
- References: <1058539829.7355.19.camel@Dragon>
On Fri, 2003-07-18 at 08:50, Philippe Moutarlier wrote:
> I am having some questions about the right way to interface with the
> stack at the interface level. For example, is it safe to use the
> if_attach function without data protection mechanism ? I found splnet
> call in if_detach but not in if_attach.
>
This is probably because if_attach is traditionally called before
interrupts are enabled. If you know this to not be the case, then
it would be prudent for you to add the spl() protection around
calls to it.
> I am also a little confused about the re-definition of malloc in kernel
> mode. Can we still use the "classic" method when interfacing with the
> stack (i.e. can I do "normal" malloc to create an ifnet before calling
> if_attach ?).
Stick with the special allocator that comes with the stack. The
standard eCos allocator is not suitable for use here.
>
> More generally, is there documentation I could refer to at that level ?
> The code itself doesn't seem to have too much of it..
Alas, there's precious little documentation here, just the code.
--
Gary D. Thomas <gary.thomas@mind.be>
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss