From 9b7164c565f5a246531bd40d874436156adde33f Mon Sep 17 00:00:00 2001 From: Linus Torvalds Date: Thu, 9 Dec 2004 17:03:27 -0700 Subject: [PATCH] Add macros to set/read the pointer list tags. --- lib.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/lib.h b/lib.h index 2be23ab6..d3887033 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 -- 2.11.4.GIT