X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Fasm-x86_64%2Fpda.h;h=5642634843c472921ec08802fda4f36ca6a0ce1b;hb=fe77d4f283e840879f0e23b86a5d6a486823fdef;hp=14996d962bac782bb67c809a571647d16e5b16cb;hpb=b278240839e20fa9384ea430df463b367b90e04e;p=linux-2.6-omap-h63xx.git diff --git a/include/asm-x86_64/pda.h b/include/asm-x86_64/pda.h index 14996d962ba..5642634843c 100644 --- a/include/asm-x86_64/pda.h +++ b/include/asm-x86_64/pda.h @@ -109,6 +109,15 @@ extern struct x8664_pda _proxy_pda; #define sub_pda(field,val) pda_to_op("sub",field,val) #define or_pda(field,val) pda_to_op("or",field,val) +/* This is not atomic against other CPUs -- CPU preemption needs to be off */ +#define test_and_clear_bit_pda(bit,field) ({ \ + int old__; \ + asm volatile("btr %2,%%gs:%c3\n\tsbbl %0,%0" \ + : "=r" (old__), "+m" (_proxy_pda.field) \ + : "dIr" (bit), "i" (pda_offset(field)) : "memory"); \ + old__; \ +}) + #endif #define PDA_STACKOFFSET (5*8)