Skip to contentSkip to conversation

Disabling lwc0 instruction

DISCUSSION mansoor 2 participants 2 messages Nov 9, 2004 MIPS

lore
Share & tools
lore

mansoor

author
#0 lore raw

Hi all,

Iam working on lx4189. This core doesnt support
"lwc0" instruction but my tool chain generates
this instruction.

So when I run some applications it throws
"unknown instruction" exception.

How can solve this issue ?

I have few solutions but I dont know
whether its correct.

1) Re-build the toolchain with this instruction
disbaled. But how to do this ?.
2) Write an exception handler to handle this
instruction. The exact replacement would be
"mfc0". how to do this ?

Thanx in advance
Mansoor Ahamed Basheer

#1 lore raw
Quoted 13 lines · mansoor

Iam working on lx4189. This core doesnt support
"lwc0" instruction but my tool chain generates
this instruction.

So when I run some applications it throws
"unknown instruction" exception.

How can solve this issue ?

I have few solutions but I dont know
whether its correct.

Quoted 5 lines

1) Re-build the toolchain with this instruction
disbaled. But how to do this ?.
2) Write an exception handler to handle this
instruction. The exact replacement would be
"mfc0". how to do this ?

No. lwc0 is ll, load linked. In 2.6 define cpu_has_llsc to return 0 in your system's cpu-feature-override.h. In 2.4 disable CONFIG_CPU_HAS_LLSC.

The kernel actually has an emulation for ll/sc in applications which enables running of application code using ll/sc on ll/sc-less processors. You should try to find why this seems to fail for you. Maybe this Lexra kernel is simply super-ancient? If it's as old as it seems you should replace it as it has various exploitable security holes.

Ralf