[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] io.h re-org
Re: [avr-libc-dev] io.h re-org
Thu, 12 Dec 2002 20:54:08 +0100
As Theodore A. Roth wrote:
> The patch looks good, but it's too much at once. My plan (when I got
> around to it) was to do something similar but in small, incremental steps.
Well, i needed the big sweep in order to verify the build process will
complete after all the changes. And eventually, it turned out that
the EEPROM definitions for the ATmega169 are different...
Now, the changes are done.
> It's a pain, but it makes review much easier. It's not much fun trying to
> review a 2500 line diff and grok everything it does. ;-)
Most of the changes are very small, and almost identical. If all the
include file had had a uniform style, i could even have automated
this, and just have the automation tool reviewed instead of the actual
change... But the various files differ heavily in their style,
depending on the author. Thus i basically needed to edit every single
> I'd break the patch up as such:
> - move #include <avr/sfr_defs.h> from ioXXXX.h to io.h
> - move sreg
> - move SP
> - move X, Y, Z pointers
> - move eeprom
> - etc.
That'll be fairly difficult for me by now. The changes are done, and
took a good number of hours. I'd have to completely re-do them,
spending even more hours... (Editing the diff, and applying it to a
separate tree is a pain in the butt, and even more error-prone than
doing it in a single large sweep.)
I'll apply the change to another tree here, and will do some testing
with everything i've got lying around.
> Also, can you please post the patches with a ChangeLog entry?
As you know :), i'm not quite friend with the ChangeLog. :-) I always
have my difficulties, and in this case, it'd only generate numerous
. include/avr/io?*.h: remove SREG, remove SP*, remove the EEPROM
definitions, remove the X Y Z pointer definitions.
. Some include/avr/io?*.h had missing XRAMEND definitions, i added
them (for completeness, and since this serves as a decision base
to drop SPH/SP at the end of include/avr/io.h for devices with
only little RAM).
. include/avr/iom169.h: modify the EEPROM-related registers to
account for their different location in that device (#undef the
generic values, then define specific ones).
. include/avr/eeprom.h: leave a dox note about the ATmega169 being
unable to work with these library routines.
. include/avr/io.h: add all the moved definitions here, include some
magic that drops definitions unapplicable to a particular device
at the end of the file, use __COMPILING_AVR_LIBC__ as a decision
base to request `generic' functionality only when including
<avr/io.h>; document a bit more about the mechanism behind
<avr/io.h> (TODO list item).
. configure.in: add -D__COMPILING_AVR_LIBC__ to all compile flags
(C and assembler), replace use of fake -mmcu device options in
the assembler flags by generic (avr2 through avr5) options.
. libc/stdlib/malloc.c: replace the hack that created a private
stack pointer definition by the generic SP macro.
The last two items where the actual goal i wanted to achieve with the
change, all the first items are simply required for this to happen.
J"org Wunsch Unix support engineer