[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Point where target instructions are read
|
From: |
Peter Maydell |
|
Subject: |
Re: Point where target instructions are read |
|
Date: |
Thu, 4 Apr 2024 09:53:45 +0100 |
On Wed, 3 Apr 2024 at 23:40, Richard Henderson
<richard.henderson@linaro.org> wrote:
>
> On 4/3/24 08:15, Gautam Bhat wrote:
> > Here simple_test.bin is the raw binary file converted using objcopy.
> > addr=0xFFFE is the vector location where the PC will load with the
> > starting address.
> >
> > Now how do I load the address in that reset vector location and set my
> > PC? Is there some example code that I can look at?
>
> Hmm. I can't find an example. I see a TODO for m68k which *should* be
> loading the pc
> from the reset vector on reset.
Arm M profile does this.
> The loader device populates ram during the reset hold phase, so I believe you
> need to wait
> until after that is complete to perform the load, thus the reset_exit hook.
This will not work (yet) -- CPUs do not get reset as part of the
whole-system three-phase-reset, so using the exit phase method
is not sufficient to avoid the reset ordering problem here.
You need to use rom_ptr_for_as() to see if there's a ROM blob
at the address you're trying to load the PC from, and if there
is you use ldl_p() to get the PC from the blob; otherwise you
use ldl_phys(). Searching for "initial_pc" in target/arm/cpu.c
will find you the code that does this for M-profile.
thanks
-- PMM
- Point where target instructions are read, Gautam Bhat, 2024/04/01
- Re: Point where target instructions are read, Richard Henderson, 2024/04/01
- Re: Point where target instructions are read, Gautam Bhat, 2024/04/03
- Re: Point where target instructions are read, BALATON Zoltan, 2024/04/03
- Re: Point where target instructions are read, Richard Henderson, 2024/04/03
- Re: Point where target instructions are read,
Peter Maydell <=
- Re: Point where target instructions are read, Gautam Bhat, 2024/04/08
- Re: Point where target instructions are read, Peter Maydell, 2024/04/09
- Re: Point where target instructions are read, Gautam Bhat, 2024/04/10
- Re: Point where target instructions are read, Gautam Bhat, 2024/04/13