Changeset ec7f8b1 in mainline for uspace/lib/c


Ignore:
Timestamp:
2011-08-21T15:35:03Z (14 years ago)
Author:
Petr Koupy <petr.koupy@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bb74dabe
Parents:
c4a8e4a (diff), 5935c079 (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.
Message:

Merge mainline changes.

Location:
uspace/lib/c
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/arch/ia32/include/ddi.h

    rc4a8e4a rec7f8b1  
    4343        if (port < (ioport8_t *) IO_SPACE_BOUNDARY) {
    4444                uint8_t val;
     45               
    4546                asm volatile (
    4647                        "inb %w[port], %b[val]\n"
     
    4849                        : [port] "d" (port)
    4950                );
     51               
    5052                return val;
    51         } else {
     53        } else
    5254                return (uint8_t) *port;
    53         }
    5455}
    5556
     
    5859        if (port < (ioport16_t *) IO_SPACE_BOUNDARY) {
    5960                uint16_t val;
     61               
    6062                asm volatile (
    6163                        "inw %w[port], %w[val]\n"
     
    6365                        : [port] "d" (port)
    6466                );
     67               
    6568                return val;
    66         } else {
     69        } else
    6770                return (uint16_t) *port;
    68         }
    6971}
    7072
     
    7375        if (port < (ioport32_t *) IO_SPACE_BOUNDARY) {
    7476                uint32_t val;
     77               
    7578                asm volatile (
    7679                        "inl %w[port], %[val]\n"
     
    7881                        : [port] "d" (port)
    7982                );
     83               
    8084                return val;
    81         } else {
     85        } else
    8286                return (uint32_t) *port;
    83         }
    8487}
    8588
     
    9194                        :: [val] "a" (val), [port] "d" (port)
    9295                );     
    93         } else {
     96        } else
    9497                *port = val;
    95         }
    9698}
    9799
     
    103105                        :: [val] "a" (val), [port] "d" (port)
    104106                );
    105         } else {
     107        } else
    106108                *port = val;
    107         }
    108109}
    109110
     
    115116                        :: [val] "a" (val), [port] "d" (port)
    116117                );
    117         } else {
     118        } else
    118119                *port = val;
    119         }
    120120}
    121121
  • uspace/lib/c/generic/async.c

    rc4a8e4a rec7f8b1  
    16561656       
    16571657        return sess;
     1658}
     1659
     1660/** Set arguments for new connections.
     1661 *
     1662 * FIXME This is an ugly hack to work around the problem that parallel
     1663 * exchanges are implemented using parallel connections. When we create
     1664 * a callback session, the framework does not know arguments for the new
     1665 * connections.
     1666 *
     1667 * The proper solution seems to be to implement parallel exchanges using
     1668 * tagging.
     1669 */
     1670void async_sess_args_set(async_sess_t *sess, sysarg_t arg1, sysarg_t arg2,
     1671    sysarg_t arg3)
     1672{
     1673        sess->arg1 = arg1;
     1674        sess->arg2 = arg2;
     1675        sess->arg3 = arg3;
    16581676}
    16591677
  • uspace/lib/c/generic/devman.c

    rc4a8e4a rec7f8b1  
    8989                        if (devman_driver_block_sess == NULL)
    9090                                devman_driver_block_sess =
    91                                     service_connect_blocking(EXCHANGE_SERIALIZE,
     91                                    service_connect_blocking(EXCHANGE_PARALLEL,
    9292                                    SERVICE_DEVMAN, DEVMAN_DRIVER, 0);
    9393                }
     
    138138                if (devman_driver_sess == NULL)
    139139                        devman_driver_sess =
    140                             service_connect(EXCHANGE_SERIALIZE, SERVICE_DEVMAN,
     140                            service_connect(EXCHANGE_PARALLEL, SERVICE_DEVMAN,
    141141                            DEVMAN_DRIVER, 0);
    142142               
  • uspace/lib/c/generic/ns.c

    rc4a8e4a rec7f8b1  
    5656        async_exchange_end(exch);
    5757       
     58        /*
     59         * FIXME Ugly hack to work around limitation of implementing
     60         * parallel exchanges using multiple connections. Shift out
     61         * first argument for non-initial connections.
     62         */
     63        async_sess_args_set(sess, arg2, arg3, 0);
     64       
    5865        return sess;
    5966}
     
    6673            async_connect_me_to_blocking(mgmt, exch, service, arg2, arg3);
    6774        async_exchange_end(exch);
     75       
     76        /*
     77         * FIXME Ugly hack to work around limitation of implementing
     78         * parallel exchanges using multiple connections. Shift out
     79         * first argument for non-initial connections.
     80         */
     81        async_sess_args_set(sess, arg2, arg3, 0);
    6882       
    6983        return sess;
  • uspace/lib/c/generic/str.c

    rc4a8e4a rec7f8b1  
    22 * Copyright (c) 2005 Martin Decky
    33 * Copyright (c) 2008 Jiri Svoboda
     4 * Copyright (c) 2011 Martin Sucha
    45 * All rights reserved.
    56 *
     
    718719
    719720        dest[dlen - 1] = '\0';
     721}
     722
     723/** Convert string to wide string.
     724 *
     725 * Convert string @a src to wide string. A new wide NULL-terminated
     726 * string will be allocated on the heap.
     727 *
     728 * @param src   Source string.
     729 */
     730wchar_t *str_to_awstr(const char *str)
     731{
     732        size_t len = str_length(str);
     733       
     734        wchar_t *wstr = calloc(len+1, sizeof(wchar_t));
     735        if (wstr == NULL)
     736                return NULL;
     737       
     738        str_to_wstr(wstr, len + 1, str);
     739        return wstr;
    720740}
    721741
  • uspace/lib/c/include/async.h

    rc4a8e4a rec7f8b1  
    337337
    338338/*
     339 * FIXME These functions just work around problems with parallel exchange
     340 * management. Proper solution needs to be implemented.
     341 */
     342void async_sess_args_set(async_sess_t *sess, sysarg_t, sysarg_t, sysarg_t);
     343
     344/*
    339345 * User-friendly wrappers for async_share_in_start().
    340346 */
  • uspace/lib/c/include/str.h

    rc4a8e4a rec7f8b1  
    8383extern char *wstr_to_astr(const wchar_t *src);
    8484extern void str_to_wstr(wchar_t *dest, size_t dlen, const char *src);
     85extern wchar_t *str_to_awstr(const char *src);
    8586
    8687extern char *str_chr(const char *str, wchar_t ch);
Note: See TracChangeset for help on using the changeset viewer.