On Thursday 14 June 2012 21:39:18 Stéphane Lesage wrote:
> Le 14/06/2012 05:11, Charles Manning a écrit :
> >>1. Minor fixes:
> >
> >I have incorporated most of these and will check them a bit further.
>
> OK
>
> >>2. string functions macros with yaffs_ prefix
> >
> > I moved away from yaffs_strxxx prefixing in the core code because the
> > pkernel people did not like it.
> > I have changed the way the Yaffs Direct stuff handles the common code.
> > The old way used links. The new way uses a script which copies the files
> > and uses sed to modify the strxxx functions.
> > This also now changes all loff_t to Y_LOFF_T to allow the substitution
> > of 32-bit loff_t instead of 64-bit lott_f.
> > This script is executed in the direct directory:
> > cd yaffs2/direct
> > ./handle_common.sh copy
>
> Ok, you are constrained by the kernel.
> But embedded world does not necessary have the tools to execute your script
> (I don't). In LwIP for example, the user must implement all the necessary
> stuff in 2 header files (compiler/platform and options)
The idea of using this script is as follows:
Fetch the code from git.
Run the script. This generates the sources to then use in your project. The
script is then no longer needed.
Why do you not have the facilities to run the script? Even under Windows you
can use Cygwin or similar to do this.
>
> Then I suggest another way:
>
> remove all yaffs_ prefixes in the direct FS.
> Let the user define/include/declare the functions himself in the yaffscfg.h
There are other reasons to do this too. For example, when compiling for wchar
(eg. Windows CE), then the yaffs_strxxx must map to different function names.
>
> Same for lott_f, I just typedef it in yaffscfg.h
> (along with mode_t, off_t and dev_t which I don't have)
>
> >>3. Patch for more customization of ydirectenv.h from user defined
> >>configuration in yaffscg.h, and remove debug functions
> >
> >I will modify this along with some other changes I am making.
>
> OK.
> The idea is to have a single point (yaffscfg.h) to port to the user
> platform: - to be able to remove useless stuff in embedded environment
> release (trace/BUG) - or removing unnecessary function calls. For example:
> #define Y_CURRENT_TIME time()
> #define Y_CURRENT_TIME 0
>
> There's more to do here with the duplicated get/set error functions,
> which could be defined to errno if available on the platform.
Yes, thanks for that.
I am re-modularising the code to make the porting easier. One of these tasks
is to consolidate all the user/porting tweaks to make this easier.
-- CHarles