00001
00002
00003
00004
00005
00006
00007
00008
#ifndef __RSBAC_RKMEM_H
00009
#define __RSBAC_RKMEM_H
00010
00011
#include <linux/init.h>
00012
#include <linux/slab.h>
00013
#include <linux/vmalloc.h>
00014
00015
#ifdef CONFIG_RSBAC_INIT_DELAY
00016
void rsbac_kmem_cache_sizes_init(
void);
00017
#else
00018
void __init
rsbac_kmem_cache_sizes_init(
void);
00019
#endif
00020
00021
00022
00023
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
00024
00025
#ifdef CONFIG_MMU
00026
#define RSBAC_MAX_KMALLOC 131072
00027
#else
00028
#ifndef CONFIG_LARGE_ALLOCS
00029 #define RSBAC_MAX_KMALLOC 1048576
00030
#else
00031
#define RSBAC_MAX_KMALLOC 33554432
00032
#endif
00033
#endif
00034
00035 #define rsbac_vmalloc(x) kmalloc(x, GFP_ATOMIC)
00036 #define rsbac_vfree(x) kfree(x)
00037
00038
00039
#else
00040
#define RSBAC_MAX_KMALLOC 8192
00041
#define rsbac_vmalloc(x) vmalloc(x)
00042
#define rsbac_vfree(x) vfree(x)
00043
#endif
00044
00045
extern void *
rsbac_kmalloc (size_t size);
00046
00047
00048
00049
00050
extern void *
rsbac_vkmalloc (size_t size,
boolean * vmalloc_used_p);
00051
00052
extern void rsbac_kfree (
const void *objp);
00053
00054
00055
00056
extern void rsbac_vkfree (
void *objp,
boolean vmalloc_used);
00057
00058
#endif