HP3000-L Archives

September 1997, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Stan Sieler <[log in to unmask]>
Reply To:
Stan Sieler <[log in to unmask]>
Date:
Fri, 5 Sep 1997 16:29:17 -0700
Content-Type:
text/plain
Parts/Attachments:
text/plain (49 lines)
Mark writes:
...
> int getccr(void)
>   {
>   /*
>    * Get the coprocessor control register.
>    */

    GETPRIVMODE ();   /* unless caller was already in priv mode */

>   return get_control_reg(10) & 0xff;
>   }

...

>   /*
>    * Get the address of the IVA.
>    */

You're about to get the address of the "monarch's" IVA (Interrupt Vector
Address) ... there's one IVA per CPU.

>   LONGPOINTER lptr = _get_monarch_model();
>
>   lptr.offset += 6 * sizeof(int);
>
>   asm("ldw %0, %%r31" : : "m" (lptr.offset));
>   asm("ldw %0, %%r28" : : "m" (lptr.spaceid));
>   asm("mtsp %r28,%sr1");
>   asm("ldw 0(%sr1,%r31), %r28");
>   }

Note: _get_monarch_model requires the caller to be in priv mode,
and the data area that _get_monarch_model returns a pointer to also
requires priv mode to be able to read the data.

Mark...thanks for the 64-bit pointer example, too!

BTW, the result of the final LDW should be treated as follows:

   0 = PA-RISC 1.0
   4 = PA-RISC 1.1

I don't currently know any other values, but suspect there must be some :)

--
Stan Sieler                                          [log in to unmask]
                                     http://www.allegro.com/sieler.html

ATOM RSS1 RSS2