Harald Krapfenbauer wrote:
I'm a newbie to the MIPS architecture and I want to port some program to
I must call a function within the .text segment with 2 simple
parameters. So I figured out the following code
The code is written to the stack, the SP and the PC are then set to the
beginning of the code on the stack.
Unlike x86 architectures, the MIPS architecture generally does not have hardware
to synchronize data and instructions caches. When writing code for execution on
the MIPS processor, you need to be sure that you flush the data cache and
invalidate the instruction cache before trying to execute the code. On most MIPS
processors, you can use the SYNCI instruction to do this. Take a look at the
documentation for this instruction in "MIPS32® Architecture for Programmers
Volume II: The MIPS32® Instruction Set". It has sample code on how to properly do
this in an unprivileged application. You can get to this manual, as well as other
MIPS manuals, at:
You will need to register for a free account to download this.
You can also use the cacheflush system call to synchronize the data and
David VomLehn, firstname.lastname@example.org
The opinions expressed herein are likely mine, but might not be my employer's...
- - - - - Cisco - - - - -
This e-mail and any attachments may contain information which is confidential,
proprietary, privileged or otherwise protected by law. The information is solely
intended for the named addressee (or a person responsible for delivering it to
the addressee). If you are not the intended recipient of this message, you are
not authorized to read, print, retain, copy or disseminate this message or any
part of it. If you have received this e-mail in error, please notify the sender
immediately by return e-mail and delete it from your computer.