[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
single element struct in the kernel
Hi
The kernel seems to have many structs defined with just
a single element in them. Is it for encapsulation/abstraction ?.
In asm-i386/system.h:
struct __xchg_dummy { unsigned long a[100]; };
#define __xg(x) ((struct __xchg_dummy *)(x))
What is the rationale behind cast to a struct * when a cast to
ulong * was enough (see __xchg() && __cmpxchg() in the
same file) ? What is special about a[100] ?.
regards
Chandran
____________________________________________________________
Get advanced SPAM filtering on Webmail or POP Mail ... Get Lycos Mail!
http://login.mail.lycos.com/r/referral?aid=27005
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/