diff options
author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2004-12-09 17:03:27 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-04-07 21:05:47 -0700 |
commit | 9b7164c565f5a246531bd40d874436156adde33f (patch) | |
tree | 9874db15f8d116983b4f1e31d34b9f781413b200 /lib.h | |
parent | Beginning infrastructure for tagged lists. (diff) | |
download | sparse-9b7164c565f5a246531bd40d874436156adde33f.tar.gz sparse-9b7164c565f5a246531bd40d874436156adde33f.tar.bz2 sparse-9b7164c565f5a246531bd40d874436156adde33f.zip |
Add macros to set/read the pointer list tags.
Diffstat (limited to 'lib.h')
-rw-r--r-- | lib.h | 9 |
1 files changed, 9 insertions, 0 deletions
@@ -410,4 +410,13 @@ extern void pack_ptr_list(struct ptr_list **); #define hashval(x) ((unsigned long)(x)) +static inline void update_tag(void *p, unsigned long tag) +{ + unsigned long *ptr = p; + *ptr = tag | (~3UL & *ptr); +} + +#define CURRENT_TAG(ptr) (3 & (unsigned long)*THIS_ADDRESS(ptr)) +#define TAG_CURRENT(ptr,val) update_tag(THIS_ADDRESS(ptr),val) + #endif |