[parisc-linux] 720 - some progress

Jochen Friedrich jochen@scram.de
Fri, 28 Sep 2001 10:49:00 +0200 (CEST)


Hi Jurij,

using your patch, the programs ls etc don't trap anymore, but they just
hang.

> +               if(!(regs->iir & 0xfc000000) && (((regs->iir & 0x1fe0)>>5) == 0x45)) {
> +                 /* This is MFCTL instruction */
> +                 fromcr = (regs->iir & 0x03e00000)>>21;
> +                 togr = (regs->iir & 0x1f);
> +                 /* Emulate the instruction if the read is from cr27 */
> +                 if(fromcr == 27) {
> +                   regs->gr[togr] = regs->cr27;

I guess you need to advance the PC at this place. Something like:

		regs->iaoq[0] = regs->iaoq[1];
		regs->iaoq[1] = regs->iaoq[0] + 4;

> +                   return;
> +                 }
> +               }
> +               /* Something else is wrong */

If i add these instructions, ls no longer hangs but traps again with a
trap 15. Using show_regs(), it looks like there is always a 0 loaded to
the register. So my current question is:

where does regs->cr27 get written to the stack? Does the PA-RISC CPU does
this automatically on a start of a trap or does the code in entry.S need
to do this?

Cheers,
Jochen