Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Special Dataype

7 views
Skip to first unread message

Bhaktavatsalam Nallanthighal

unread,
Jan 5, 2010, 11:52:27 PM1/5/10
to
Hello,

This is regarding the uint64_t datatype in minix operating system. It
is defined in the minix source code, as shown:

typedef struct { uint32_t _[2]; } uint64_t;

Is the _ used in this case a special one? I mean if I add two
uint64_t's on a 32-bit processor, will I have to write my own
functions to add, subtract, etc [to solve issues will cascading carry
etc.]? Or is _ a special one that compilers will automatically handle
for me?

If possible, responses to this question via email to
bhaktava...@gmail.com will be appreciated.

Thanks in advance!
Bhaktavatsalam Nallanthighal

Antoine Leca

unread,
Jan 7, 2010, 5:03:52 AM1/7/10
to
Bhaktavatsalam Nallanthighal wrote:
> This is regarding the uint64_t datatype in minix operating system. It
> is defined in the minix source code, as shown:
>
> typedef struct { uint32_t _[2]; } uint64_t;
>
> Is the _ used in this case a special one?

Not more special than "a" or "foo".

Also, more recent versions of Minix have it defined as
typedef struct { uint32_t lo,hi; } uint64_t;

> I mean if I add two uint64_t's on a 32-bit processor, will
> I have to write my own functions to add, subtract, etc

Almost. The whole issue comes from the lack of 64-bit arithmetic to be
implemented in the 80's C compilers used by Minix.

As a special attention to you, Minix have library functions to the
effect you described above; use
#include <minix/u64.h>
to access them (just use the BSD version of the types, ie u64_t instead
of uint64_t; but they are the same thing with two different names.)
So you do not have to write the functions, but you do have to use
functions for each and every operation.


> If possible, responses to this question via email to

> <del...@gmail.com> will be appreciated.

Subscribing to Minix3 Google groups will provide you this copy as a free
by-product. Plus much more traffic.
Also, you really should NOT put your email address on a public forum
like Usenet, chances it will get spammed in the near future are high.


Antoine

0 new messages