Changeset 79ae36dd in mainline for uspace/srv/hid/console/gcons.c


Ignore:
Timestamp:
2011-06-08T19:01:55Z (13 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0eff68e
Parents:
764d71e
Message:

new async framework with integrated exchange tracking

  • strict isolation between low-level IPC and high-level async framework with integrated exchange tracking
    • each IPC connection is represented by an async_sess_t structure
    • each IPC exchange is represented by an async_exch_t structure
    • exchange management is either based on atomic messages (EXCHANGE_ATOMIC), locking (EXCHANGE_SERIALIZE) or connection cloning (EXCHANGE_CLONE)
  • async_obsolete: temporary compatibility layer to keep old async clients working (several pieces of code are currently broken, but only non-essential functionality)
  • IPC_M_PHONE_HANGUP is now method no. 0 (for elegant boolean evaluation)
  • IPC_M_DEBUG_ALL has been renamed to IPC_M_DEBUG
  • IPC_M_PING has been removed (VFS protocol now has VFS_IN_PING)
  • console routines in libc have been rewritten for better abstraction
  • additional use for libc-private header files (FILE structure opaque to the client)
  • various cstyle changes (typos, indentation, missing externs in header files, improved comments, etc.)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/srv/hid/console/gcons.c

    r764d71e r79ae36dd  
    3535#include <ipc/fb.h>
    3636#include <async.h>
     37#include <async_obsolete.h>
    3738#include <stdio.h>
    3839#include <sys/mman.h>
     
    115116static void vp_switch(int vp)
    116117{
    117         async_msg_1(fbphone, FB_VIEWPORT_SWITCH, vp);
     118        async_obsolete_msg_1(fbphone, FB_VIEWPORT_SWITCH, vp);
    118119}
    119120
     
    121122static int vp_create(sysarg_t x, sysarg_t y, sysarg_t width, sysarg_t height)
    122123{
    123         return async_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y,
     124        return async_obsolete_req_2_0(fbphone, FB_VIEWPORT_CREATE, (x << 16) | y,
    124125            (width << 16) | height);
    125126}
     
    127128static void clear(void)
    128129{
    129         async_msg_0(fbphone, FB_CLEAR);
     130        async_obsolete_msg_0(fbphone, FB_CLEAR);
    130131}
    131132
    132133static void set_rgb_color(uint32_t fgcolor, uint32_t bgcolor)
    133134{
    134         async_msg_2(fbphone, FB_SET_RGB_COLOR, fgcolor, bgcolor);
     135        async_obsolete_msg_2(fbphone, FB_SET_RGB_COLOR, fgcolor, bgcolor);
    135136}
    136137
     
    138139static void tran_putch(wchar_t ch, sysarg_t col, sysarg_t row)
    139140{
    140         async_msg_3(fbphone, FB_PUTCHAR, ch, col, row);
     141        async_obsolete_msg_3(fbphone, FB_PUTCHAR, ch, col, row);
    141142}
    142143
     
    149150       
    150151        if (ic_pixmaps[state] != -1)
    151                 async_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[index],
     152                async_obsolete_msg_2(fbphone, FB_VP_DRAW_PIXMAP, cstatus_vp[index],
    152153                    ic_pixmaps[state]);
    153154       
     
    177178               
    178179                if (animation != -1)
    179                         async_msg_1(fbphone, FB_ANIM_START, animation);
     180                        async_obsolete_msg_1(fbphone, FB_ANIM_START, animation);
    180181        } else {
    181182                if (console_state[active_console] == CONS_DISCONNECTED_SEL)
     
    258259{
    259260        if (animation != -1)
    260                 async_msg_1(fbphone, FB_ANIM_STOP, animation);
     261                async_obsolete_msg_1(fbphone, FB_ANIM_STOP, animation);
    261262       
    262263        active_console = KERNEL_CONSOLE;
     
    294295       
    295296        if (active_console != KERNEL_CONSOLE)
    296                 async_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y);
     297                async_obsolete_msg_2(fbphone, FB_POINTER_MOVE, mouse_x, mouse_y);
    297298}
    298299
     
    374375       
    375376        /* Send area */
    376         int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
     377        int rc = async_obsolete_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
    377378        if (rc)
    378379                goto exit;
    379380       
    380         rc = async_share_out_start(fbphone, shm, PROTO_READ);
     381        rc = async_obsolete_share_out_start(fbphone, shm, PROTO_READ);
    381382        if (rc)
    382383                goto drop;
    383384       
    384385        /* Draw logo */
    385         async_msg_2(fbphone, FB_DRAW_PPM, x, y);
     386        async_obsolete_msg_2(fbphone, FB_DRAW_PPM, x, y);
    386387       
    387388drop:
    388389        /* Drop area */
    389         async_msg_0(fbphone, FB_DROP_SHM);
     390        async_obsolete_msg_0(fbphone, FB_DROP_SHM);
    390391       
    391392exit:
     
    436437       
    437438        /* Send area */
    438         int rc = async_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
     439        int rc = async_obsolete_req_1_0(fbphone, FB_PREPARE_SHM, (sysarg_t) shm);
    439440        if (rc)
    440441                goto exit;
    441442       
    442         rc = async_share_out_start(fbphone, shm, PROTO_READ);
     443        rc = async_obsolete_share_out_start(fbphone, shm, PROTO_READ);
    443444        if (rc)
    444445                goto drop;
    445446       
    446447        /* Obtain pixmap */
    447         rc = async_req_0_0(fbphone, FB_SHM2PIXMAP);
     448        rc = async_obsolete_req_0_0(fbphone, FB_SHM2PIXMAP);
    448449        if (rc < 0)
    449450                goto drop;
     
    453454drop:
    454455        /* Drop area */
    455         async_msg_0(fbphone, FB_DROP_SHM);
     456        async_obsolete_msg_0(fbphone, FB_DROP_SHM);
    456457       
    457458exit:
     
    464465static void make_anim(void)
    465466{
    466         int an = async_req_1_0(fbphone, FB_ANIM_CREATE,
     467        int an = async_obsolete_req_1_0(fbphone, FB_ANIM_CREATE,
    467468            cstatus_vp[KERNEL_CONSOLE]);
    468469        if (an < 0)
     
    471472        int pm = make_pixmap(_binary_gfx_anim_1_ppm_start,
    472473            (size_t) &_binary_gfx_anim_1_ppm_size);
    473         async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
     474        async_obsolete_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    474475       
    475476        pm = make_pixmap(_binary_gfx_anim_2_ppm_start,
    476477            (size_t) &_binary_gfx_anim_2_ppm_size);
    477         async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
     478        async_obsolete_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    478479       
    479480        pm = make_pixmap(_binary_gfx_anim_3_ppm_start,
    480481            (size_t) &_binary_gfx_anim_3_ppm_size);
    481         async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
     482        async_obsolete_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    482483       
    483484        pm = make_pixmap(_binary_gfx_anim_4_ppm_start,
    484485            (size_t) &_binary_gfx_anim_4_ppm_size);
    485         async_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
    486        
    487         async_msg_1(fbphone, FB_ANIM_START, an);
     486        async_obsolete_msg_2(fbphone, FB_ANIM_ADDPIXMAP, an, pm);
     487       
     488        async_obsolete_msg_1(fbphone, FB_ANIM_START, an);
    488489       
    489490        animation = an;
     
    495496        fbphone = phone;
    496497       
    497         int rc = async_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres);
     498        int rc = async_obsolete_req_0_2(phone, FB_GET_RESOLUTION, &xres, &yres);
    498499        if (rc)
    499500                return;
Note: See TracChangeset for help on using the changeset viewer.