diff options
author | Jack Steiner <steiner@sgi.com> | 2009-06-18 01:28:32 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-18 22:04:03 +0200 |
commit | 92b39388eeb45326feb0fa8bd69dbbce66c9efbf (patch) | |
tree | f39193cc5341dfd4ed3b807f9f802c4575822a29 /drivers/misc/sgi-gru/grufault.c | |
parent | gru: cleanup gru inline functions (diff) | |
download | linux-92b39388eeb45326feb0fa8bd69dbbce66c9efbf.tar.xz linux-92b39388eeb45326feb0fa8bd69dbbce66c9efbf.zip |
gru: generic infrastructure for context options
Change the user GRU request for specifying the "task_slice" option to use
a generic infrastructure that can be expanded in the future to include
additional context options. No new capabilities are added with this
patch.
Signed-off-by: Jack Steiner <steiner@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-gru/grufault.c')
-rw-r--r-- | drivers/misc/sgi-gru/grufault.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/drivers/misc/sgi-gru/grufault.c b/drivers/misc/sgi-gru/grufault.c index cdd151b30dc7..b894b7ed9c35 100644 --- a/drivers/misc/sgi-gru/grufault.c +++ b/drivers/misc/sgi-gru/grufault.c @@ -749,18 +749,30 @@ long gru_get_gseg_statistics(unsigned long arg) * Register the current task as the user of the GSEG slice. * Needed for TLB fault interrupt targeting. */ -int gru_set_task_slice(long address) +int gru_set_context_option(unsigned long arg) { struct gru_thread_state *gts; + struct gru_set_context_option_req req; + int ret = 0; - STAT(set_task_slice); - gru_dbg(grudev, "address 0x%lx\n", address); - gts = gru_alloc_locked_gts(address); + STAT(set_context_option); + if (copy_from_user(&req, (void __user *)arg, sizeof(req))) + return -EFAULT; + gru_dbg(grudev, "op %d, gseg 0x%lx, value1 0x%lx\n", req.op, req.gseg, req.val1); + + gts = gru_alloc_locked_gts(req.gseg); if (!gts) return -EINVAL; - gts->ts_tgid_owner = current->tgid; + switch (req.op) { + case sco_gseg_owner: + /* Register the current task as the GSEG owner */ + gts->ts_tgid_owner = current->tgid; + break; + default: + ret = -EINVAL; + } gru_unlock_gts(gts); - return 0; + return ret; } |