diff options
author | Miles Bader <miles@gnu.org> | 1997-02-20 04:26:27 +0000 |
---|---|---|
committer | Miles Bader <miles@gnu.org> | 1997-02-20 04:26:27 +0000 |
commit | 5e391bd898ddd96fde1081eca92d13442d135080 (patch) | |
tree | b57a59ebb83d1963a16b6da0a407e1eb05a64f3b /libtrivfs | |
parent | 2c121ea815738661975af1e55254fd59997b8ff6 (diff) |
(trivfs_begin_using_protid):
Support dynamic protid port classes.
(trivfs_begin_using_control):
Support dynamic control port classes.
Diffstat (limited to 'libtrivfs')
-rw-r--r-- | libtrivfs/migsupport.c | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/libtrivfs/migsupport.c b/libtrivfs/migsupport.c index 66c03482..14825c18 100644 --- a/libtrivfs/migsupport.c +++ b/libtrivfs/migsupport.c @@ -1,5 +1,5 @@ /* - Copyright (C) 1994, 1995, 1996 Free Software Foundation + Copyright (C) 1994, 1995, 1996, 1997 Free Software Foundation This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as @@ -20,18 +20,23 @@ struct trivfs_protid * trivfs_begin_using_protid (mach_port_t port) { - if (trivfs_protid_nportclasses > 1) + if (trivfs_protid_nportclasses + trivfs_num_dynamic_protid_port_classes> 1) { struct port_info *pi = ports_lookup_port (0, port, 0); int i; for (i = 0; i < trivfs_protid_nportclasses; i++) if (pi->class == trivfs_protid_portclasses[i]) return (struct trivfs_protid *) pi; + for (i = 0; i < trivfs_num_dynamic_protid_port_classes; i++) + if (pi->class == trivfs_dynamic_protid_port_classes[i]) + return (struct trivfs_protid *) pi; ports_port_deref ((void *)port); return 0; } - else + else if (trivfs_protid_nportclasses == 1) return ports_lookup_port (0, port, trivfs_protid_portclasses[0]); + else + return ports_lookup_port (0, port, trivfs_dynamic_protid_port_classes[0]); } void @@ -44,18 +49,23 @@ trivfs_end_using_protid (struct trivfs_protid *cred) struct trivfs_control * trivfs_begin_using_control (mach_port_t port) { - if (trivfs_cntl_nportclasses > 1) + if (trivfs_cntl_nportclasses + trivfs_num_dynamic_control_port_classes > 1) { struct port_info *pi = ports_lookup_port (0, port, 0); int i; for (i = 0; i < trivfs_cntl_nportclasses; i++) if (pi->class == trivfs_cntl_portclasses[i]) return (struct trivfs_control *) pi; + for (i = 0; i < trivfs_num_dynamic_control_port_classes; i++) + if (pi->class == trivfs_dynamic_control_port_classes[i]) + return (struct trivfs_control *) pi; ports_port_deref ((void *)port); return 0; } - else + else if (trivfs_cntl_nportclasses == 1) return ports_lookup_port (0, port, trivfs_cntl_portclasses[0]); + else + return ports_lookup_port (0, port, trivfs_dynamic_control_port_classes[0]); } void |