bufdma_rand.c
1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#include "pi_util.h"
#include "pi_tests.h"
void IoTestBufDma(char *flashInitFileName,int verify)
{
int dramSize;
u32 dramStartAddr;
char *s;
unsigned int seed;
int i;
FILE *fp;
do_keep_alive_socket(1);
/* some log output settings hardcoded for now */
Dflags |= DLOG | DSTATUS | DERROR;
/* XXX: assume we're in secure mode */
s = (char *)getenv("IOSIM_SEED");
if(s==NULL){
seed = getpid();
}
else{
seed = atoi(s);
}
srand(seed);
printf("Random Seed = %08x.\n",seed);
s = (char *)getenv("IOSIM_ADDR");
if(s==NULL){
printf("IOSIM_ADDR not defined...\n");
printf("Random PI Buffer DMA test: ");
OUTPUT_TEST_PASSFAIL(TESTERROR);
return;
}
dramStartAddr = (u32)atoi(s);
s = (char *)getenv("IOSIM_MEM_SIZE");
if(s==NULL){
printf("IOSIM_MEM_SIZE not defined...\n");
printf("Random PI Buffer DMA test: ");
OUTPUT_TEST_PASSFAIL(TESTERROR);
return;
}
dramSize = (u32)atoi(s);
piBufDmaRand(dramStartAddr,dramSize,verify);
do_keep_alive_socket(0);
}