summaryrefslogtreecommitdiff
path: root/ruth
diff options
context:
space:
mode:
authorneal <neal>2008-01-01 12:12:20 +0000
committerneal <neal>2008-01-01 12:12:20 +0000
commitaa02670659f00f8a13733cb473113133896679f1 (patch)
treee5863683a9b6c6990d352441df38f870f7ca7473 /ruth
parent91d93820b7d513cfbcc3fe942edfa462d190b66e (diff)
libhurd-mm/
2008-01-01 Neal H. Walfield <neal@gnu.org> * activity.h (RM_activity_properties): Rename... (RM_activity_policy): ... to this. Update users. (struct activity_memory_policy): New structure. (ACTIVITY_MEMORY_POLICY): New definition. (ACTIVITY_MEMORY_POLICY_VOID): Likewise. (struct activity_policy): New structure. (ACTIVITY_POLICY): New definition. (ACTIVITY_POLICY_VOID): Likewise. (ACTIVITY_PROPERTIES_PRIORITY_SET): Rename... (ACTIVITY_POLICY_SIBLING_REL_PRIORITY_SET): ... to this. Update users. (ACTIVITY_PROPERTIES_WEIGHT_SET): Rename... (ACTIVITY_POLICY_SIBLING_REL_WEIGHT_SET): ... to this. Update users. (ACTIVITY_PROPERTIES_STORAGE_QUOTA_SET): Rename... (ACTIVITY_POLICY_STORAGE_SET): ... to this. Update users. (ACTIVITY_PROPERTIES_ALL_SET): Rename... (ACTIVITY_POLICY_SIBLING_REL_SET): ... to this. (ACTIVITY_POLICY_CHILD_REL_PRIORITY_SET): New definition. (ACTIVITY_POLICY_CHILD_REL_WEIGHT_SET): Likewise. (ACTIVITY_POLICY_CHILD_REL_SET): Likewise. (activity_properties): Rename... (activity_policy): ... to this. Accept a structure rather than individual variables. Update callers. viengoos/ 2008-01-01 Neal H. Walfield <neal@gnu.org> * activity.h: Don't include <l4.h>, <errno.h> or <hurd/btree.h>. Include <hurd/activity.h>. (struct activity): Remove fields priority, weight and storage_quota. Replace with policy. Change folio_count to a uint32_t. Update users. * server.c (server_loop): Remove activity_properties implementation. Add activity_policy implementation. * rm.h (rm_method_id_string): Remove RM_activity_properties case. Handle RM_activity_policy. ruth/ 2008-01-01 Neal H. Walfield <neal@gnu.org> * ruth.c (main): Remove activity_properties test. Replace with activity_policy test.
Diffstat (limited to 'ruth')
-rw-r--r--ruth/ChangeLog5
-rw-r--r--ruth/ruth.c94
2 files changed, 64 insertions, 35 deletions
diff --git a/ruth/ChangeLog b/ruth/ChangeLog
index fbab39d..a941b2f 100644
--- a/ruth/ChangeLog
+++ b/ruth/ChangeLog
@@ -1,3 +1,8 @@
+2008-01-01 Neal H. Walfield <neal@gnu.org>
+
+ * ruth.c (main): Remove activity_properties test. Replace with
+ activity_policy test.
+
2007-12-25 Neal H. Walfield <neal@gnu.org>
* ruth.c (main): Change visit to be consistent with as_walk's
diff --git a/ruth/ruth.c b/ruth/ruth.c
index 522b5aa..c4fcfe1 100644
--- a/ruth/ruth.c
+++ b/ruth/ruth.c
@@ -1,23 +1,22 @@
/* ruth.c - Test server.
- Copyright (C) 2007 Free Software Foundation, Inc.
+ Copyright (C) 2007, 2008 Free Software Foundation, Inc.
Written by Neal H. Walfield <neal@gnu.org>.
This file is part of the GNU Hurd.
The GNU Hurd is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
+ modify it under the terms of the GNU General Public License as
+ published by the Free Software Foundation; either version 3 of the
+ License, or (at your option) any later version.
- The GNU Hurd is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
+ The GNU Hurd is distributed in the hope that it will be useful, but
+ WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
+ General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with the GNU C Library; if not, write to the Free
- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
- 02111-1307 USA. */
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see
+ <http://www.gnu.org/licenses/>. */
#if HAVE_CONFIG_H
#include <config.h>
@@ -505,39 +504,64 @@ main (int argc, char *argv[])
}
{
- printf ("Checking activity_properties... ");
+ printf ("Checking activity_policy... ");
- l4_word_t priority;
- l4_word_t weight;
- l4_word_t storage_quota;
+ addr_t weak = capalloc ();
+ error_t err = rm_cap_copy (activity, weak, activity,
+ CAP_COPY_WEAKEN, CAP_PROPERTIES_VOID);
+ assert (! err);
- error_t err;
- err = rm_activity_properties (activity,
- ACTIVITY_PROPERTIES_ALL_SET,
- 2, 3, 10000,
- &priority, &weight, &storage_quota);
+ 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,
+ ACTIVITY_POLICY_SIBLING_REL_SET
+ | ACTIVITY_POLICY_STORAGE_SET,
+ in,
+ &out);
assert (err == 0);
- err = rm_activity_properties (activity,
- 0,
- 0, 0, 0,
- &priority, &weight, &storage_quota);
+ err = rm_activity_policy (activity,
+ 0, ACTIVITY_POLICY_VOID,
+ &out);
assert (err == 0);
- assert (priority == 2);
- assert (weight == 3);
- assert (storage_quota == 10000);
-
- err = rm_activity_properties (activity,
- ACTIVITY_PROPERTIES_ALL_SET,
- 4, 5, 10001,
- &priority, &weight, &storage_quota);
+ assert (out.sibling_rel.priority == 2);
+ assert (out.sibling_rel.weight == 3);
+ assert (out.folios == 10000);
+
+ in.sibling_rel.priority = 4;
+ in.sibling_rel.weight = 5;
+ in.folios = 10001;
+ err = rm_activity_policy (activity,
+ ACTIVITY_POLICY_SIBLING_REL_SET
+ | ACTIVITY_POLICY_STORAGE_SET,
+ in, &out);
assert (err == 0);
/* We expect the old values. */
- assert (priority == 2);
- assert (weight == 3);
- assert (storage_quota == 10000);
+ assert (out.sibling_rel.priority == 2);
+ assert (out.sibling_rel.weight == 3);
+ assert (out.folios == 10000);
+
+ err = rm_activity_policy (weak,
+ ACTIVITY_POLICY_SIBLING_REL_SET
+ | ACTIVITY_POLICY_STORAGE_SET,
+ in, &out);
+ assert (err == EPERM);
+
+ err = rm_activity_policy (weak, 0, in, &out);
+ assert (err == 0);
+
+ assert (out.sibling_rel.priority == 4);
+ assert (out.sibling_rel.weight == 5);
+ assert (out.folios == 10001);
+
+ capfree (weak);
printf ("ok.\n");
}