diff options
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) | |||
749 | * Register the current task as the user of the GSEG slice. | 749 | * Register the current task as the user of the GSEG slice. |
750 | * Needed for TLB fault interrupt targeting. | 750 | * Needed for TLB fault interrupt targeting. |
751 | */ | 751 | */ |
752 | int gru_set_task_slice(long address) | 752 | int gru_set_context_option(unsigned long arg) |
753 | { | 753 | { |
754 | struct gru_thread_state *gts; | 754 | struct gru_thread_state *gts; |
755 | struct gru_set_context_option_req req; | ||
756 | int ret = 0; | ||
755 | 757 | ||
756 | STAT(set_task_slice); | 758 | STAT(set_context_option); |
757 | gru_dbg(grudev, "address 0x%lx\n", address); | 759 | if (copy_from_user(&req, (void __user *)arg, sizeof(req))) |
758 | gts = gru_alloc_locked_gts(address); | 760 | return -EFAULT; |
761 | gru_dbg(grudev, "op %d, gseg 0x%lx, value1 0x%lx\n", req.op, req.gseg, req.val1); | ||
762 | |||
763 | gts = gru_alloc_locked_gts(req.gseg); | ||
759 | if (!gts) | 764 | if (!gts) |
760 | return -EINVAL; | 765 | return -EINVAL; |
761 | 766 | ||
762 | gts->ts_tgid_owner = current->tgid; | 767 | switch (req.op) { |
768 | case sco_gseg_owner: | ||
769 | /* Register the current task as the GSEG owner */ | ||
770 | gts->ts_tgid_owner = current->tgid; | ||
771 | break; | ||
772 | default: | ||
773 | ret = -EINVAL; | ||
774 | } | ||
763 | gru_unlock_gts(gts); | 775 | gru_unlock_gts(gts); |
764 | 776 | ||
765 | return 0; | 777 | return ret; |
766 | } | 778 | } |