[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [poke 2.0] sourcery-arm-thumb2 issue
From: |
Luca Saiu |
Subject: |
Re: [poke 2.0] sourcery-arm-thumb2 issue |
Date: |
Sat, 29 Jan 2022 01:09:25 +0100 |
User-agent: |
Gnus (Gnus v5.13), GNU Emacs 28.0.50, x86_64-pc-linux-gnu |
Hello.
On 2022-01-29 at 00:26 +0100, Romain Naour wrote:
> I did a test build using poke 2.0:
> https://gitlab.com/kubu93/buildroot/-/pipelines/458944376
>
> There is only one issue with the toolchain sourcery-arm-thumb2 generating
> thum2
> instruction.
Interesting.
I think Mohammad tried to make me notice a similar thing the other
night, but I am understanding only now. It is easy to fix, in case you
want to install a small change set yourself; otherwise we can wait for
poke's next bugfix release.
> Error: value of 13865506 too large for field of 2 bytes at 72848
> Error: invalid swi expression
Now, why in the world should I use a software interrupt instruction,
which serves to crash on purpose? Well, in order to notice when control
reaches a point that is not supposed to reach. The instruction comes
from the expansion of _JITTER_ASM_CRASH , which on ARM (see
machine/arm/jitter/machine/jitter-machine.h ) is defined as
"swi 13865506" //"mov r15, #0"
The immediate is too large to fit in Thumb instructions.
Now, why did I choose that ridiculous constant which is equal to 256³
instead of something small? Probably I wanted to be sure not to
generate a valid kernel call by hazard.
The solution is replacing the 13865506 literal with something small: I
see from the documentation that any 16-bit “swi number” will fit -- I
suppose unsigned. Let us pick, arbitrarily, 1025.
The fix is on Jitter master:
http://git.ageinghacker.net/jitter/commit/?id=d715f2ea170099d537f28181cf825786a4b019ee
Could you please confirm that this solves the problem? José and the
other poke friends: this can go into the next bugfix release.
Regards,
--
Luca Saiu
* My personal web site: http://ageinghacker.net
* GNU Jitter: https://www.gnu.org/software/jitter
* GNU epsilon: https://www.gnu.org/software/epsilon
I support everyone's freedom of mocking any opinion or belief, no
matter how deeply held, with open disrespect and the same unrelented
enthusiasm of a toddler who has just learned the word "poo".
signature.asc
Description: PGP signature