This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

RE: ARM vectors.S question. Thank you.


Thank you very eric.
In the linker script file the memory map is :

memory map:
    SECTION_fixed_vectors (ram, 0x20, LMA_EQ_VMA)
    SECTION_rom_vectors (ram, 0x40000, LMA_EQ_VMA)
    SECTION_text (ram, ALIGN (0x4), LMA_EQ_VMA)

ARM vectors.S
................
        ldr     r1,=__exception_handlers
        // **Question 1** Is r1 = 0x40000 here ???
..........

#ifdef CYGHWR_HAL_ARM_ICE_THREAD_SUPPORT

        ldr     r2,=ice_thread_vector
        // **Question 2** by here what is value of r2 by now, is
r2=0x20+offset(ice_thread_vector to fixed_vectors) ???? Is this Correct???

        sub     r2,r2,r1        // compute fixed (low memory) address
        // **Question 3** if the above correct why this is needed??? what is
value of r2=r2-r1 ??  r2 = r2-0x40000??? what is going here, how the address
is defined??

        ldr     r3,=0x4D494345  // 'MICE'
        str     r3,[r2],#4
        ldr     r3,=hal_arm_ice_thread_handler
        str     r3,[r2],#4
        mov     r3,#1
        str     r3,[r2],#4
        ldr     r3,=0x47444220  // 'GDB '
        str     r3,[r2],#4
#endif // CYGHWR_HAL_ARM_ICE_THREAD_SUPPORT


The "ice_thread_vector" is within section "fixed_vectors", so for question
what is the address of "ice_thread_vector" in code " ldr
r2,=ice_thread_vector" ( r2=0x20+offset(ice_thread_vector to fixed_vectors)
correct?) ?  I check the final image using arm-elf-objdump -D a.out and
found out the value to be loaded into r2 is "150", so how can the code "sub
r2,r2,r1        // compute fixed (low memory) address" calculate the
address? thanks a lot






Thanks a lot.


-----Original Message-----
From: ecos-discuss-owner@sources.redhat.com
[mailto:ecos-discuss-owner@sources.redhat.com]On Behalf Of Eric de Jong
Sent: 23 June 2003 08:50
To: Ecos-Discuss
Subject: Re: [ECOS] ARM vectors.S question. Thank you.



>>        ldr     r1,=__exception_handlers
>>        // **Question 1** Is r1 = 0x40000 here ???

see the following code:
----
        .code   32
        .section ".vectors","ax"

// This macro allows platforms to add their own code at the very start of
// the image.  This may be required in some circumstances where eCos ROM
// based code does not run immediately upon reset and/or when some sort of
// special header is required at the start of the image.
#ifdef PLATFORM_PREAMBLE
        PLATFORM_PREAMBLE
#endif

        .global __exception_handlers
__exception_handlers:
----

this shows the definition of the __exception_handlers
(__exception_handlers:)
which is a label and is translated to the address of the following code.
The line .code   32 and .section ".vectors","ax" makes that the following
code
is located in section  ".vectors". That section is placed by the linker at a
specific addres specified in the target.ld file.

Eric


--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


-- 
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]