Subversion Repositories HelenOS

Rev

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

Rev 2899 Rev 2901
Line 166... Line 166...
166
        interrupts_restore(ipl);
166
        interrupts_restore(ipl);
167
    }
167
    }
168
}
168
}
169
 
169
 
170
void udebug_syscall_event(unative_t a1, unative_t a2, unative_t a3,
170
void udebug_syscall_event(unative_t a1, unative_t a2, unative_t a3,
171
    unative_t a4, unative_t a5, unative_t a6, unative_t id, unative_t rc)
171
    unative_t a4, unative_t a5, unative_t a6, unative_t id, unative_t rc,
-
 
172
    bool end_variant)
172
{
173
{
173
    call_t *call;
174
    call_t *call;
174
    ipl_t ipl;
175
    ipl_t ipl;
-
 
176
    udebug_event_t etype;
-
 
177
 
-
 
178
    etype = end_variant ? UDEBUG_EVENT_SYSCALL_E : UDEBUG_EVENT_SYSCALL_B;
175
 
179
 
176
    ipl = interrupts_disable();
180
    ipl = interrupts_disable();
177
    spinlock_lock(&THREAD->debug_lock);
181
    spinlock_lock(&THREAD->debug_lock);
178
 
182
 
179
    /* Must only generate events when in debugging session and have go */
183
    /* Must only generate events when in debugging session and have go */
180
    if (THREAD->debug_active != true ||
184
    if (THREAD->debug_active != true ||
181
        THREAD->debug_stop == true ||
185
        THREAD->debug_stop == true ||
182
        (TASK->debug_evmask & UDEBUG_EM_SYSCALL) == 0) {
186
        (TASK->debug_evmask & UDEBUG_EVMASK(etype)) == 0) {
183
        spinlock_unlock(&THREAD->debug_lock);
187
        spinlock_unlock(&THREAD->debug_lock);
184
        interrupts_restore(ipl);
188
        interrupts_restore(ipl);
185
        return;
189
        return;
186
    }
190
    }
187
 
191
 
188
    klog_printf("udebug_syscall_event");
192
    klog_printf("udebug_syscall_event");
189
    call = THREAD->debug_go_call;
193
    call = THREAD->debug_go_call;
190
    IPC_SET_RETVAL(call->data, 0);
194
    IPC_SET_RETVAL(call->data, 0);
191
    IPC_SET_ARG1(call->data, UDEBUG_EVENT_SYSCALL);
195
    IPC_SET_ARG1(call->data, etype);
192
    IPC_SET_ARG2(call->data, id);
196
    IPC_SET_ARG2(call->data, id);
193
    IPC_SET_ARG3(call->data, rc);
197
    IPC_SET_ARG3(call->data, rc);
194
    klog_printf("udebug_syscall_event/ipc_answer");
198
    klog_printf("udebug_syscall_event/ipc_answer");
195
 
199
 
196
    THREAD->syscall_args[0] = a1;
200
    THREAD->syscall_args[0] = a1;
Line 205... Line 209...
205
     * in case we get woken up by DEBUG_END. (At which
209
     * in case we get woken up by DEBUG_END. (At which
206
     * point it must be back to the initial true value).
210
     * point it must be back to the initial true value).
207
     */
211
     */
208
    THREAD->debug_stop = true;
212
    THREAD->debug_stop = true;
209
 
213
 
210
    THREAD->cur_event = UDEBUG_EVENT_SYSCALL;
214
    THREAD->cur_event = etype;
211
    spinlock_unlock(&THREAD->debug_lock);
215
    spinlock_unlock(&THREAD->debug_lock);
212
 
216
 
213
    spinlock_lock(&TASK->lock);
217
    spinlock_lock(&TASK->lock);
214
    ipc_answer(&TASK->answerbox, THREAD->debug_go_call);
218
    ipc_answer(&TASK->answerbox, THREAD->debug_go_call);
215
    spinlock_unlock(&TASK->lock);
219
    spinlock_unlock(&TASK->lock);