Patch/Bugfix for BOOTP in rtems-ss-20020205
Eric Norum
eric.norum at usask.ca
Tue Mar 19 22:43:56 UTC 2002
On Tuesday, March 19, 2002, at 04:11 PM, Thomas Doerfler wrote:
> Hi Till,
>
> sigh, you are right, free is overloaded...
>
> Where exactly is "free" and "malloc" hidden? Is it possible to
> make them available with a different name (like "__real_free"
> or so)?
>
>
The problem is that inside the BSD kernel malloc and free take different
arguments. My goal when porting the network stack to RTEMS was to make
as few changes to the BSD code as possible to make it easier to track
BSD changes. That's why I used the free/malloc macro wrappers. Perhaps
there needs to be an rtems_bsdnet_rtems_free() and
rtems_bsdnet_rtems_malloc() added to the bottom of the rtems_glue.c
source file as:
#undef malloc
#undef free
void *rtems_bsdnet_rtems_malloc(size_t size)
{
return malloc(size);
}
void rtems_bsdnet_rtems_free(void *p)
{
free(p);
}
Then the code in question in the bootp source could call the new
functions.
This isn't very clean, but merging code with such wide variations is not
easy.
--
Eric Norum <eric.norum at usask.ca>
Department of Electrical Engineering
University of Saskatchewan
Saskatoon, Canada.
Phone: (306) 966-5394 FAX: (306) 966-5407
More information about the users
mailing list