Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 292703
b: refs/heads/master
c: e0891a9
h: refs/heads/master
i:
  292701: 7329159
  292699: 5db6115
  292695: 8c3ee4a
  292687: d51b301
  292671: 383ae9b
v: v3
  • Loading branch information
David Howells authored and H. Peter Anvin committed Feb 20, 2012
1 parent c028a59 commit 1d36f1d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 7931d493051ea9b09e4fddee2dc40b2eb88d62b9
refs/heads/master: e0891a9816316b5e05fd5b0453ffe9fd6a56f489
23 changes: 22 additions & 1 deletion trunk/include/asm-generic/getorder.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,28 @@

#include <linux/compiler.h>

/* Pure 2^n version of get_order */
/**
* get_order - Determine the allocation order of a memory size
* @size: The size for which to get the order
*
* Determine the allocation order of a particular sized block of memory. This
* is on a logarithmic scale, where:
*
* 0 -> 2^0 * PAGE_SIZE and below
* 1 -> 2^1 * PAGE_SIZE to 2^0 * PAGE_SIZE + 1
* 2 -> 2^2 * PAGE_SIZE to 2^1 * PAGE_SIZE + 1
* 3 -> 2^3 * PAGE_SIZE to 2^2 * PAGE_SIZE + 1
* 4 -> 2^4 * PAGE_SIZE to 2^3 * PAGE_SIZE + 1
* ...
*
* The order returned is used to find the smallest allocation granule required
* to hold an object of the specified size.
*
* The result is undefined if the size is 0.
*
* This function may be used to initialise variables with compile time
* evaluations of constants.
*/
static inline __attribute_const__ int get_order(unsigned long size)
{
int order;
Expand Down

0 comments on commit 1d36f1d

Please sign in to comment.