9 main(int argc
, char *argv
[])
11 #define CHUNKSIZE 8192
14 #define CHUNKS (CHUNKS1+CHUNKS2)
17 #define STARTV 0x90000000
18 char *vaddr
= (char *) STARTV
;
24 for(i
= 0; i
< CHUNKS
; i
++) {
25 v
[i
] = mmap(vaddr
, CHUNKSIZE
, PROT_READ
|PROT_WRITE
, 0, -1, 0);
26 if(v
[i
] == MAP_FAILED
) {
28 fprintf(stderr
, "mmap failed\n");
32 fprintf(stderr
, "mmap said 0x%p but i wanted 0x%p\n",
39 #define DEV_ZERO "/dev/zero"
40 if((fd
=open(DEV_ZERO
, O_RDONLY
)) < 0) {
42 fprintf(stderr
, "open failed for %s\n", DEV_ZERO
);
46 #define TOTAL1 (CHUNKS1*CHUNKSIZE)
47 /* Make single read cross region boundary. */
48 if((l
=read(fd
, v
[0], TOTAL1
)) != TOTAL1
) {
49 fprintf(stderr
, "read %d but expected %d\n", l
, TOTAL1
);
53 /* Force single copy to cross region boundary. */
56 t
= v
[CHUNKS1
]+CHUNKSIZE
-2;
57 if((l
=read(fd
, t
, CHUNKSIZE
)) != CHUNKSIZE
) {
58 fprintf(stderr
, "read %d but expected %d\n", l
, CHUNKSIZE
);