diff options
author | codeworkx <codeworkx@cyanogenmod.com> | 2012-09-17 17:53:57 +0200 |
---|---|---|
committer | codeworkx <codeworkx@cyanogenmod.com> | 2012-09-18 16:31:59 +0200 |
commit | c28265764ec6ad9995eb0c761a376ffc9f141fcd (patch) | |
tree | 3ad899757480d47deb2be6011509a4243e8e0dc2 /drivers/interceptor/kernel_alloc.h | |
parent | 0ddbcb39c0dc0318f68d858f25a96a074142af2f (diff) | |
download | kernel_samsung_smdk4412-c28265764ec6ad9995eb0c761a376ffc9f141fcd.zip kernel_samsung_smdk4412-c28265764ec6ad9995eb0c761a376ffc9f141fcd.tar.gz kernel_samsung_smdk4412-c28265764ec6ad9995eb0c761a376ffc9f141fcd.tar.bz2 |
applied patches from i9305 jb sources, updated mali to r3p0
Change-Id: Iec4bc4e2fb59e2cf5b4d25568a644d4e3719565e
Diffstat (limited to 'drivers/interceptor/kernel_alloc.h')
-rw-r--r-- | drivers/interceptor/kernel_alloc.h | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/drivers/interceptor/kernel_alloc.h b/drivers/interceptor/kernel_alloc.h new file mode 100644 index 0000000..c722bf8 --- /dev/null +++ b/drivers/interceptor/kernel_alloc.h @@ -0,0 +1,44 @@ +/* Netfilter Driver for IPSec VPN Client + * + * Copyright(c) 2012 Samsung Electronics + * + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + */ + +/* + * kernel_alloc.h + * + * Kernel memory allocation API. + * + */ + +#ifndef KERNEL_ALLOC_H +#define KERNEL_ALLOC_H + +/* Allocate 'size' amount of memory, with the 'flag' + parameters. Returns a NULL value if the allocation request cannot + be satisfied for some reason. + + Notice: 'flag' is nothing more than a hint to the allocator. The + allocator is free to ignore 'flag'. The allocatee is free to + specify flag as ssh_rand() number, and the returned memory must still + have the same semantics as any other memory block allocated. */ +void *ssh_kernel_alloc(size_t size, SshUInt32 flag); + +/* Flag is or-ed together of the following flags. */ +#define SSH_KERNEL_ALLOC_NOWAIT 0x0000 /* allocation/use atomic. */ +#define SSH_KERNEL_ALLOC_WAIT 0x0001 /* allow sleeping alloc/use. */ +#define SSH_KERNEL_ALLOC_DMA 0x0002 /* allow DMA use. */ +/* Other bits are usable for other purposes? */ + +/* Frees a previously allocated block of memory. */ +void ssh_kernel_free(void *ptr); + +#ifdef DEBUG_LIGHT +#define KERNEL_ALLOC_USE_FUNCTIONS +#endif /* DEBUG_LIGHT */ + +#endif /* KERNEL_ALLOC_H */ |