lkml.org 
[lkml]   [2000]   [Jul]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: ANSI C clarifications, with citations
On Mon, Jul 03, 2000 at 06:47:54PM +0200, Rogier Wolff wrote:
> Alan Cox wrote:
> > > > Other machines included PR1ME computers which used a 32-bit word
> > > > pointer, and a 48-bit byte pointer.
> > >
> > > How did C on those machines implement a void *?
> >
> > I cant speak for the old pre mips PR1ME but for the HLH Orion that was word
> > addressed a void * was a char * and a char * was an address shifted left 2
> > with the byte number in the low 2 bits.
> >
> > You really did have to get your casting right on those.
>
> Huh? You mean that you have larger than 16 bit pointers on Pr1me?
Yes, depending on the mode (32R, 64R, 64V I believe). As far as I can recall
it was possible to switch mode at runtime (Pr1me 50 series, Pr1mos version
17..19).

> I just checked: Those 48bit pointers are actually a 12 bit segment number,
> 16 bit word address and a bit number (5 bits?) -> 1Gbyte addressing space.

I looked it up in some old PMA (Pr1me Macro Assembly) source: it has special
registers (FAR[01], FLR[01]: field address and field length registers) for
using these long pointers.

The 16 bits word containing the segment number has a fault bit (highest
bit) ring number (next 2 bits) and one bit possibly indicating it's a 48
bit pointer in some circumstances (I'm not sure, it has been a while...)
The remaining 12 bits form the segment number with a few exceptions. Plus
a 16 bit word number this basically addresses 2^28 16 bit words (0.5 GB).

The NULL pointer actually was not 0 but 017777600000, at least for the kernel.
The fault bit was used for system calls: a ring 0 pointer to a PL1 style
char()var string containing the _name_ of the function, with the fault
bit set was used in a PCL (procedure call) instruction. The kernel (or
maybe even the hardware) would fixup these addresses on their first fault.

--
Frank

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.056 / U:0.480 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site