Subversion Repositories HelenOS

Rev

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

Rev 2873 Rev 2874
Line 12... Line 12...
12
#include <errno.h>
12
#include <errno.h>
13
#include <udebug.h>
13
#include <udebug.h>
14
#include <async.h>
14
#include <async.h>
15
 
15
 
16
#include "syscalls.h"
16
#include "syscalls.h"
17
#include "ipc.h"
17
#include "ipcp.h"
18
#include "errors.h"
18
#include "errors.h"
19
#include "debug_api.h"
19
#include "debug_api.h"
20
 
20
 
21
#define THBUF_SIZE 64
21
#define THBUF_SIZE 64
22
unsigned thread_hash_buf[THBUF_SIZE];
22
unsigned thread_hash_buf[THBUF_SIZE];
Line 127... Line 127...
127
    IPC_SET_ARG2(call, sc_args[3]);
127
    IPC_SET_ARG2(call, sc_args[3]);
128
    IPC_SET_ARG3(call, sc_args[4]);
128
    IPC_SET_ARG3(call, sc_args[4]);
129
    IPC_SET_ARG4(call, sc_args[5]);
129
    IPC_SET_ARG4(call, sc_args[5]);
130
    IPC_SET_ARG5(call, 0);
130
    IPC_SET_ARG5(call, 0);
131
 
131
 
132
    ipc_parse_call_out(phoneid, &call, sc_rc);
132
    ipcp_call_out(phoneid, &call, sc_rc);
133
}
133
}
134
 
134
 
135
void sc_ipc_call_async_slow(unsigned *sc_args, int sc_rc)
135
void sc_ipc_call_async_slow(unsigned *sc_args, int sc_rc)
136
{
136
{
137
    ipc_call_t call;
137
    ipc_call_t call;
Line 142... Line 142...
142
 
142
 
143
    memset(&call, 0, sizeof(call));
143
    memset(&call, 0, sizeof(call));
144
    rc = debug_mem_read(phoneid, &call.args, sc_args[1], sizeof(call.args));
144
    rc = debug_mem_read(phoneid, &call.args, sc_args[1], sizeof(call.args));
145
 
145
 
146
    if (rc >= 0) {
146
    if (rc >= 0) {
147
        ipc_parse_call_out(sc_args[0], &call, sc_rc);
147
        ipcp_call_out(sc_args[0], &call, sc_rc);
148
    }
148
    }
149
}
149
}
150
 
150
 
151
void sc_ipc_call_sync_fast(unsigned *sc_args)
151
void sc_ipc_call_sync_fast(unsigned *sc_args)
152
{
152
{
Line 170... Line 170...
170
        phoneid, &reply.args, sc_args[5], sizeof(reply.args));
170
        phoneid, &reply.args, sc_args[5], sizeof(reply.args));
171
    rc = debug_mem_read(phoneid, &reply.args, sc_args[5], sizeof(reply.args));
171
    rc = debug_mem_read(phoneid, &reply.args, sc_args[5], sizeof(reply.args));
172
    printf("dmr->%d\n", rc);
172
    printf("dmr->%d\n", rc);
173
    if (rc < 0) return;
173
    if (rc < 0) return;
174
 
174
 
175
    printf("call ipc_parse_call_sync\n");
175
    printf("call ipc_call_sync\n");
176
    ipc_parse_call_sync(phoneidx, &question, &reply);
176
    ipcp_call_sync(phoneidx, &question, &reply);
177
}
177
}
178
 
178
 
179
void sc_ipc_call_sync_slow(unsigned *sc_args)
179
void sc_ipc_call_sync_slow(unsigned *sc_args)
180
{
180
{
181
    ipc_call_t question, reply;
181
    ipc_call_t question, reply;
Line 189... Line 189...
189
    memset(&reply, 0, sizeof(reply));
189
    memset(&reply, 0, sizeof(reply));
190
    rc = debug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args));
190
    rc = debug_mem_read(phoneid, &reply.args, sc_args[2], sizeof(reply.args));
191
    printf("dmr->%d\n", rc);
191
    printf("dmr->%d\n", rc);
192
    if (rc < 0) return;
192
    if (rc < 0) return;
193
 
193
 
194
    ipc_parse_call_sync(sc_args[0], &question, &reply);
194
    ipcp_call_sync(sc_args[0], &question, &reply);
195
}
195
}
196
 
196
 
197
void sc_ipc_wait(unsigned *sc_args, int sc_rc)
197
void sc_ipc_wait(unsigned *sc_args, int sc_rc)
198
{
198
{
199
    ipc_call_t call;
199
    ipc_call_t call;
Line 205... Line 205...
205
    rc = debug_mem_read(phoneid, &call, sc_args[0], sizeof(call));
205
    rc = debug_mem_read(phoneid, &call, sc_args[0], sizeof(call));
206
//  printf("debug_mem_read(phone %d, dest %d, app-mem src %d, size %d -> %d\n",
206
//  printf("debug_mem_read(phone %d, dest %d, app-mem src %d, size %d -> %d\n",
207
//      phoneid, (int)&call, sc_args[0], sizeof(call), rc);
207
//      phoneid, (int)&call, sc_args[0], sizeof(call), rc);
208
 
208
 
209
    if (rc >= 0) {
209
    if (rc >= 0) {
210
        ipc_parse_call_in(&call, sc_rc);
210
        ipcp_call_in(&call, sc_rc);
211
    }
211
    }
212
}
212
}
213
 
213
 
214
void event_syscall(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
214
void event_syscall(unsigned thread_id, unsigned thread_hash,  unsigned sc_id, int sc_rc)
215
{
215
{