Subversion Repositories HelenOS-historic

Rev

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

Rev 1520 Rev 1521
Line 246... Line 246...
246
static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
246
static void client_connection(ipc_callid_t iid, ipc_call_t *icall)
247
{
247
{
248
    ipc_callid_t callid;
248
    ipc_callid_t callid;
249
    ipc_call_t call;
249
    ipc_call_t call;
250
    int consnum;
250
    int consnum;
251
    ipcarg_t arg1;
251
    ipcarg_t arg1, arg2;
252
 
252
 
253
    if ((consnum = find_free_connection()) == CONSOLE_COUNT) {
253
    if ((consnum = find_free_connection()) == CONSOLE_COUNT) {
254
        ipc_answer_fast(iid,ELIMIT,0,0);
254
        ipc_answer_fast(iid,ELIMIT,0,0);
255
        return;
255
        return;
256
    }
256
    }
Line 262... Line 262...
262
    /* Accept the connection */
262
    /* Accept the connection */
263
    ipc_answer_fast(iid,0,0,0);
263
    ipc_answer_fast(iid,0,0,0);
264
   
264
   
265
    while (1) {
265
    while (1) {
266
        callid = async_get_call(&call);
266
        callid = async_get_call(&call);
-
 
267
        arg1 = arg2 = 0;
267
        switch (IPC_GET_METHOD(call)) {
268
        switch (IPC_GET_METHOD(call)) {
268
        case IPC_M_PHONE_HUNGUP:
269
        case IPC_M_PHONE_HUNGUP:
269
            /* TODO */
270
            /* TODO */
270
            ipc_answer_fast(callid, 0,0,0);
271
            ipc_answer_fast(callid, 0,0,0);
271
            return;
272
            return;
Line 284... Line 285...
284
        case CONSOLE_GOTO:
285
        case CONSOLE_GOTO:
285
           
286
           
286
            screenbuffer_goto(&(connections[consnum].screenbuffer), IPC_GET_ARG1(call), IPC_GET_ARG2(call));
287
            screenbuffer_goto(&(connections[consnum].screenbuffer), IPC_GET_ARG1(call), IPC_GET_ARG2(call));
287
           
288
           
288
            break;
289
            break;
-
 
290
        case CONSOLE_GETSIZE:
-
 
291
            arg1 = fb_info.cols;
-
 
292
            arg2 = fb_info.rows;
-
 
293
            break;
289
 
294
 
290
        case CONSOLE_GETCHAR:
295
        case CONSOLE_GETCHAR:
291
            if (keybuffer_empty(&(connections[consnum].keybuffer))) {
296
            if (keybuffer_empty(&(connections[consnum].keybuffer))) {
292
                /* buffer is empty -> store request */
297
                /* buffer is empty -> store request */
293
                if (connections[consnum].keyrequest_counter < MAX_KEYREQUESTS_BUFFERED) {      
298
                if (connections[consnum].keyrequest_counter < MAX_KEYREQUESTS_BUFFERED) {      
Line 301... Line 306...
301
            };
306
            };
302
            keybuffer_pop(&(connections[consnum].keybuffer), (char *)&arg1);
307
            keybuffer_pop(&(connections[consnum].keybuffer), (char *)&arg1);
303
           
308
           
304
            break;
309
            break;
305
        }
310
        }
306
        ipc_answer_fast(callid, 0, arg1, 0);
311
        ipc_answer_fast(callid, 0, arg1, arg2);
307
    }
312
    }
308
}
313
}
309
 
314
 
310
int main(int argc, char *argv[])
315
int main(int argc, char *argv[])
311
{
316
{