/* * Must be an lvalue. Since @var must be a simple identifier, * we force a syntax error here if it isn't. */ #define get_cpu_var(var) \ (*({ \ preempt_disable(); \ this_cpu_ptr(&var); \ }))
/* * The weird & is necessary because sparse considers (void)(var) to be * a direct dereference of percpu variable (var). */ #define put_cpu_var(var) \ do { \ (void)&(var); \ preempt_enable(); \ } while (0)
#include<linux/bootmem.h> // Allocate size number of bytes from ZONE_NORMAL. The allocation will be aligned to the L1 hardware cache to get the maximum benefit from the hardware cache void *alloc_bootmem(unsignedlong size);
// Allocate size number of bytes from ZONE_DMA. The allocation will be aligned to the L1 hardware cache void *alloc_bootmem_low(unsignedlong size);
// Allocate size number of bytes from ZONE_NORMAL aligned on a page size so that full pages will be returned to the caller void *alloc_bootmem_pages(unsignedlong size);
// Allocate size number of bytes from ZONE_DMA aligned on a page size so that full pages will be returned to the caller void *alloc_bootmem_low_pages(unsignedlong size);