Mapping Functions on Machines without Highmem

Many architectures do not support high memory because they don't need it — 64-bit architectures head this list. However, to permit use of the above functions without having to constantly distinguish between highmem and non-highmem architectures, the kernel defines several macros that implement compatible functions in normal memory (these are also used when highmem support is disabled on highmem-capable machines).


#ifdef CONFIG_HIGHMEM #else static inline void *kmap(struct page *page) {

might_sleep(); return page_address(page);

#define kunmap(page) do { (void) (page); } while (0)

#define kmap_atomic(page, idx) page_address(page)

#define kunmap_atomic(addr, idx) do { } while (0) #endif

Continue reading here: The Slab Allocator

Was this article helpful?

0 0