aboutsummaryrefslogtreecommitdiff
path: root/lib.h
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@ppc970.osdl.org>2004-12-09 17:03:27 -0700
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-04-07 21:05:47 -0700
commit9b7164c565f5a246531bd40d874436156adde33f (patch)
tree9874db15f8d116983b4f1e31d34b9f781413b200 /lib.h
parentBeginning infrastructure for tagged lists. (diff)
downloadsparse-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.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib.h b/lib.h
index 2be23ab..d388703 100644
--- a/lib.h
+++ b/lib.h
@@ -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