summaryrefslogtreecommitdiff
path: root/ruth
diff options
context:
space:
mode:
authorneal <neal>2008-02-11 10:11:43 +0000
committerneal <neal>2008-02-11 10:11:43 +0000
commit93605ed4e634759b1fbfedbecae37b783102424c (patch)
tree7ba07f187b381effa4e239863bd3207239e8fff1 /ruth
parent920dd796034cd200317095d27c47fc67d0fa5d38 (diff)
2008-02-11 Neal H. Walfield <neal@gnu.org>
* ruth.c (main): When checking the ability to get and set an activity's policy, don't use the main activity. Instead, allocate a new activity and use that.
Diffstat (limited to 'ruth')
-rw-r--r--ruth/ChangeLog6
-rw-r--r--ruth/ruth.c16
2 files changed, 17 insertions, 5 deletions
diff --git a/ruth/ChangeLog b/ruth/ChangeLog
index 8cb7fba..9bbbda1 100644
--- a/ruth/ChangeLog
+++ b/ruth/ChangeLog
@@ -1,3 +1,9 @@
+2008-02-11 Neal H. Walfield <neal@gnu.org>
+
+ * ruth.c (main): When checking the ability to get and set an
+ activity's policy, don't use the main activity. Instead, allocate
+ a new activity and use that.
+
2008-01-24 Neal H. Walfield <neal@gnu.org>
* ruth.c (main): Update use of rm_cap_read to be consistent with
diff --git a/ruth/ruth.c b/ruth/ruth.c
index fb8970c..fcd2ee7 100644
--- a/ruth/ruth.c
+++ b/ruth/ruth.c
@@ -487,26 +487,29 @@ main (int argc, char *argv[])
{
printf ("Checking activity_policy... ");
+ addr_t a = capalloc ();
+ addr_t storage = storage_alloc (activity, cap_activity_control,
+ STORAGE_LONG_LIVED, a).addr;
+
addr_t weak = capalloc ();
- error_t err = rm_cap_copy (activity, ADDR_VOID, weak, ADDR_VOID, activity,
+ error_t err = rm_cap_copy (activity, ADDR_VOID, weak, ADDR_VOID, a,
CAP_COPY_WEAKEN, CAP_PROPERTIES_VOID);
assert (! err);
struct activity_policy in, out;
-
in.sibling_rel.priority = 2;
in.sibling_rel.weight = 3;
in.child_rel = ACTIVITY_MEMORY_POLICY_VOID;
in.folios = 10000;
- err = rm_activity_policy (activity,
+ err = rm_activity_policy (a,
ACTIVITY_POLICY_SIBLING_REL_SET
| ACTIVITY_POLICY_STORAGE_SET,
in,
&out);
assert (err == 0);
- err = rm_activity_policy (activity,
+ err = rm_activity_policy (a,
0, ACTIVITY_POLICY_VOID,
&out);
assert (err == 0);
@@ -518,7 +521,7 @@ main (int argc, char *argv[])
in.sibling_rel.priority = 4;
in.sibling_rel.weight = 5;
in.folios = 10001;
- err = rm_activity_policy (activity,
+ err = rm_activity_policy (a,
ACTIVITY_POLICY_SIBLING_REL_SET
| ACTIVITY_POLICY_STORAGE_SET,
in, &out);
@@ -542,6 +545,9 @@ main (int argc, char *argv[])
assert (out.sibling_rel.weight == 5);
assert (out.folios == 10001);
+ storage_free (storage, true);
+
+ capfree (a);
capfree (weak);
printf ("ok.\n");