Changeset b5e68c8 in mainline for uspace/srv/hid/fb/fb.c
- Timestamp:
- 2011-05-12T16:49:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f36787d7
- Parents:
- e80329d6 (diff), 750636a (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/srv/hid/fb/fb.c
re80329d6 rb5e68c8 47 47 #include <as.h> 48 48 #include <ipc/fb.h> 49 #include <ipc/ipc.h>50 49 #include <ipc/ns.h> 51 50 #include <ipc/services.h> … … 199 198 static int rgb_from_attr(attr_rgb_t *rgb, const attrs_t *a); 200 199 static int rgb_from_style(attr_rgb_t *rgb, int style); 201 static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,202 ipcarg_t bg_color, ipcarg_t flags);203 204 static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,205 ipcarg_t bg_color, ipcarg_t attr);200 static int rgb_from_idx(attr_rgb_t *rgb, sysarg_t fg_color, 201 sysarg_t bg_color, sysarg_t flags); 202 203 static int fb_set_color(viewport_t *vport, sysarg_t fg_color, 204 sysarg_t bg_color, sysarg_t attr); 206 205 207 206 static void draw_glyph_aligned(unsigned int x, unsigned int y, bool cursor, … … 1072 1071 1073 1072 static unsigned char *shm = NULL; 1074 static ipcarg_t shm_id = 0;1073 static sysarg_t shm_id = 0; 1075 1074 static size_t shm_size; 1076 1075 … … 1083 1082 unsigned int h; 1084 1083 1085 switch (IPC_GET_ METHOD(*call)) {1084 switch (IPC_GET_IMETHOD(*call)) { 1086 1085 case IPC_M_SHARE_OUT: 1087 1086 /* We accept one area for data interchange */ … … 1089 1088 void *dest = as_get_mappable_page(IPC_GET_ARG2(*call)); 1090 1089 shm_size = IPC_GET_ARG2(*call); 1091 if ( ipc_answer_1(callid, EOK, (sysarg_t) dest)) {1090 if (async_answer_1(callid, EOK, (sysarg_t) dest)) { 1092 1091 shm_id = 0; 1093 1092 return false; … … 1166 1165 1167 1166 if (handled) 1168 ipc_answer_0(callid, retval);1167 async_answer_0(callid, retval); 1169 1168 return handled; 1170 1169 } … … 1360 1359 int newval; 1361 1360 1362 switch (IPC_GET_ METHOD(*call)) {1361 switch (IPC_GET_IMETHOD(*call)) { 1363 1362 case FB_ANIM_CREATE: 1364 1363 nvp = IPC_GET_ARG1(*call); … … 1435 1434 break; 1436 1435 } 1437 newval = (IPC_GET_ METHOD(*call) == FB_ANIM_START);1436 newval = (IPC_GET_IMETHOD(*call) == FB_ANIM_START); 1438 1437 if (newval ^ animations[i].enabled) { 1439 1438 animations[i].enabled = newval; … … 1445 1444 } 1446 1445 if (handled) 1447 ipc_answer_0(callid, retval);1446 async_answer_0(callid, retval); 1448 1447 return handled; 1449 1448 } … … 1459 1458 int i, nvp; 1460 1459 1461 switch (IPC_GET_ METHOD(*call)) {1460 switch (IPC_GET_IMETHOD(*call)) { 1462 1461 case FB_VP_DRAW_PIXMAP: 1463 1462 nvp = IPC_GET_ARG1(*call); … … 1498 1497 1499 1498 if (handled) 1500 ipc_answer_0(callid, retval);1499 async_answer_0(callid, retval); 1501 1500 return handled; 1502 1501 … … 1529 1528 } 1530 1529 1531 static int rgb_from_idx(attr_rgb_t *rgb, ipcarg_t fg_color,1532 ipcarg_t bg_color, ipcarg_t flags)1530 static int rgb_from_idx(attr_rgb_t *rgb, sysarg_t fg_color, 1531 sysarg_t bg_color, sysarg_t flags) 1533 1532 { 1534 1533 fg_color = (fg_color & 7) | ((flags & CATTR_BRIGHT) ? 8 : 0); … … 1562 1561 } 1563 1562 1564 static int fb_set_style(viewport_t *vport, ipcarg_t style)1563 static int fb_set_style(viewport_t *vport, sysarg_t style) 1565 1564 { 1566 1565 return rgb_from_style(&vport->attr, (int) style); 1567 1566 } 1568 1567 1569 static int fb_set_color(viewport_t *vport, ipcarg_t fg_color,1570 ipcarg_t bg_color, ipcarg_t flags)1568 static int fb_set_color(viewport_t *vport, sysarg_t fg_color, 1569 sysarg_t bg_color, sysarg_t flags) 1571 1570 { 1572 1571 return rgb_from_idx(&vport->attr, fg_color, bg_color, flags); … … 1582 1581 1583 1582 if (client_connected) { 1584 ipc_answer_0(iid, ELIMIT);1583 async_answer_0(iid, ELIMIT); 1585 1584 return; 1586 1585 } … … 1588 1587 /* Accept connection */ 1589 1588 client_connected = true; 1590 ipc_answer_0(iid, EOK);1589 async_answer_0(iid, EOK); 1591 1590 1592 1591 while (true) { … … 1621 1620 continue; 1622 1621 1623 switch (IPC_GET_ METHOD(call)) {1622 switch (IPC_GET_IMETHOD(call)) { 1624 1623 case IPC_M_PHONE_HUNGUP: 1625 1624 client_connected = false; … … 1641 1640 break; 1642 1641 } 1643 ipc_answer_0(callid, EOK);1642 async_answer_0(callid, EOK); 1644 1643 1645 1644 draw_char(vport, ch, col, row); … … 1674 1673 break; 1675 1674 case FB_GET_CSIZE: 1676 ipc_answer_2(callid, EOK, vport->cols, vport->rows);1675 async_answer_2(callid, EOK, vport->cols, vport->rows); 1677 1676 continue; 1678 1677 case FB_GET_COLOR_CAP: 1679 ipc_answer_1(callid, EOK, FB_CCAP_RGB);1678 async_answer_1(callid, EOK, FB_CCAP_RGB); 1680 1679 continue; 1681 1680 case FB_SCROLL: … … 1742 1741 break; 1743 1742 case FB_GET_RESOLUTION: 1744 ipc_answer_2(callid, EOK, screen.xres, screen.yres);1743 async_answer_2(callid, EOK, screen.xres, screen.yres); 1745 1744 continue; 1746 1745 case FB_POINTER_MOVE: … … 1756 1755 retval = ENOENT; 1757 1756 } 1758 ipc_answer_0(callid, retval);1757 async_answer_0(callid, retval); 1759 1758 } 1760 1759 }
Note:
See TracChangeset
for help on using the changeset viewer.