Changeset e9073f2 in mainline for console/console.c
- Timestamp:
- 2006-06-05T23:02:13Z (19 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 51dbadf3
- Parents:
- 9996ed5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
console/console.c
r9996ed5 re9073f2 334 334 int consnum; 335 335 ipcarg_t arg1, arg2; 336 connection_t *conn; 336 337 337 338 if ((consnum = find_free_connection()) == -1) { … … 339 340 return; 340 341 } 342 conn = &connections[consnum]; 341 343 342 344 gcons_notify_connect(consnum); 343 conn ections[consnum].used = 1;344 conn ections[consnum].client_phone = IPC_GET_ARG3(call);345 screenbuffer_clear(& (connections[consnum].screenbuffer));345 conn->used = 1; 346 conn->client_phone = IPC_GET_ARG3(call); 347 screenbuffer_clear(&conn->screenbuffer); 346 348 347 349 /* Accept the connection */ … … 353 355 switch (IPC_GET_METHOD(call)) { 354 356 case IPC_M_PHONE_HUNGUP: 355 /* TODO */ 357 gcons_notify_disconnect(consnum); 358 /* Answer all pending requests */ 359 while (conn->keyrequest_counter > 0) { 360 conn->keyrequest_counter--; 361 ipc_answer_fast(fifo_pop(conn->keyrequests), ENOENT, 0, 0); 362 break; 363 } 364 365 /* Commit hangup */ 356 366 ipc_answer_fast(callid, 0,0,0); 357 367 return; … … 366 376 } 367 377 368 screenbuffer_clear(& (connections[consnum].screenbuffer));378 screenbuffer_clear(&conn->screenbuffer); 369 379 370 380 break; 371 381 case CONSOLE_GOTO: 372 382 373 screenbuffer_goto(& (connections[consnum].screenbuffer), IPC_GET_ARG2(call), IPC_GET_ARG1(call));383 screenbuffer_goto(&conn->screenbuffer, IPC_GET_ARG2(call), IPC_GET_ARG1(call)); 374 384 if (consnum == active_console) 375 385 curs_goto(IPC_GET_ARG1(call),IPC_GET_ARG2(call)); … … 388 398 arg1 = IPC_GET_ARG1(call); 389 399 arg2 = IPC_GET_ARG2(call); 390 screenbuffer_set_style(& (connections[consnum].screenbuffer),arg1, arg2);400 screenbuffer_set_style(&conn->screenbuffer,arg1, arg2); 391 401 if (consnum == active_console) 392 402 set_style_col(arg1, arg2); … … 395 405 case CONSOLE_CURSOR_VISIBILITY: 396 406 arg1 = IPC_GET_ARG1(call); 397 conn ections[consnum].screenbuffer.is_cursor_visible = arg1;407 conn->screenbuffer.is_cursor_visible = arg1; 398 408 if (consnum == active_console) 399 409 curs_visibility(arg1); 400 410 break; 401 411 case CONSOLE_GETCHAR: 402 if (keybuffer_empty(& (connections[consnum].keybuffer))) {412 if (keybuffer_empty(&conn->keybuffer)) { 403 413 /* buffer is empty -> store request */ 404 if (conn ections[consnum].keyrequest_counter < MAX_KEYREQUESTS_BUFFERED) {405 fifo_push(conn ections[consnum].keyrequests, callid);406 conn ections[consnum].keyrequest_counter++;414 if (conn->keyrequest_counter < MAX_KEYREQUESTS_BUFFERED) { 415 fifo_push(conn->keyrequests, callid); 416 conn->keyrequest_counter++; 407 417 } else { 408 418 /* no key available and too many requests => fail */ … … 411 421 continue; 412 422 }; 413 keybuffer_pop(& (connections[consnum].keybuffer), (int *)&arg1);423 keybuffer_pop(&conn->keybuffer, (int *)&arg1); 414 424 415 425 break;
Note:
See TracChangeset
for help on using the changeset viewer.