From 4f670845ff9ab6c48bcb5f7bf4d4ef6dc3c3064b Mon Sep 17 00:00:00 2001 From: manuel Date: Tue, 27 Mar 2012 11:51:08 +0200 Subject: reorganize file structure to match the upstream requirements --- pintos-progos/tests/userprog/boundary.c | 33 --------------------------------- 1 file changed, 33 deletions(-) delete mode 100644 pintos-progos/tests/userprog/boundary.c (limited to 'pintos-progos/tests/userprog/boundary.c') diff --git a/pintos-progos/tests/userprog/boundary.c b/pintos-progos/tests/userprog/boundary.c deleted file mode 100644 index 59907ec..0000000 --- a/pintos-progos/tests/userprog/boundary.c +++ /dev/null @@ -1,33 +0,0 @@ -/* Utility function for tests that try to break system calls by - passing them data that crosses from one virtual page to - another. */ - -#include -#include -#include -#include "tests/userprog/boundary.h" - -static char dst[8192]; - -/* Returns the beginning of a page. There are at least 2048 - modifiable bytes on either side of the pointer returned. */ -void * -get_boundary_area (void) -{ - char *p = (char *) ROUND_UP ((uintptr_t) dst, 4096); - if (p - dst < 2048) - p += 4096; - return p; -} - -/* Returns a copy of SRC split across the boundary between two - pages. */ -char * -copy_string_across_boundary (const char *src) -{ - char *p = get_boundary_area (); - p -= strlen (src) < 4096 ? strlen (src) / 2 : 4096; - strlcpy (p, src, 4096); - return p; -} - -- cgit v1.2.3