[mc1322x] _rom_data_init_ branch
Mariano Alvira
mar at devl.org
Wed Jul 8 12:34:22 EDT 2009
On Fri, Jul 03, 2009 at 03:00:43PM +0300, Giandomenico Rossi wrote:
> Hello,
> While hacking start.S file I saw, on line 120, this call
> to ROM Driver:
>
> bl _rom_data_init+.-base
>
> what does it exactly initialize ?
I can't say for sure exactly what rom_data_init does --- unfortunatly
only Freescale has the answer to that.
The following:
.org 0x120
ROM_var_start: .word 0
.org 0x7ff
ROM_var_end: .word 0
reserves space for the ROM services and I believe rom_data_init does
work in this area.
You also need to set up the rom patching vectors.
>
> In my project I must use FORTH language but I have trouble when
> I try to call these ROM function.
Are you having trouble with calling rom_data_init or with ROM service
calls in general?
> Perhaps have I to initialize with the above call ?
Removing rom_data_init in the BeeStack examples did break some of the
other ROM service calls which implies that it is necessary for the at
least some of the ROM calls to work.
>
> Why add current position ( "." ) -base ?
The assembler treats the label after the bl command as relative. The
"foo + . - base" undoes this so I can branch to an absolute address
(like the location of the ROM call). To be honest, it still seems
cryptic to me now (although I remember it making sense at the
time). There is probably a more clear way to do it.
-Mar.
More information about the mc1322x
mailing list