/* * include/linux/kvmd.h - API for the kernel VM mapping daemon * * Copyright 2000 Jeff Garzik * * This file is subject to the terms and conditions of the GNU General Public * License. See the file COPYING in the main directory of this archive * for more details. * */ #ifndef __LINUX_KVMD_H__ #define __LINUX_KVMD_H__ #ifdef __KERNEL__ /* max number of outstanding commands for each thread */ #define KVMD_QUEUE_LEN 16 /* kvmd per-thread flags */ #define KVMD_DEDICATED (1<<0) /* one-one thread-driver mapping */ struct kvmd_command { struct list_head node; wait_queue_head_t wait; int cmd; long arg[4]; }; typedef struct { struct list_head node; struct task *tsk; int flags; wait_queue_head_t wait; spinlock_t lock; struct semaphore thr_start_sem; const char *name; atomic_t n_attach; struct kvmd_command cmd [KVMD_QUEUE_LEN]; struct list_head cmd_list; struct list_head free_list; } kvmd_t; int kvmd_open (kvmd_t **vmd_out); void kvmd_close (kvmd_t *vmd); long kvmd_alloc (kvmd_t *vmd, size_t *vaddr_out, size_t size); long kvmd_free (kvmd_t *vmd, size_t vaddr, size_t size); int kvmd_map (int rw, kvmd_t *vmd, size_t vaddr, size_t size, struct kiobuf **iobuf_out); void kvmd_unmap (kvmd_t *vmd, struct kiobuf *iobuf); #endif /* __KERNEL__ */ #endif /* __LINUX_KVMD_H__ */