Re: callc.c and ac13

Kurt Garloff (garloff@kg1.ping.de)
Fri, 18 Dec 1998 18:40:44 +0100


On Fri, Dec 18, 1998 at 02:10:57PM +0100, root wrote:
> one question:
> in module.h is this definition
> union
> {
> atomic_t usecount;
> long pad;
> } uc;
>
> atomic_t is
>
> #ifdef __SMP__
> typedef struct { volatile int counter; } atomic_t;
> #else
> typedef struct { int counter; } atomic_t;
> #endif
>
> an int
> does this work on a 64bit system ...because "pad"
> only a long? (32bit long vs. 64bit int??)

The other way round: int is 32bit on 64bit systems (at least on alpha),
while long is 64bits. But if we really want padding to 8byte boundary, the
pad value should of type int, too. (Or the other way: Make atomic_t long,
than we have 16byte alignment on 64bit systems.)

-- 
Kurt Garloff <K.Garloff@ping.de>  (Dortmund, FRG)
PGP key on http://student.physik.uni-dortmund.de/homepages/garloff

- 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/