Changeset 0c25c10 in mainline


Ignore:
Timestamp:
2009-06-03T19:32:07Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
69e68e3
Parents:
cbff4c2
Message:

update for latest I/O changes

Location:
uspace/app
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/klog/klog.c

    rcbff4c2 r0c25c10  
    4141#include <as.h>
    4242#include <sysinfo.h>
    43 #include <io/stream.h>
    44 #include <console.h>
    4543#include <event.h>
    4644#include <errno.h>
     45#include <io/klog.h>
    4746
    48 #define NAME "klog"
     47#define NAME  "klog"
    4948
    5049/* Pointer to klog area */
    5150static wchar_t *klog;
    52 static count_t klog_length;
     51static size_t klog_length;
    5352
    5453static void interrupt_received(ipc_callid_t callid, ipc_call_t *call)
     
    5655        async_serialize_start();
    5756       
    58         count_t klog_start = (count_t) IPC_GET_ARG1(*call);
    59         count_t klog_len = (count_t) IPC_GET_ARG2(*call);
    60         count_t klog_stored = (count_t) IPC_GET_ARG3(*call);
    61         count_t i;
     57        size_t klog_start = (size_t) IPC_GET_ARG1(*call);
     58        size_t klog_len = (size_t) IPC_GET_ARG2(*call);
     59        size_t klog_stored = (size_t) IPC_GET_ARG3(*call);
     60        size_t i;
    6261       
    6362        for (i = klog_len - klog_stored; i < klog_len; i++)
     
    6968int main(int argc, char *argv[])
    7069{
    71         console_wait();
    72        
    73         count_t klog_pages = sysinfo_value("klog.pages");
     70        size_t klog_pages = sysinfo_value("klog.pages");
    7471        size_t klog_size = klog_pages * PAGE_SIZE;
    7572        klog_length = klog_size / sizeof(wchar_t);
  • uspace/app/tetris/input.c

    rcbff4c2 r0c25c10  
    5858
    5959#include <async.h>
     60#include <vfs/vfs.h>
     61#include <io/console.h>
    6062#include <ipc/console.h>
    61 #include <console.h>
    62 #include <kbd/kbd.h>
    6363
    6464/* return true iff the given timeval is positive */
     
    9999        static ipc_call_t charcall;
    100100        ipcarg_t rc;
    101         int cons_phone;
    102101
    103102        /*
     
    116115again:
    117116                if (!getchar_inprog) {
    118                         cons_phone = console_open(true);
    119                         getchar_inprog = async_send_2(cons_phone,
    120                             CONSOLE_GETKEY, 0, 0, &charcall);
     117                        getchar_inprog = async_send_0(fphone(stdin),
     118                            CONSOLE_GET_EVENT, &charcall);
    121119                }
    122                 if (!s) 
     120                if (!s)
    123121                        async_wait_for(getchar_inprog, &rc);
    124122                else if (async_wait_timeout(getchar_inprog, &rc, s->tv_usec) == ETIMEOUT) {
     
    131129                        stop("end of file, help");
    132130                }
    133                 if (IPC_GET_ARG1(charcall) == KE_RELEASE)
     131                if (IPC_GET_ARG1(charcall) == KEY_RELEASE)
    134132                        goto again;
    135133
  • uspace/app/tetris/scores.c

    rcbff4c2 r0c25c10  
    5656/* #include <stdlib.h> */
    5757#include <string.h>
    58 #include <kbd/kbd.h>
    59 #include <kbd/keycode.h>
     58#include <io/console.h>
     59#include <io/keycode.h>
     60#include <vfs/vfs.h>
    6061#include <stdlib.h>
    6162/* #include <time.h> */
     
    128129        int i,j;
    129130        size_t off;
    130         kbd_event_t ev;
     131        console_event_t ev;
    131132       
    132133        clear_screen();
     
    142143        while (1) {
    143144                fflush(stdout);
    144                 if (kbd_get_event(&ev) != EOK)
     145                if (!console_get_event(fphone(stdin), &ev))
    145146                        exit(1);
    146147
    147                 if (ev.type == KE_RELEASE)
     148                if (ev.type == KEY_RELEASE)
    148149                        continue;
    149150
  • uspace/app/tetris/screen.c

    rcbff4c2 r0c25c10  
    5151#include <string.h>
    5252#include <unistd.h>
    53 #include <console.h>
    54 
     53#include <vfs/vfs.h>
    5554#include <async.h>
    5655#include "screen.h"
    5756#include "tetris.h"
    58 #include <ipc/console.h>
     57#include <io/console.h>
    5958
    6059static cell curscreen[B_SIZE];  /* 1 => standout (or otherwise marked) */
     
    6564/*
    6665 * putstr() is for unpadded strings (either as in termcap(5) or
    67  * simply literal strings); 
     66 * simply literal strings);
    6867 */
    6968static inline void putstr(char *s)
     
    7574static void start_standout(void)
    7675{
    77         console_set_rgb_color(0xf0f0f0, 0);
     76        console_set_rgb_color(fphone(stdout), 0xf0f0f0, 0);
    7877}
    7978
    8079static void resume_normal(void)
    8180{
    82         console_set_rgb_color(0, 0xf0f0f0);
     81        console_set_rgb_color(fphone(stdout), 0, 0xf0f0f0);
    8382}
    8483
    8584void clear_screen(void)
    8685{
    87         console_clear();
     86        console_clear(fphone(stdout));
    8887        moveto(0, 0);
    8988}
     
    9796
    9897        resume_normal();
    99         console_clear();
     98        console_clear(fphone(stdout));
    10099        curscore = -1;
    101100        memset((char *)curscreen, 0, sizeof(curscreen));
     
    108107scr_init(void)
    109108{
    110         console_cursor_visibility(0);
     109        console_cursor_visibility(fphone(stdout), 0);
    111110        resume_normal();
    112111        scr_clear();
     
    115114void moveto(int r, int c)
    116115{
    117         console_goto(r, c);
     116        console_goto(fphone(stdout), c, r);
    118117}
    119118
     
    122121static int get_display_size(winsize_t *ws)
    123122{
    124         return console_get_size(&ws->ws_row, &ws->ws_col);
     123        return console_get_size(fphone(stdout), &ws->ws_col, &ws->ws_row);
    125124}
    126125
  • uspace/app/tetris/screen.h

    rcbff4c2 r0c25c10  
    4747#define putpad(s)       tputs(s, 1, put)
    4848
     49#include <sys/types.h>
    4950#include <async.h>
    5051
    5152typedef struct {
    52         int ws_row;
    53         int ws_col;
     53        ipcarg_t ws_row;
     54        ipcarg_t ws_col;
    5455} winsize_t;
    5556
Note: See TracChangeset for help on using the changeset viewer.