/* $Id: mcl_vrmem.h,v 1.1.1.1 2003/09/03 12:45:44 chneuman Exp $ */ /* * Copyright (c) 1999-2003 INRIA - Universite Paris 6 - All rights reserved * (main author: Vincent Roca - vincent.roca@inrialpes.fr) * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, * USA. */ /* * "virtual receive memory service" */ #ifndef MCL_VRMEM_H /* { */ #define MCL_VRMEM_H #ifdef VIRTUAL_RX_MEM /* * adu(du)/vrm correspondance * stored in the adu_t and du_t structs */ typedef struct vrm_info { char in_vrm; /* flag: 1 if off valid (ie. in vtm) */ u_int off; /* adu or du offset within vrmem file */ } vrm_info_t; #if 0 /* * describes each physical memory entry. * managed as a single table of vrm_cache_entry_t structs in practice. * the data pointer of the first entry gives the base address of the whole * memory block as returned by malloc. */ typedef struct { char *data; /* data block of this entry */ struct du *du; /* owner of this entry */ } vrm_cache_entry_t; #endif /* * vrmem control block */ typedef struct { /* description of the disk file */ /* data of all ADUs is stored in this file (name/fd) */ char f_name[MAX_FILE_NAME_LEN]; int f_fd; int f_len; /* current vrm file len */ /* physical receive memory area info */ u_int max_prm_size; /* max size in mem before using vrm */ u_int prm_size; /* total physical memory allocated */ #if 0 /* description of physical memory entries */ u_int entry_nb; /* actual nb of phy mem entries */ u_int entry_size; /* actual size of each pmem entry */ vrm_cache_entry_t *pmem_tab; /* first phys mem entry in tab */ /* physical memory entry management */ u_int next_index; /* next entry to use on pmem-fault */ #endif } vrm_cb_t; /* * public variables */ extern u_int mcl_vrm_cache_entry_nb; /* total number of entries in pmem */ /* NB: there should be enough phy mem entries to store all */ /* DUs of a block! Required by the current FEC codec */ /* * usefull macros */ #ifndef DEBUG #define mcl_vrm_in_vrm(mclcb,du) ((du)->vrm_info.in_vrm) /* is this du in vrm? */ #endif /* !DEBUG */ #endif /* VIRTUAL_TX_MEM */ #endif /* } MCL_VRMEM_H */