diff options
| author | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
|---|---|---|
| committer | manuel <manuel@mausz.at> | 2012-03-27 11:51:08 +0200 |
| commit | 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b (patch) | |
| tree | 868c52e06f207b5ec8a3cc141f4b8b2bdfcc165c /pintos-progos/tests/vm/mmap-shuffle.c | |
| parent | eae0bd57f0a26314a94785061888d193d186944a (diff) | |
| download | progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.gz progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.tar.bz2 progos-4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b.zip | |
reorganize file structure to match the upstream requirements
Diffstat (limited to 'pintos-progos/tests/vm/mmap-shuffle.c')
| -rw-r--r-- | pintos-progos/tests/vm/mmap-shuffle.c | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/pintos-progos/tests/vm/mmap-shuffle.c b/pintos-progos/tests/vm/mmap-shuffle.c deleted file mode 100644 index 29921ad..0000000 --- a/pintos-progos/tests/vm/mmap-shuffle.c +++ /dev/null | |||
| @@ -1,38 +0,0 @@ | |||
| 1 | /* Creates a 128 kB file and repeatedly shuffles data in it | ||
| 2 | through a memory mapping. */ | ||
| 3 | |||
| 4 | #include <stdio.h> | ||
| 5 | #include <string.h> | ||
| 6 | #include <syscall.h> | ||
| 7 | #include "tests/arc4.h" | ||
| 8 | #include "tests/cksum.h" | ||
| 9 | #include "tests/lib.h" | ||
| 10 | #include "tests/main.h" | ||
| 11 | |||
| 12 | #define SIZE (128 * 1024) | ||
| 13 | |||
| 14 | static char *buf = (char *) 0x10000000; | ||
| 15 | |||
| 16 | void | ||
| 17 | test_main (void) | ||
| 18 | { | ||
| 19 | size_t i; | ||
| 20 | int handle; | ||
| 21 | |||
| 22 | /* Create file, mmap. */ | ||
| 23 | CHECK (create ("buffer", SIZE), "create \"buffer\""); | ||
| 24 | CHECK ((handle = open ("buffer")) > 1, "open \"buffer\""); | ||
| 25 | CHECK (mmap (handle, buf) != MAP_FAILED, "mmap \"buffer\""); | ||
| 26 | |||
| 27 | /* Initialize. */ | ||
| 28 | for (i = 0; i < SIZE; i++) | ||
| 29 | buf[i] = i * 257; | ||
| 30 | msg ("init: cksum=%lu", cksum (buf, SIZE)); | ||
| 31 | |||
| 32 | /* Shuffle repeatedly. */ | ||
| 33 | for (i = 0; i < 10; i++) | ||
| 34 | { | ||
| 35 | shuffle (buf, SIZE, 1); | ||
| 36 | msg ("shuffle %zu: cksum=%lu", i, cksum (buf, SIZE)); | ||
| 37 | } | ||
| 38 | } | ||
