summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles Bader <miles@gnu.org>1995-07-22 22:55:20 +0000
committerMiles Bader <miles@gnu.org>1995-07-22 22:55:20 +0000
commitffd0db10698b395f2e73573434724745f3ab08a1 (patch)
tree6896a4f023fa469b950aac5a538a70884eb2d279
parent821c437692d52cc6c819c3f2fd997df37c26e64a (diff)
(dev_get_memory_object): A new pager now comes with 1 ref, so we allocate a
ref ourselves when we're using an old one, and once we've created the send right, remove a reference.
-rw-r--r--devio/devpager.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/devio/devpager.c b/devio/devpager.c
index 9d6e4abb..02fd54ed 100644
--- a/devio/devpager.c
+++ b/devio/devpager.c
@@ -258,12 +258,16 @@ dev_get_memory_object(struct dev *dev, memory_object_t *memobj)
dev->pager =
pager_create((struct user_pager_info *)dev, dev->pager_port_bucket,
1, MEMORY_OBJECT_COPY_DELAY);
+ else
+ ports_port_ref (dev->pager);
io_state_unlock(&dev->io_state);
if (dev->pager == NULL)
return ENODEV; /* XXX ??? */
*memobj = pager_get_port(dev->pager);
+ ports_port_deref (dev->pager); /* Drop our original ref on PAGER. */
+
if (*memobj != MACH_PORT_NULL)
return
mach_port_insert_right(mach_task_self(),