avr-libc-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-libc-dev] [PATCH] Atmega256x support with bootloader handling


From: Marek Michalkiewicz
Subject: Re: [avr-libc-dev] [PATCH] Atmega256x support with bootloader handling
Date: Tue, 2 May 2006 16:15:42 +0200
User-agent: Mutt/1.5.9i

On Mon, May 01, 2006 at 09:10:10PM +0200, Björn Haase wrote:

> I have incorporated the changes according to Marek's suggestions for 
> bootloader development and fixed some small problems. E.g. the avr6 target 
> was missing in gcc's list of -mmcu= parameters.

I see you renamed pm_lo8 to pm_ns_lo8 (only lo8, no hi8) - what's that?

Currently (before the changes) the following pm_* relocs are supported:

pm_lo8() - bits 0...7 for "ldi"
pm_hi8() - bits 8...15 for "ldi"
pm_hh8() - bits 16...21 for "ldi"
pm() - bits 0...15 for ".word"

I suggested to add new ones, which insert long jumps if necessary,
and return (parts of) 16-bit pointers to these jumps.

pm16_lo8()
pm16_hi8()
pm16()

(no hh8, as these pointers are 16-bit by definition).

The pm16* names are just an example, feel free to invent better ones -
but I think we need both sets of relocs:
 - insert long jumps, return 16-bit pointers to them for use by GCC;
 - no long jumps, return parts of the true 22-bit program word address.

On <=128K devices, pm* and pm16* would always have the same effect
(true address, no jumps inserted).  Using different names for the
new functionality means that using too old version of binutils will
be caught as an error (instead of the code failing at run time, when
the program grows larger than 128K).

Another possibility (not sure if better though) would be to keep
the existing pm* names unchanged (fewer changes in GCC), but make
it possible to switch on/off the intermediate long jumps with some
assembler directives.  It would be "on" for avr6 code generated by
GCC, but you could turn it off in case you need "raw" access to
the 3-byte pointer in asm code without inserting the jumps.

Hope this helps,
Marek




reply via email to

[Prev in Thread] Current Thread [Next in Thread]