diff options
Diffstat (limited to 'drivers/staging/zsmalloc')
-rw-r--r-- | drivers/staging/zsmalloc/zsmalloc_int.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/staging/zsmalloc/zsmalloc_int.h b/drivers/staging/zsmalloc/zsmalloc_int.h index 4d66d2dd92f..ffb272f8934 100644 --- a/drivers/staging/zsmalloc/zsmalloc_int.h +++ b/drivers/staging/zsmalloc/zsmalloc_int.h | |||
@@ -39,7 +39,21 @@ | |||
39 | * Note that object index <obj_idx> is relative to system | 39 | * Note that object index <obj_idx> is relative to system |
40 | * page <PFN> it is stored in, so for each sub-page belonging | 40 | * page <PFN> it is stored in, so for each sub-page belonging |
41 | * to a zspage, obj_idx starts with 0. | 41 | * to a zspage, obj_idx starts with 0. |
42 | * | ||
43 | * This is made more complicated by various memory models and PAE. | ||
44 | */ | ||
45 | |||
46 | #ifndef MAX_PHYSMEM_BITS | ||
47 | #ifdef CONFIG_HIGHMEM64G | ||
48 | #define MAX_PHYSMEM_BITS 36 | ||
49 | #else /* !CONFIG_HIGHMEM64G */ | ||
50 | /* | ||
51 | * If this definition of MAX_PHYSMEM_BITS is used, OBJ_INDEX_BITS will just | ||
52 | * be PAGE_SHIFT | ||
42 | */ | 53 | */ |
54 | #define MAX_PHYSMEM_BITS BITS_PER_LONG | ||
55 | #endif | ||
56 | #endif | ||
43 | #define _PFN_BITS (MAX_PHYSMEM_BITS - PAGE_SHIFT) | 57 | #define _PFN_BITS (MAX_PHYSMEM_BITS - PAGE_SHIFT) |
44 | #define OBJ_INDEX_BITS (BITS_PER_LONG - _PFN_BITS) | 58 | #define OBJ_INDEX_BITS (BITS_PER_LONG - _PFN_BITS) |
45 | #define OBJ_INDEX_MASK ((_AC(1, UL) << OBJ_INDEX_BITS) - 1) | 59 | #define OBJ_INDEX_MASK ((_AC(1, UL) << OBJ_INDEX_BITS) - 1) |