This is the mail archive of the ecos-patches@sourceware.org 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: [ECOS] PowerPC HAL fix for copying exception vectors


Shaun Louie wrote:
> Shaun Louie wrote:
>> Hi,
>>
>> This patch fixes a problem I had with getting ROM firmware that uses
>> the kernel to boot properly.  The problem was that as soon as
>> interrupts were enabled (first context switch), the exception vectors
>> were not initialized (in my case, RAM is remapped to address 0x0, so
>> needs to maintain the exception vectors even though the code is
>> executing from flash) and the decrementer interrupt caused the cpu to
>> begin executing from this uninitialized memory.  The fix is to mirror
>> the compile condition with the condition defined in the
>> hal_powerpc.cdl file, where CYGSEM_HAL_POWERPC_COPY_VECTORS requires !
>> CYGSEM_HAL_USE_ROM_MONITOR, rather than ! CYG_HAL_STARTUP_ROM.  With
>> this fix, the exception vectors are copied to the RAM location, and
>> the interrupts/exceptions execute normally.
>>
>> This probably hasn't been an issue, because normally either redboot is
>> used (no kernel) or the application executes from RAM, which would
>> satisfy the original compiler condition and copy the exception vectors
>> to RAM, if so chosen.
>>
>> It might even be sufficient to drop the !
>> defined(CYGSEM_HAL_USE_ROM_MONITOR), and just have #ifdef
>> CYGSEM_HAL_POWERPC_COPY_VECTORS, since the CDL is already guarding
>> against whether CYGSEM_HAL_USE_ROM_MONITOR is defined or not.
>>   
> I've attached a new patch that does just what I suggested at the end of
> my last email.  I've also included a ChangeLog entry, which I forgot in
> the original patch.

Seems reasonable to me - applied.

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------


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