Commit 62f75b29 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] document the macro for translating PROT_ to VM_ bits

From: Muli Ben-Yehuda <mulix@mulix.org>

Shed some much-needed light.
parent f7719648
......@@ -28,8 +28,13 @@ static inline void vm_unacct_memory(long pages)
vm_acct_memory(-pages);
}
/* Optimisation macro. */
#define _calc_vm_trans(x,bit1,bit2) \
/*
* Optimisation macro. It is equivalent to:
* (x & bit1) ? bit2 : 0
* but this version is faster.
* ("bit1" and "bit2" must be single bits)
*/
#define _calc_vm_trans(x, bit1, bit2) \
((bit1) <= (bit2) ? ((x) & (bit1)) * ((bit2) / (bit1)) \
: ((x) & (bit1)) / ((bit1) / (bit2)))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment