linux-old/include/linux/vmalloc.h
<<
>>
Prefs
   1#ifndef __LINUX_VMALLOC_H
   2#define __LINUX_VMALLOC_H
   3
   4#include <linux/sched.h>
   5#include <linux/mm.h>
   6#include <linux/spinlock.h>
   7
   8#include <asm/pgtable.h>
   9
  10/* bits in vm_struct->flags */
  11#define VM_IOREMAP      0x00000001      /* ioremap() and friends */
  12#define VM_ALLOC        0x00000002      /* vmalloc() */
  13
  14struct vm_struct {
  15        unsigned long flags;
  16        void * addr;
  17        unsigned long size;
  18        struct vm_struct * next;
  19};
  20
  21extern struct vm_struct * get_vm_area (unsigned long size, unsigned long flags);
  22extern void vfree(void * addr);
  23extern void * __vmalloc (unsigned long size, int gfp_mask, pgprot_t prot);
  24extern long vread(char *buf, char *addr, unsigned long count);
  25extern void vmfree_area_pages(unsigned long address, unsigned long size);
  26extern int vmalloc_area_pages(unsigned long address, unsigned long size,
  27                              int gfp_mask, pgprot_t prot);
  28
  29/*
  30 *      Allocate any pages
  31 */
  32 
  33static inline void * vmalloc (unsigned long size)
  34{
  35        return __vmalloc(size, GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL);
  36}
  37
  38/*
  39 *      Allocate ISA addressable pages for broke crap
  40 */
  41
  42static inline void * vmalloc_dma (unsigned long size)
  43{
  44        return __vmalloc(size, GFP_KERNEL|GFP_DMA, PAGE_KERNEL);
  45}
  46
  47/*
  48 *      vmalloc 32bit PA addressable pages - eg for PCI 32bit devices
  49 */
  50 
  51static inline void * vmalloc_32(unsigned long size)
  52{
  53        return __vmalloc(size, GFP_KERNEL, PAGE_KERNEL);
  54}
  55
  56/*
  57 * vmlist_lock is a read-write spinlock that protects vmlist
  58 * Used in mm/vmalloc.c (get_vm_area() and vfree()) and fs/proc/kcore.c.
  59 */
  60extern rwlock_t vmlist_lock;
  61
  62extern struct vm_struct * vmlist;
  63#endif
  64
  65
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.