debuggers.hg

view tools/memshr/shm.h @ 22848:6341fe0f4e5a

Added tag 4.1.0-rc2 for changeset 9dca60d88c63
author Keir Fraser <keir@xen.org>
date Tue Jan 25 14:06:55 2011 +0000 (2011-01-25)
parents 47ec2d131c22
children
line source
1 /******************************************************************************
2 *
3 * Copyright (c) 2009 Citrix Systems, Inc. (Grzegorz Milos)
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19 #ifndef __SHM_H__
20 #define __SHM_H__
22 #include <pthread.h>
23 #include <unistd.h>
25 #define MAX_NAME_LEN 1000
27 typedef struct vbd_image_info {
28 char file[MAX_NAME_LEN];
29 int ref_cnt;
30 uint16_t next;
31 uint16_t prev;
32 } vbd_image_info_t;
34 #define MAX_NR_VBD_IMAGES 4096
36 typedef struct shared_memshr_info {
37 unsigned long magic;
38 pthread_mutex_t lock;
39 int fgprtshr_hash_inited;
40 int blockshr_hash_inited;
41 vbd_image_info_t vbd_images[MAX_NR_VBD_IMAGES];
42 } shared_memshr_info_t;
44 shared_memshr_info_t * shm_shared_info_open(int unlink);
45 struct fgprtshr_hash * shm_fgprtshr_hash_open(int unlink);
46 struct blockshr_hash * shm_blockshr_hash_open(int unlink);
47 uint16_t shm_vbd_image_get(char* file, vbd_image_info_t *vbd_imgs);
48 void shm_vbd_image_put(uint16_t memshr_id, vbd_image_info_t *vbd_imgs);
50 #endif /* __SHM_H__ */