Subversion Repositories HelenOS

Rev

Rev 1787 | Rev 1888 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1787 Rev 1839
Line 109... Line 109...
109
        return (unative_t) rc;
109
        return (unative_t) rc;
110
       
110
       
111
    ipl = interrupts_disable();
111
    ipl = interrupts_disable();
112
    spinlock_lock(&tasks_lock);
112
    spinlock_lock(&tasks_lock);
113
    t = task_find_by_id((task_id_t) taskid_arg.value);
113
    t = task_find_by_id((task_id_t) taskid_arg.value);
114
    if (!t) {
114
    if ((!t) || (!context_check(CONTEXT, t->context))) {
115
        spinlock_unlock(&tasks_lock);
115
        spinlock_unlock(&tasks_lock);
116
        interrupts_restore(ipl);
116
        interrupts_restore(ipl);
117
        return (unative_t) ENOENT;
117
        return (unative_t) ENOENT;
118
    }
118
    }
119
   
119
   
120
    spinlock_lock(&t->lock);
120
    spinlock_lock(&t->lock);
121
    cap_set(t, cap_get(t) | caps);
121
    cap_set(t, cap_get(t) | caps);
122
    spinlock_unlock(&t->lock);
122
    spinlock_unlock(&t->lock);
123
   
123
   
124
    spinlock_unlock(&tasks_lock);
124
    spinlock_unlock(&tasks_lock);
125
   
-
 
126
 
-
 
127
   
-
 
128
    interrupts_restore(ipl);   
125
    interrupts_restore(ipl);   
129
    return 0;
126
    return 0;
130
}
127
}
131
 
128
 
132
/** Revoke capabilities from a task.
129
/** Revoke capabilities from a task.
Line 151... Line 148...
151
        return (unative_t) rc;
148
        return (unative_t) rc;
152
 
149
 
153
    ipl = interrupts_disable();
150
    ipl = interrupts_disable();
154
    spinlock_lock(&tasks_lock);
151
    spinlock_lock(&tasks_lock);
155
    t = task_find_by_id((task_id_t) taskid_arg.value);
152
    t = task_find_by_id((task_id_t) taskid_arg.value);
156
    if (!t) {
153
    if ((!t) || (!context_check(CONTEXT, t->context))) {
157
        spinlock_unlock(&tasks_lock);
154
        spinlock_unlock(&tasks_lock);
158
        interrupts_restore(ipl);
155
        interrupts_restore(ipl);
159
        return (unative_t) ENOENT;
156
        return (unative_t) ENOENT;
160
    }
157
    }
161
 
158