summaryrefslogtreecommitdiff
path: root/benchmarks
diff options
context:
space:
mode:
Diffstat (limited to 'benchmarks')
-rw-r--r--benchmarks/ChangeLog10
-rw-r--r--benchmarks/activity-distribution.c14
-rw-r--r--benchmarks/cache.c6
-rw-r--r--benchmarks/shared-memory-distribution.c10
4 files changed, 28 insertions, 12 deletions
diff --git a/benchmarks/ChangeLog b/benchmarks/ChangeLog
index c42d4d1..f49b400 100644
--- a/benchmarks/ChangeLog
+++ b/benchmarks/ChangeLog
@@ -1,3 +1,13 @@
+2009-01-16 Neal H. Walfield <neal@gnu.org>
+
+ * activity-distribution.c (main): Use vg_thread_id_t and
+ hurd_myself, not l4_thread_id_t and l4_myself.
+ [USE_L4]: Only l4_sleep in this case.
+ * cache.c (helper_fork): Use hurd_myself, not l4_myself.
+ (main) [USE_L4]: Only call _L4_kdb in this case.
+ * shared-memory-distribution.c (main): Use vg_thread_id_t and
+ hurd_myself, not l4_thread_id_t and l4_myself.
+
2008-12-12 Neal H. Walfield <neal@gnu.org>
* cache.c (object_fill): Replace use of `struct exception_info'
diff --git a/benchmarks/activity-distribution.c b/benchmarks/activity-distribution.c
index 1710090..372849b 100644
--- a/benchmarks/activity-distribution.c
+++ b/benchmarks/activity-distribution.c
@@ -54,9 +54,9 @@ main (int argc, char *argv[])
}
bool terminate = false;
- l4_thread_id_t tids[THREADS];
+ vg_thread_id_t tids[THREADS];
for (i = 0; i < THREADS; i ++)
- tids[i] = l4_nilthread;
+ tids[i] = vg_niltid;
int available;
{
@@ -78,7 +78,7 @@ main (int argc, char *argv[])
{
uintptr_t *p = pages[0];
p[0] = offset;
- p[1] = l4_myself ();
+ p[1] = hurd_myself ();
return true;
}
@@ -86,7 +86,7 @@ main (int argc, char *argv[])
{
int w = (intptr_t) arg;
- tids[w] = l4_myself ();
+ tids[w] = hurd_myself ();
pthread_setactivity_np (activities[w]);
@@ -123,15 +123,19 @@ main (int argc, char *argv[])
for (j = 0; j < SIZE; j += PAGESIZE)
{
uintptr_t *p = buffers[i] + j;
- assertx (p[0] == j && p[1] == l4_myself (),
+ assertx (p[0] == j && p[1] == hurd_myself (),
"%x: %x =? %x, thread: %x",
p, p[0], j, p[1]);
t += * (int *) (buffers[i] + j);
}
+#ifdef USE_L4
/* 100ms. */
l4_sleep (l4_time_period (100 * 1000));
+#else
+# warning Need a sleep function.
+#endif
}
/* We need to return t, otherwise, the above loop will be
diff --git a/benchmarks/cache.c b/benchmarks/cache.c
index 40aa9f2..904d718 100644
--- a/benchmarks/cache.c
+++ b/benchmarks/cache.c
@@ -397,7 +397,7 @@ helper_fork (void)
panic ("Failed to allocate main activity");
struct vg_object_name name;
- snprintf (&name.name[0], sizeof (name.name), "main.%x", l4_myself ());
+ snprintf (&name.name[0], sizeof (name.name), "main.%x", hurd_myself ());
vg_object_name (VG_ADDR_VOID, main_activity, name);
hog_activity = storage_alloc (VG_ADDR_VOID,
@@ -406,7 +406,7 @@ helper_fork (void)
if (VG_ADDR_IS_VOID (hog_activity))
panic ("Failed to allocate hog activity");
- snprintf (&name.name[0], sizeof (name.name), "hog.%x", l4_myself ());
+ snprintf (&name.name[0], sizeof (name.name), "hog.%x", hurd_myself ());
vg_object_name (VG_ADDR_VOID, hog_activity, name);
/* We give the main thread and the hog the same priority and
@@ -1034,7 +1034,9 @@ main (int argc, char *argv[])
printf ("Object %d is at: %p (%d/%d)\n",
id, object, i[0], i[1]);
}
+#ifdef USE_L4
_L4_kdb ("");
+#endif
abort ();
}
diff --git a/benchmarks/shared-memory-distribution.c b/benchmarks/shared-memory-distribution.c
index 6267a5c..ea2429b 100644
--- a/benchmarks/shared-memory-distribution.c
+++ b/benchmarks/shared-memory-distribution.c
@@ -46,15 +46,15 @@ main (int argc, char *argv[])
VG_ADDR_VOID).addr;
bool terminate = false;
- l4_thread_id_t tids[THREADS];
+ vg_thread_id_t tids[THREADS];
for (i = 0; i < THREADS; i ++)
- tids[i] = l4_nilthread;
+ tids[i] = vg_niltid;
void *worker (void *arg)
{
int w = (intptr_t) arg;
- tids[w] = l4_myself ();
+ tids[w] = hurd_myself ();
pthread_setactivity_np (activities[w]);
@@ -77,7 +77,7 @@ main (int argc, char *argv[])
#if 0
/* ~128Hz. */
l4_sleep (l4_time_period (1 << 13));
-#elif 1
+#elif 0
l4_thread_switch (tids[rand () % THREADS]);
#endif
}
@@ -106,7 +106,7 @@ main (int argc, char *argv[])
uintptr_t next_period = 0;
for (i = 0; i < ITERATIONS; i ++)
{
- debug (0, DEBUG_BOLD ("starting iteration %d (%x)"), i, l4_myself ());
+ debug (0, DEBUG_BOLD ("starting iteration %d (%x)"), i, hurd_myself ());
struct vg_activity_info info;