- updated simulation

This commit is contained in:
cvs
2002-12-05 14:28:16 +00:00
parent 995484cc44
commit c944355198
10 changed files with 63 additions and 12 deletions

View File

@@ -166,6 +166,8 @@
#ifdef MV2600
#include "../config/mv2604/config.h"
#elif MEN_A012
#include "../config/men_824x_ali/config.h"
#else
#if (CPU == PPC603)
#include "../config/mv1603/config.h"
@@ -189,6 +191,7 @@
*/
#include "SinqHM_def.h"
#define MAX_ACTIONS 8
#define MAX_ARGS 10
#define NIL '\0'
@@ -1116,8 +1119,13 @@
taskDelay (1 * sysClkRateGet ()); /* Give lwl_server time to get going */
return True;
}
/*
**--------------------------------------------------------------------------*/
#ifdef MEN_A012
extern int Hist_base_MEN_alloc;
#endif
int sbpc_spawnSinqHM (
/* ================
*/ int spnd_flg, /* Suspend flag (arg10) */
@@ -1169,6 +1177,13 @@
return False;
}
}
#ifdef MEN_A012
/*
make sure that the memory allocation flag is properly initialized at
the first time
*/
Hist_base_MEN_alloc = 0;
#endif
printf ("Spawning SinqHM_srv ..\n TCP/IP port = %d.\n", port);
if (use_level_gen == 0) {

View File

@@ -39,6 +39,15 @@
** by Hist_base_addr.
*/
void *Hist_base_addr;
/*
** The MEN board has a divided memory architecture: below 32 MB everything
** is normal. The area above has to be allocated in a separate memory
** partition with the partition number stored in sysHighMemPart. This
** now is a flag which determines if Hist_base_addr has been allocated in
** such a way in order to be able to free it properly again.
**/
int Hist_base_MEN_alloc;
/*
** The buffer for holding a frame of data for CERCA type
** interfaces (e.g. HRPT) is pointed to by Frame_base_addr.

View File

@@ -151,7 +151,7 @@
Dbg_mask = 0;
Dbg_lev0 = 0;
Dbg_lev1 = 1;
Dbg_lev1 = 0;
Dbg_lev2 = 0;
Dbg_lev3 = 0;
Cfgn_done = 0; /* Force a configuration before we can do anything. */

View File

@@ -50,6 +50,13 @@
#include <hostLib.h>
#include <inetLib.h>
#include <sysLib.h>
#ifdef MEN_A012
/*
#include <MEN/men_typs.h>
#include <sysLib_men.h>
*/
extern PART_ID sysHighMemPart;
#endif
#include <tickLib.h>
#include <stdlib.h>
@@ -63,6 +70,8 @@
#include <unistd.h>
#include <setjmp.h>
#include <vme.h>
/*
**==================== Global Definitions =====================================
*/
@@ -1588,12 +1597,20 @@
if (n_extra_bytes != 0) free (my_rqst);
#ifdef MEN_A012
Hist_base_addr = NULL;
printf("Calling memPartAlloc with %d, %d\n",
(int)sysHighMemPart, Total_bytes);
Hist_base_addr = memPartAlloc(sysHighMemPart,Total_bytes);
Hist_base_MEN_alloc = 1;
#else
i = memFindMax (); /* Get size of biggest free memory block */
if (i > Total_bytes) {
Hist_base_addr = calloc (Total_bytes, sizeof (char));
}else {
Hist_base_addr = NULL;
}
#endif
printf("Successfully allocated %d bytes\n", Total_bytes);
if (Hist_base_addr == NULL) {
printf ("\007do_SQHM__PSD_alloc:\n"
@@ -3071,7 +3088,16 @@
/*
** Release any allocated histogram buffer
*/
free (Hist_base_addr);
#ifdef MEN_A012
if(Hist_base_MEN_alloc == 1){
memPartFree(sysHighMemPart, Hist_base_addr);
} else {
free (Hist_base_addr);
}
Hist_base_MEN_alloc = 0;
#else
free(Hist_base_addr);
#endif
Hist_base_addr = NULL;
free (Frame_base_addr);
Frame_base_addr = NULL;

View File

@@ -45,6 +45,7 @@ alias ccvx 'ccppc ' \
' -fno-for-scope -Wall -I/h -I$MEN/VXWORKS/INCLUDE/NATIVE '\
' -I$MEN/VXWORKS/INCLUDE/COM -I$MEN/VXWORKS -I. '\
' -I/home/pss123/aco/sinqhm/wind2/2.0.2/target/config/all ' \
' -I/home/pss123/aco/sinqhm/wind2/2.0.2/target/config/men_824x_ali ' \
' -I/home/pss123/aco/sinqhm/wind2/2.0.2/target/h '\
' -I/home/pss123/aco/sinqhm/wind2/2.0.2/target/src/config '\
' -I/home/pss123/aco/sinqhm/wind2/2.0.2/target/src/drv -DCPU=PPC603 '\