EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: RE: Changes for RTEMS on ARM (at91rm9200ek)
From: "Jeff Hill" <[email protected]>
To: "'Ralph Lange'" <[email protected]>, "'Eric Norum'" <[email protected]>
Cc: "'EPICS Core Talk'" <[email protected]>, "'Ralf Hartmann'" <[email protected]>
Date: Wed, 20 Sep 2006 11:27:40 -0600
> (Waiting for Jeff to approve the changes in osdNetIntf.c)

After a very quick look I have these comments:

1) I think I see that the data structure for the first network interface is
skipped over (never seen) because of the following sequence of events. On
many, but not all, UNIX-like systems the first interface might be the
loopback interface. That might explain why this hasn't been observed to be a
problem?

O pIfreqList = (struct ifreq *) calloc ( nelem, sizeof(*pifreq) );
O the ioctl copies the struct ifreq data structures to pIfreqList 
O pifreq = pIfreqList; //the for loop initializer
O pnextifreq = ifreqNext (pifreq); 
O // oops! skipped over the first network interface
O memmove(pIfreqList, pnextifreq, current_ifreqsize);
O use pIfreqList to look at the current struct ifreq
O pifreq = pnextifreq //for loop increment

2) Do we need the same type of changes also in osiLocalAddr?

3) At line 120 this code was added. Similar code is also at line 43. Perhaps
this code could be repackaged into a common function - a wrapper for the osd
ifreq_size() with the goal being that the wrapper is the only caller of OSD
ifreq_size()? Otherwise we could move this code into OSD ifreq_size() but
that would probably be a less fault tolerant approach (mistakes made by a
programmers porting to new os are what we might be concerned about).

	        if ( current_ifreqsize < sizeof ( *pifreq ) ) {
		       current_ifreqsize = sizeof ( *pifreq );
	        }

Jeff

> -----Original Message-----
> From: Ralph Lange [mailto:[email protected]]
> Sent: Wednesday, September 20, 2006 8:40 AM
> To: Eric Norum
> Cc: EPICS Core Talk; Ralf Hartmann
> Subject: Re: Changes for RTEMS on ARM (at91rm9200ek)
> 
> Thanks Eric,
> 
> using the bsdnet_config value for malloc() was obviously a stupid left-
> over.
> I also removed the ifdef'd code (which was only left for comparison,
> anyway).
> 
> I committed this fix and added all changes except the osdNetIntf.c stuff
> to the CVS trunk.
> (Waiting for Jeff to approve the changes in osdNetIntf.c)
> 
> Cheers,
> Ralph
> 
> 
> Eric Norum wrote:
> > The code in rtems_init.c looks a little weird.  Space is allocated
> > based on the length of rtems_bsdnet_config.hostname, but then used
> > with the length of whatever gethostname() returns.
> >
> > I think that it would be better to:
> >     {
> >         char hostname[1024];
> >         gethostname(hostname, 1023);
> >         char *cp = mustMalloc(strlen(hostname)+3, "iocsh prompt");
> >         sprintf(cp, "%s> ", hostname);
> >         epicsEnvSet ("IOCSH_PS1", cp);
> >         epicsEnvSet("IOC_NAME", hostname);
> >     }
> >
> > And get rid of the ifdef'd out code, too....
> >
> > On Sep 19, 2006, at 11:26 AM, Ralph Lange wrote:
> >
> >> Hi Jeff, Eric,
> >>
> >> I have commited changes for our RTEMS on ARM board to the 3.14 branch
> >> of the CVS.
> >> These include
> >>
> >>    * a new Makefile snippet in configure/os
> >>    * the change in libCom/osi/os/default/osdNetIntf.c to align the
> >>      ifreq buffer
> >>    * a change in libCom/osi/os/RTEMS/osdVME.h
> >>    * changes in src/RTEMS/base (rtems_init.c and rtems_config.c)
> >>
> >> Please have a look and tell me if these changes are acceptable.
> >> I didn't commit the them to the CVS trunk yet - will do as soon as
> >> you approve.
> >>
> >> Thanks a lot!
> >>
> >> Ralph


Replies:
Re: Changes for RTEMS on ARM (at91rm9200ek) Ralph Lange
References:
Re: Changes for RTEMS on ARM (at91rm9200ek) Ralph Lange

Navigate by Date:
Prev: Re: Changes for RTEMS on ARM (at91rm9200ek) Ralph Lange
Next: Re: Changes for RTEMS on ARM (at91rm9200ek) Ralph Lange
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Changes for RTEMS on ARM (at91rm9200ek) Ralph Lange
Next: Re: Changes for RTEMS on ARM (at91rm9200ek) Ralph Lange
Index: 2002  2003  2004  2005  <20062007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 02 Feb 2012 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·