Changeset ab92305 in mainline for uspace


Ignore:
Timestamp:
2013-08-19T17:23:31Z (12 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
4da8fdb
Parents:
2921602 (diff), 4a9728ec (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 audio support.

Includes audio server and sb16 driver.

Tested on ia32 and amd64 (qemu).

Location:
uspace
Files:
58 added
23 edited

Legend:

Unmodified
Added
Removed
  • uspace/Makefile

    r2921602 rab92305  
    4949        app/klog \
    5050        app/loc \
     51        app/mixerctl \
    5152        app/logset \
    5253        app/mkfat \
     
    7576        app/sysinfo \
    7677        app/mkbd \
     78        app/wavplay \
    7779        app/date \
    7880        app/websrv \
     81        srv/audio/hound \
    7982        app/vdemo \
    8083        app/vlaunch \
     
    116119        srv/hid/remcons \
    117120        srv/hw/char/s3c24xx_uart \
     121        drv/audio/sb16 \
    118122        drv/infrastructure/root \
    119123        drv/infrastructure/rootvirt \
     
    215219        lib/softfloat \
    216220        lib/drv \
     221        lib/hound \
    217222        lib/graph \
    218223        lib/gui \
     
    227232        lib/usbhid \
    228233        lib/usbvirt \
     234        lib/pcm \
    229235        lib/bithenge \
    230236        lib/posix
  • uspace/Makefile.common

    r2921602 rab92305  
    131131
    132132LIBDRV_PREFIX = $(LIB_PREFIX)/drv
     133LIBHOUND_PREFIX = $(LIB_PREFIX)/hound
     134LIBPCM_PREFIX = $(LIB_PREFIX)/pcm
    133135LIBNET_PREFIX = $(LIB_PREFIX)/net
    134136LIBNIC_PREFIX = $(LIB_PREFIX)/nic
  • uspace/app/init/init.c

    r2921602 rab92305  
    392392                rc = console(HID_INPUT, HID_OUTPUT);
    393393                if (rc == EOK) {
    394                         getterm("term/vc0", "/app/bdsh", true);
    395                         getterm("term/vc1", "/app/bdsh", false);
    396                         getterm("term/vc2", "/app/bdsh", false);
    397                         getterm("term/vc3", "/app/bdsh", false);
    398                         getterm("term/vc4", "/app/bdsh", false);
    399                         getterm("term/vc5", "/app/bdsh", false);
     394#ifndef CONFIG_VC_COUNT
     395#define CONFIG_VC_COUNT 6
     396#endif
     397                        switch((unsigned)CONFIG_VC_COUNT) {
     398                        default:
     399                        case 6: getterm("term/vc5", "/app/bdsh", false);
     400                        case 5: getterm("term/vc4", "/app/bdsh", false);
     401                        case 4: getterm("term/vc3", "/app/bdsh", false);
     402                        case 3: getterm("term/vc2", "/app/bdsh", false);
     403                        case 2: getterm("term/vc1", "/app/bdsh", false);
     404                        case 1: getterm("term/vc0", "/app/bdsh", true);
     405                        }
     406#ifdef CONFIG_KERNEL_LOG_VC_6
    400407                        getterm("term/vc6", "/app/klog", false);
     408#endif
    401409                }
    402410        }
     411        srv_start("/srv/hound");
    403412       
    404413        return 0;
  • uspace/drv/bus/isa/i8237.c

    r2921602 rab92305  
    3838#include <stdbool.h>
    3939#include <errno.h>
     40#include <ddi.h>
     41#include <ddf/log.h>
    4042#include <fibril_synch.h>
    4143#include <ddi.h>
     
    198200        .channels = {
    199201                /* The first chip 8-bit */
    200                 {
    201                         (uint8_t *) 0x00,
    202                         (uint8_t *) 0x01,
    203                         (uint8_t *) 0x87,
    204                         (uint8_t *) 0x0a,
    205                         (uint8_t *) 0x0b,
    206                         (uint8_t *) 0x0c,
    207                 },
    208                 {
    209                         (uint8_t *) 0x02,
    210                         (uint8_t *) 0x03,
    211                         (uint8_t *) 0x83,
    212                         (uint8_t *) 0x0a,
    213                         (uint8_t *) 0x0b,
    214                         (uint8_t *) 0x0c,
    215                 },
    216                 {
    217                         (uint8_t *) 0x04,
    218                         (uint8_t *) 0x05,
    219                         (uint8_t *) 0x81,
    220                         (uint8_t *) 0x0a,
    221                         (uint8_t *) 0x0b,
    222                         (uint8_t *) 0x0c,
    223                 },
    224                 {
    225                         (uint8_t *) 0x06,
    226                         (uint8_t *) 0x07,
    227                         (uint8_t *) 0x82,
    228                         (uint8_t *) 0x0a,
    229                         (uint8_t *) 0x0b,
    230                         (uint8_t *) 0x0c,
     202                { /* Channel 0 - Unusable*/
     203                        .offset_reg_address = (uint8_t *) 0x00,
     204                        .size_reg_address = (uint8_t *) 0x01,
     205                        .page_reg_address = (uint8_t *) 0x87,
     206                        .single_mask_address = (uint8_t *) 0x0a,
     207                        .mode_address = (uint8_t *) 0x0b,
     208                        .flip_flop_address = (uint8_t *) 0x0c,
     209                },
     210                { /* Channel 1 */
     211                        .offset_reg_address = (uint8_t *) 0x02,
     212                        .size_reg_address = (uint8_t *) 0x03,
     213                        .page_reg_address = (uint8_t *) 0x83,
     214                        .single_mask_address = (uint8_t *) 0x0a,
     215                        .mode_address = (uint8_t *) 0x0b,
     216                        .flip_flop_address = (uint8_t *) 0x0c,
     217                },
     218                { /* Channel 2 */
     219                        .offset_reg_address = (uint8_t *) 0x04,
     220                        .size_reg_address = (uint8_t *) 0x05,
     221                        .page_reg_address = (uint8_t *) 0x81,
     222                        .single_mask_address = (uint8_t *) 0x0a,
     223                        .mode_address = (uint8_t *) 0x0b,
     224                        .flip_flop_address = (uint8_t *) 0x0c,
     225                },
     226                { /* Channel 3 */
     227                        .offset_reg_address = (uint8_t *) 0x06,
     228                        .size_reg_address = (uint8_t *) 0x07,
     229                        .page_reg_address = (uint8_t *) 0x82,
     230                        .single_mask_address = (uint8_t *) 0x0a,
     231                        .mode_address = (uint8_t *) 0x0b,
     232                        .flip_flop_address = (uint8_t *) 0x0c,
    231233                },
    232234               
    233235                /* The second chip 16-bit */
    234                 {
    235                         (uint8_t *) 0xc0,
    236                         (uint8_t *) 0xc2,
    237                         (uint8_t *) 0x8f,
    238                         (uint8_t *) 0xd4,
    239                         (uint8_t *) 0xd6,
    240                         (uint8_t *) 0xd8,
    241                 },
    242                 {
    243                         (uint8_t *) 0xc4,
    244                         (uint8_t *) 0xc6,
    245                         (uint8_t *) 0x8b,
    246                         (uint8_t *) 0xd4,
    247                         (uint8_t *) 0xd6,
    248                         (uint8_t *) 0xd8,
    249                 },
    250                 {
    251                         (uint8_t *) 0xc8,
    252                         (uint8_t *) 0xca,
    253                         (uint8_t *) 0x89,
    254                         (uint8_t *) 0xd4,
    255                         (uint8_t *) 0xd6,
    256                         (uint8_t *) 0xd8,
    257                 },
    258                 {
    259                         (uint8_t *) 0xcc,
    260                         (uint8_t *) 0xce,
    261                         (uint8_t *) 0x8a,
    262                         (uint8_t *) 0xd4,
    263                         (uint8_t *) 0xd6,
    264                         (uint8_t *) 0xd8,
     236                { /* Channel 4 - Unusable */
     237                        .offset_reg_address = (uint8_t *) 0xc0,
     238                        .size_reg_address = (uint8_t *) 0xc2,
     239                        .page_reg_address = (uint8_t *) 0x8f,
     240                        .single_mask_address = (uint8_t *) 0xd4,
     241                        .mode_address = (uint8_t *) 0xd6,
     242                        .flip_flop_address = (uint8_t *) 0xd8,
     243                },
     244                { /* Channel 5 */
     245                        .offset_reg_address = (uint8_t *) 0xc4,
     246                        .size_reg_address = (uint8_t *) 0xc6,
     247                        .page_reg_address = (uint8_t *) 0x8b,
     248                        .single_mask_address = (uint8_t *) 0xd4,
     249                        .mode_address = (uint8_t *) 0xd6,
     250                        .flip_flop_address = (uint8_t *) 0xd8,
     251                },
     252                { /* Channel 6 */
     253                        .offset_reg_address = (uint8_t *) 0xc8,
     254                        .size_reg_address = (uint8_t *) 0xca,
     255                        .page_reg_address = (uint8_t *) 0x89,
     256                        .single_mask_address = (uint8_t *) 0xd4,
     257                        .mode_address = (uint8_t *) 0xd6,
     258                        .flip_flop_address = (uint8_t *) 0xd8,
     259                },
     260                { /* Channel 7 */
     261                        .offset_reg_address = (uint8_t *) 0xcc,
     262                        .size_reg_address = (uint8_t *) 0xce,
     263                        .page_reg_address = (uint8_t *) 0x8a,
     264                        .single_mask_address = (uint8_t *) 0xd4,
     265                        .mode_address = (uint8_t *) 0xd6,
     266                        .flip_flop_address = (uint8_t *) 0xd8,
    265267                },
    266268        },
     
    272274};
    273275
    274 /* Initialize I/O access to DMA controller I/O ports.
     276/** Initialize I/O access to DMA controller I/O ports.
    275277 *
    276278 * @param controller DMA Controller structure to initialize.
    277279 *
    278280 * @return Error code.
    279  *
    280281 */
    281282static inline int dma_controller_init(dma_controller_t *controller)
     
    304305       
    305306        return EOK;
     307}
     308
     309/** Helper function. Channels 4,5,6, and 7 are 8 bit DMA.
     310 * @pram channel DMA channel.
     311 * @reutrn True, if channel is 4,5,6, or 7, false otherwise.
     312 */
     313static inline bool is_dma16(unsigned channel)
     314{
     315        return (channel >= 4) && (channel < 8);
     316}
     317
     318/** Helper function. Channels 0,1,2, and 3 are 8 bit DMA.
     319 * @pram channel DMA channel.
     320 * @reutrn True, if channel is 0,1,2, or 3, false otherwise.
     321 */
     322static inline bool is_dma8(unsigned channel)
     323{
     324        return (channel < 4);
    306325}
    307326
     
    320339 *
    321340 * @return Error code.
    322  *
    323  */
    324 int dma_setup_channel(unsigned int channel, uint32_t pa, uint16_t size,
     341 */
     342int dma_channel_setup(unsigned int channel, uint32_t pa, uint32_t size,
    325343    uint8_t mode)
    326344{
     345        if (!is_dma8(channel) && !is_dma16(channel))
     346                return ENOENT;
     347
    327348        if ((channel == 0) || (channel == 4))
    328349                return ENOTSUP;
    329        
    330         if (channel > 7)
    331                 return ENOENT;
    332350       
    333351        /* DMA is limited to 24bit addresses. */
     
    336354       
    337355        /* 8 bit channels use only 4 bits from the page register. */
    338         if ((channel > 0) && (channel < 4) && (pa >= (1 << 20)))
     356        if (is_dma8(channel) && (pa >= (1 << 20)))
     357                return EINVAL;
     358
     359        /* Buffers cannot cross 64K page boundaries */
     360        if ((pa & 0xffff0000) != ((pa + size - 1) & 0xffff0000))
    339361                return EINVAL;
    340362       
     
    352374        ddf_msg(LVL_DEBUG, "Unspoiled address %#" PRIx32 " (size %" PRIu16 ")",
    353375            pa, size);
    354         if (channel > 4) {
     376        if (is_dma16(channel)) {
    355377                /* Size must be aligned to 16 bits */
    356378                if ((size & 1) != 0) {
     
    358380                        return EINVAL;
    359381                }
    360                
     382                /* Size is in 2byte words */
    361383                size >>= 1;
    362                
    363384                /* Address is fun: lower 16 bits need to be shifted by 1 */
    364385                pa = ((pa & 0xffff) >> 1) | (pa & 0xff0000);
     
    426447}
    427448
     449/** Query remaining buffer size.
     450 *
     451 * @param channel DMA Channel 1, 2, 3 for 8 bit transfers,
     452 *                    5, 6, 7 for 16 bit.
     453 * @param size    Place to store number of bytes pending in the assigned buffer.
     454 *
     455 * @return Error code.
     456 */
     457int dma_channel_remain(unsigned channel, size_t *size)
     458{
     459        assert(size);
     460        if (!is_dma8(channel) && !is_dma16(channel))
     461                return ENOENT;
     462       
     463        if ((channel == 0) || (channel == 4))
     464                return ENOTSUP;
     465       
     466        fibril_mutex_lock(&guard);
     467        if (!controller_8237.initialized) {
     468                fibril_mutex_unlock(&guard);
     469                return EIO;
     470        }
     471
     472        const dma_channel_t dma_channel = controller_8237.channels[channel];
     473        /* Get size - reset flip-flop */
     474        pio_write_8(dma_channel.flip_flop_address, 0);
     475       
     476        /* Low byte */
     477        const uint8_t value_low = pio_read_8(dma_channel.size_reg_address);
     478        ddf_msg(LVL_DEBUG2, "Read size low byte: %p:%x.",
     479            dma_channel.size_reg_address, value_low);
     480       
     481        /* High byte */
     482        const uint8_t value_high = pio_read_8(dma_channel.size_reg_address);
     483        ddf_msg(LVL_DEBUG2, "Read size high byte: %p:%x.",
     484            dma_channel.size_reg_address, value_high);
     485        fibril_mutex_unlock(&guard);
     486
     487        uint16_t remain = (value_high << 8 | value_low) ;
     488        /* 16 bit DMA size is in words,
     489         * the upper bits are bogus for 16bit transfers so we need to get
     490         * rid of them. Using limited type works well.*/
     491        if (is_dma16(channel))
     492                remain <<= 1;
     493        *size =  is_dma16(channel) ? remain + 2: remain + 1;
     494        return EOK;
     495}
    428496/**
    429497 * @}
  • uspace/drv/bus/isa/i8237.h

    r2921602 rab92305  
    3838#define DRV_BUS_ISA_I8237_H
    3939
    40 extern int dma_setup_channel(unsigned int, uint32_t, uint16_t, uint8_t);
     40extern int dma_channel_setup(unsigned, uint32_t, uint32_t, uint8_t);
     41extern int dma_channel_remain(unsigned, size_t *);
    4142
    4243#endif
  • uspace/drv/bus/isa/isa.c

    r2921602 rab92305  
    8585        fibril_mutex_t mutex;
    8686        ddf_fun_t *fnode;
     87        hw_resource_t resources[ISA_MAX_HW_RES];
    8788        hw_resource_list_t hw_resources;
    8889        link_t bus_link;
     
    103104static hw_resource_list_t *isa_get_fun_resources(ddf_fun_t *fnode)
    104105{
    105         isa_fun_t *fun = isa_fun(fnode);
    106         assert(fun != NULL);
    107 
    108         return &fun->hw_resources;
    109 }
    110 
    111 static bool isa_enable_fun_interrupt(ddf_fun_t *fnode)
     106        isa_fun_t *isa = isa_fun(fnode);
     107        assert(isa);
     108
     109        return &isa->hw_resources;
     110}
     111
     112static bool isa_fun_enable_interrupt(ddf_fun_t *fnode)
    112113{
    113114        /* This is an old ugly way, copied from pci driver */
    114115        assert(fnode);
    115         isa_fun_t *fun = isa_fun(fnode);
     116        isa_fun_t *isa = isa_fun(fnode);
     117        assert(isa);
    116118
    117119        sysarg_t apic;
     
    129131                return false;
    130132
    131         const hw_resource_list_t *res = &fun->hw_resources;
     133        const hw_resource_list_t *res = &isa->hw_resources;
    132134        assert(res);
    133135        for (size_t i = 0; i < res->count; ++i) {
     
    151153}
    152154
    153 static int isa_dma_channel_fun_setup(ddf_fun_t *fnode,
    154     unsigned int channel, uint32_t pa, uint16_t size, uint8_t mode)
     155static int isa_fun_setup_dma(ddf_fun_t *fnode,
     156    unsigned int channel, uint32_t pa, uint32_t size, uint8_t mode)
    155157{
    156158        assert(fnode);
    157         isa_fun_t *fun = isa_fun(fnode);
    158         const hw_resource_list_t *res = &fun->hw_resources;
     159        isa_fun_t *isa = isa_fun(fnode);
     160        assert(isa);
     161        const hw_resource_list_t *res = &isa->hw_resources;
    159162        assert(res);
    160        
    161         const unsigned int ch = channel;
     163
    162164        for (size_t i = 0; i < res->count; ++i) {
     165                /* Check for assigned channel */
    163166                if (((res->resources[i].type == DMA_CHANNEL_16) &&
    164                     (res->resources[i].res.dma_channel.dma16 == ch)) ||
     167                    (res->resources[i].res.dma_channel.dma16 == channel)) ||
    165168                    ((res->resources[i].type == DMA_CHANNEL_8) &&
    166                     (res->resources[i].res.dma_channel.dma8 == ch))) {
    167                         return dma_setup_channel(channel, pa, size, mode);
    168                 }
    169         }
    170        
     169                    (res->resources[i].res.dma_channel.dma8 == channel))) {
     170                        return dma_channel_setup(channel, pa, size, mode);
     171                }
     172        }
     173
     174        return EINVAL;
     175}
     176
     177static int isa_fun_remain_dma(ddf_fun_t *fnode,
     178    unsigned channel, size_t *size)
     179{
     180        assert(size);
     181        assert(fnode);
     182        isa_fun_t *isa = isa_fun(fnode);
     183        assert(isa);
     184        const hw_resource_list_t *res = &isa->hw_resources;
     185        assert(res);
     186
     187        for (size_t i = 0; i < res->count; ++i) {
     188                /* Check for assigned channel */
     189                if (((res->resources[i].type == DMA_CHANNEL_16) &&
     190                    (res->resources[i].res.dma_channel.dma16 == channel)) ||
     191                    ((res->resources[i].type == DMA_CHANNEL_8) &&
     192                    (res->resources[i].res.dma_channel.dma8 == channel))) {
     193                        return dma_channel_remain(channel, size);
     194                }
     195        }
     196
    171197        return EINVAL;
    172198}
     
    174200static hw_res_ops_t isa_fun_hw_res_ops = {
    175201        .get_resource_list = isa_get_fun_resources,
    176         .enable_interrupt = isa_enable_fun_interrupt,
    177         .dma_channel_setup = isa_dma_channel_fun_setup,
     202        .enable_interrupt = isa_fun_enable_interrupt,
     203        .dma_channel_setup = isa_fun_setup_dma,
     204        .dma_channel_remain = isa_fun_remain_dma,
    178205};
    179206
    180 static ddf_dev_ops_t isa_fun_ops;
     207static ddf_dev_ops_t isa_fun_ops= {
     208        .interfaces[HW_RES_DEV_IFACE] = &isa_fun_hw_res_ops,
     209};
    181210
    182211static int isa_dev_add(ddf_dev_t *dev);
     
    212241
    213242        fibril_mutex_initialize(&fun->mutex);
     243        fun->hw_resources.resources = fun->resources;
     244
    214245        fun->fnode = fnode;
    215246        return fun;
     
    270301{
    271302        char *line = str;
     303        *next = NULL;
    272304
    273305        if (str == NULL) {
    274                 *next = NULL;
    275306                return NULL;
    276307        }
     
    282313        if (*str != '\0') {
    283314                *next = str + 1;
    284         } else {
    285                 *next = NULL;
    286315        }
    287316
     
    310339        /* Get the name part of the rest of the line. */
    311340        strtok(line, ":");
    312 
    313         /* Allocate output buffer. */
    314         size_t size = str_size(line) + 1;
    315         char *name = malloc(size);
    316 
    317         if (name != NULL) {
    318                 /* Copy the result to the output buffer. */
    319                 str_cpy(name, size, line);
    320         }
    321 
    322         return name;
    323 }
    324 
    325 static inline char *skip_spaces(char *line)
     341        return line;
     342}
     343
     344static inline const char *skip_spaces(const char *line)
    326345{
    327346        /* Skip leading spaces. */
     
    332351}
    333352
    334 static void isa_fun_set_irq(isa_fun_t *fun, int irq)
     353static void isa_fun_add_irq(isa_fun_t *fun, int irq)
    335354{
    336355        size_t count = fun->hw_resources.count;
     
    348367}
    349368
    350 static void isa_fun_set_dma(isa_fun_t *fun, int dma)
     369static void isa_fun_add_dma(isa_fun_t *fun, int dma)
    351370{
    352371        size_t count = fun->hw_resources.count;
     
    381400}
    382401
    383 static void isa_fun_set_io_range(isa_fun_t *fun, size_t addr, size_t len)
     402static void isa_fun_add_io_range(isa_fun_t *fun, size_t addr, size_t len)
    384403{
    385404        size_t count = fun->hw_resources.count;
     
    400419}
    401420
    402 static void fun_parse_irq(isa_fun_t *fun, char *val)
     421static void fun_parse_irq(isa_fun_t *fun, const char *val)
    403422{
    404423        int irq = 0;
     
    409428
    410429        if (val != end)
    411                 isa_fun_set_irq(fun, irq);
    412 }
    413 
    414 static void fun_parse_dma(isa_fun_t *fun, char *val)
    415 {
    416         unsigned int dma = 0;
     430                isa_fun_add_irq(fun, irq);
     431}
     432
     433static void fun_parse_dma(isa_fun_t *fun, const char *val)
     434{
    417435        char *end = NULL;
    418436       
    419437        val = skip_spaces(val);
    420         dma = (unsigned int) strtol(val, &end, 10);
     438        const int dma = strtol(val, &end, 10);
    421439       
    422440        if (val != end)
    423                 isa_fun_set_dma(fun, dma);
    424 }
    425 
    426 static void fun_parse_io_range(isa_fun_t *fun, char *val)
     441                isa_fun_add_dma(fun, dma);
     442}
     443
     444static void fun_parse_io_range(isa_fun_t *fun, const char *val)
    427445{
    428446        size_t addr, len;
     
    441459                return;
    442460
    443         isa_fun_set_io_range(fun, addr, len);
    444 }
    445 
    446 static void get_match_id(char **id, char *val)
    447 {
    448         char *end = val;
     461        isa_fun_add_io_range(fun, addr, len);
     462}
     463
     464static void get_match_id(char **id, const char *val)
     465{
     466        const char *end = val;
    449467
    450468        while (!isspace(*end))
     
    456474}
    457475
    458 static void fun_parse_match_id(isa_fun_t *fun, char *val)
     476static void fun_parse_match_id(isa_fun_t *fun, const char *val)
    459477{
    460478        char *id = NULL;
    461         int score = 0;
    462479        char *end = NULL;
    463         int rc;
    464480
    465481        val = skip_spaces(val);
    466482
    467         score = (int)strtol(val, &end, 10);
     483        int score = (int)strtol(val, &end, 10);
    468484        if (val == end) {
    469485                ddf_msg(LVL_ERROR, "Cannot read match score for function "
     
    483499            "function %s", id, score, ddf_fun_get_name(fun->fnode));
    484500
    485         rc = ddf_fun_add_match_id(fun->fnode, id, score);
     501        int rc = ddf_fun_add_match_id(fun->fnode, id, score);
    486502        if (rc != EOK) {
    487503                ddf_msg(LVL_ERROR, "Failed adding match ID: %s",
     
    492508}
    493509
    494 static bool prop_parse(isa_fun_t *fun, char *line, const char *prop,
    495     void (*read_fn)(isa_fun_t *, char *))
     510static bool prop_parse(isa_fun_t *fun, const char *line, const char *prop,
     511    void (*read_fn)(isa_fun_t *, const char *))
    496512{
    497513        size_t proplen = str_size(prop);
     
    508524}
    509525
    510 static void fun_prop_parse(isa_fun_t *fun, char *line)
     526static void fun_prop_parse(isa_fun_t *fun, const char *line)
    511527{
    512528        /* Skip leading spaces. */
     
    523539}
    524540
    525 static void fun_hw_res_alloc(isa_fun_t *fun)
    526 {
    527         fun->hw_resources.resources =
    528             (hw_resource_t *) malloc(sizeof(hw_resource_t) * ISA_MAX_HW_RES);
    529 }
    530 
    531 static void fun_hw_res_free(isa_fun_t *fun)
    532 {
    533         free(fun->hw_resources.resources);
    534         fun->hw_resources.resources = NULL;
    535 }
    536 
    537541static char *isa_fun_read_info(char *fun_conf, isa_bus_t *isa)
    538542{
    539543        char *line;
    540         char *fun_name = NULL;
    541544
    542545        /* Skip empty lines. */
    543         while (true) {
     546        do {
    544547                line = str_get_line(fun_conf, &fun_conf);
    545548
     
    549552                }
    550553
    551                 if (!line_empty(line))
    552                         break;
    553         }
     554        } while (line_empty(line));
    554555
    555556        /* Get device name. */
    556         fun_name = get_device_name(line);
     557        const char *fun_name = get_device_name(line);
    557558        if (fun_name == NULL)
    558559                return NULL;
    559560
    560561        isa_fun_t *fun = isa_fun_create(isa, fun_name);
    561         free(fun_name);
    562562        if (fun == NULL) {
    563563                return NULL;
    564564        }
    565 
    566         /* Allocate buffer for the list of hardware resources of the device. */
    567         fun_hw_res_alloc(fun);
    568565
    569566        /* Get properties of the device (match ids, irq and io range). */
     
    596593}
    597594
    598 static void fun_conf_parse(char *conf, isa_bus_t *isa)
    599 {
     595static void isa_functions_add(isa_bus_t *isa)
     596{
     597        char *conf = fun_conf_read(CHILD_FUN_CONF_PATH);
    600598        while (conf != NULL && *conf != '\0') {
    601599                conf = isa_fun_read_info(conf, isa);
    602600        }
    603 }
    604 
    605 static void isa_functions_add(isa_bus_t *isa)
    606 {
    607         char *fun_conf;
    608 
    609         fun_conf = fun_conf_read(CHILD_FUN_CONF_PATH);
    610         if (fun_conf != NULL) {
    611                 fun_conf_parse(fun_conf, isa);
    612                 free(fun_conf);
    613         }
     601        free(conf);
    614602}
    615603
    616604static int isa_dev_add(ddf_dev_t *dev)
    617605{
    618         isa_bus_t *isa;
    619 
    620606        ddf_msg(LVL_DEBUG, "isa_dev_add, device handle = %d",
    621607            (int) ddf_dev_get_handle(dev));
    622608
    623         isa = ddf_dev_data_alloc(dev, sizeof(isa_bus_t));
     609        isa_bus_t *isa = ddf_dev_data_alloc(dev, sizeof(isa_bus_t));
    624610        if (isa == NULL)
    625611                return ENOMEM;
     
    658644{
    659645        isa_bus_t *isa = isa_bus(dev);
    660         int rc;
    661646
    662647        fibril_mutex_lock(&isa->mutex);
     
    666651                    isa_fun_t, bus_link);
    667652
    668                 rc = ddf_fun_offline(fun->fnode);
     653                int rc = ddf_fun_offline(fun->fnode);
    669654                if (rc != EOK) {
    670655                        fibril_mutex_unlock(&isa->mutex);
     
    682667                list_remove(&fun->bus_link);
    683668
    684                 fun_hw_res_free(fun);
    685669                ddf_fun_destroy(fun->fnode);
    686670        }
     
    709693}
    710694
    711 
    712 static void isa_init()
    713 {
     695int main(int argc, char *argv[])
     696{
     697        printf(NAME ": HelenOS ISA bus driver\n");
    714698        ddf_log_init(NAME);
    715         isa_fun_ops.interfaces[HW_RES_DEV_IFACE] = &isa_fun_hw_res_ops;
    716 }
    717 
    718 int main(int argc, char *argv[])
    719 {
    720         printf(NAME ": HelenOS ISA bus driver\n");
    721         isa_init();
    722699        return ddf_driver_main(&isa_driver);
    723700}
  • uspace/drv/infrastructure/root/root.c

    r2921602 rab92305  
    208208        /*
    209209         * Register virtual devices root.
    210          * We ignore error occurrence because virtual devices shall not be
     210         * We warn on error occurrence because virtual devices shall not be
    211211         * vital for the system.
    212212         */
    213         (void) add_virtual_root_fun(dev);
     213        int res = add_virtual_root_fun(dev);
     214        if (res != EOK)
     215                ddf_msg(LVL_WARN, "Failed to add virtual child.");
    214216
    215217        /* Register root device's children. */
    216         int res = add_platform_fun(dev);
     218        res = add_platform_fun(dev);
    217219        if (EOK != res)
    218220                ddf_msg(LVL_ERROR, "Failed adding child device for platform.");
  • uspace/drv/nic/e1k/e1k.c

    r2921602 rab92305  
    5959#define E1000_DEFAULT_INTERRUPT_INTERVAL_USEC  250
    6060
    61 /* Must be power of 8 */
    62 #define E1000_RX_FRAME_COUNT  128
    63 #define E1000_TX_FRAME_COUNT  128
     61/* Must be power of 8 */ //TODO power or multiple? previous value was 128
     62#define E1000_RX_FRAME_COUNT  8
     63#define E1000_TX_FRAME_COUNT  8
    6464
    6565#define E1000_RECEIVE_ADDRESS  16
  • uspace/lib/c/generic/async.c

    r2921602 rab92305  
    22812281bool async_data_read_receive(ipc_callid_t *callid, size_t *size)
    22822282{
     2283        ipc_call_t data;
     2284        return async_data_read_receive_call(callid, &data, size);
     2285}
     2286
     2287/** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework.
     2288 *
     2289 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ
     2290 * calls so that the user doesn't have to remember the meaning of each IPC
     2291 * argument.
     2292 *
     2293 * So far, this wrapper is to be used from within a connection fibril.
     2294 *
     2295 * @param callid Storage for the hash of the IPC_M_DATA_READ.
     2296 * @param size   Storage for the maximum size. Can be NULL.
     2297 *
     2298 * @return True on success, false on failure.
     2299 *
     2300 */
     2301bool async_data_read_receive_call(ipc_callid_t *callid, ipc_call_t *data,
     2302    size_t *size)
     2303{
    22832304        assert(callid);
    2284        
    2285         ipc_call_t data;
    2286         *callid = async_get_call(&data);
    2287        
    2288         if (IPC_GET_IMETHOD(data) != IPC_M_DATA_READ)
     2305        assert(data);
     2306       
     2307        *callid = async_get_call(data);
     2308       
     2309        if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_READ)
    22892310                return false;
    22902311       
    22912312        if (size)
    2292                 *size = (size_t) IPC_GET_ARG2(data);
     2313                *size = (size_t) IPC_GET_ARG2(*data);
    22932314       
    22942315        return true;
     
    23852406bool async_data_write_receive(ipc_callid_t *callid, size_t *size)
    23862407{
     2408        ipc_call_t data;
     2409        return async_data_write_receive_call(callid, &data, size);
     2410}
     2411
     2412/** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework.
     2413 *
     2414 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE
     2415 * calls so that the user doesn't have to remember the meaning of each IPC
     2416 * argument.
     2417 *
     2418 * So far, this wrapper is to be used from within a connection fibril.
     2419 *
     2420 * @param callid Storage for the hash of the IPC_M_DATA_WRITE.
     2421 * @param data   Storage for the ipc call data.
     2422 * @param size   Storage for the suggested size. May be NULL.
     2423 *
     2424 * @return True on success, false on failure.
     2425 *
     2426 */
     2427bool async_data_write_receive_call(ipc_callid_t *callid, ipc_call_t *data,
     2428    size_t *size)
     2429{
    23872430        assert(callid);
    2388        
    2389         ipc_call_t data;
    2390         *callid = async_get_call(&data);
    2391        
    2392         if (IPC_GET_IMETHOD(data) != IPC_M_DATA_WRITE)
     2431        assert(data);
     2432       
     2433        *callid = async_get_call(data);
     2434       
     2435        if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_WRITE)
    23932436                return false;
    23942437       
    23952438        if (size)
    2396                 *size = (size_t) IPC_GET_ARG2(data);
     2439                *size = (size_t) IPC_GET_ARG2(*data);
    23972440       
    23982441        return true;
  • uspace/lib/c/generic/device/hw_res.c

    r2921602 rab92305  
    4242{
    4343        sysarg_t count = 0;
    44        
     44
    4545        async_exch_t *exch = async_exchange_begin(sess);
     46        if (exch == NULL)
     47                return ENOMEM;
    4648        int rc = async_req_1_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    4749            HW_RES_GET_RESOURCE_LIST, &count);
    48        
     50
    4951        if (rc != EOK) {
    5052                async_exchange_end(exch);
    5153                return rc;
    5254        }
    53        
     55
    5456        size_t size = count * sizeof(hw_resource_t);
    5557        hw_resource_t *resources = (hw_resource_t *) malloc(size);
     
    5961                return ENOMEM;
    6062        }
    61        
     63
    6264        rc = async_data_read_start(exch, resources, size);
    6365        async_exchange_end(exch);
    64        
     66
    6567        if (rc != EOK) {
    6668                free(resources);
    6769                return rc;
    6870        }
    69        
     71
    7072        hw_resources->resources = resources;
    7173        hw_resources->count = count;
    72        
     74
    7375        return EOK;
    7476}
     
    7779{
    7880        async_exch_t *exch = async_exchange_begin(sess);
     81        if (exch == NULL)
     82                return false;
    7983        int rc = async_req_1_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
    8084            HW_RES_ENABLE_INTERRUPT);
    8185        async_exchange_end(exch);
    82        
     86
    8387        return (rc == EOK);
     88}
     89
     90/**
     91 * Setup DMA channel to specified place and mode.
     92 * @param channel DMA Channel 1,2,3 for 8 bit transfers, 5,6,7 for 16 bit.
     93 * @param pa Physical address of the buffer. Must be < 16MB for 16 bit and < 1MB
     94 *           for 8 bit transfers.
     95 * @param size DMA buffer size, limited to 64K.
     96 * @param mode Mode of the DMA channel:
     97 *              - Read or Write
     98 *              - Allow automatic reset
     99 *              - Use address decrement instead of increment
     100 *              - Use SINGLE/BLOCK/ON DEMAND transfer mode
     101 * @return Error code.
     102 */
     103int hw_res_dma_channel_setup(async_sess_t *sess,
     104    unsigned channel, uint32_t pa, uint32_t size, uint8_t mode)
     105{
     106        async_exch_t *exch = async_exchange_begin(sess);
     107        if (exch == NULL)
     108                return ENOMEM;
     109        const uint32_t packed = (channel & 0xffff) | (mode << 16);
     110        const int ret = async_req_4_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
     111            HW_RES_DMA_CHANNEL_SETUP, packed, pa, size);
     112        async_exchange_end(exch);
     113
     114        return ret;
     115}
     116
     117/**
     118 * Query remaining bytes in the buffer.
     119 * @param channel DMA Channel 1,2,3 for 8 bit transfers, 5,6,7 for 16 bit.
     120 * @return Number of bytes remaining in the buffer(>=0) or error code(<0).
     121 */
     122int hw_res_dma_channel_remain(async_sess_t *sess, unsigned channel)
     123{
     124        async_exch_t *exch = async_exchange_begin(sess);
     125        if (exch == NULL)
     126                return ENOMEM;
     127        sysarg_t remain;
     128        const int ret = async_req_2_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE),
     129            HW_RES_DMA_CHANNEL_REMAIN, channel, &remain);
     130        async_exchange_end(exch);
     131        if (ret == EOK)
     132                return remain;
     133        return ret;
    84134}
    85135
  • uspace/lib/c/generic/device/hw_res_parsed.c

    r2921602 rab92305  
    3838#include <errno.h>
    3939
    40 static void hw_res_parse_add_irq(hw_res_list_parsed_t *out, hw_resource_t *res,
    41     int flags)
     40static void hw_res_parse_add_dma_channel(hw_res_list_parsed_t *out,
     41    const hw_resource_t *res, int flags)
     42{
     43        assert(res);
     44        assert((res->type == DMA_CHANNEL_8) || (res->type == DMA_CHANNEL_16));
     45       
     46        const unsigned channel = (res->type == DMA_CHANNEL_8) ?
     47            res->res.dma_channel.dma8 : res->res.dma_channel.dma16;
     48        const size_t count = out->dma_channels.count;
     49        const int keep_duplicit = flags & HW_RES_KEEP_DUPLICIT;
     50       
     51        if (!keep_duplicit) {
     52                for (size_t i = 0; i < count; ++i) {
     53                        if (out->dma_channels.channels[i] == channel)
     54                                return;
     55                }
     56        }
     57       
     58        out->dma_channels.channels[count] = channel;
     59        ++out->dma_channels.count;
     60}
     61
     62static void hw_res_parse_add_irq(hw_res_list_parsed_t *out,
     63    const hw_resource_t *res, int flags)
    4264{
    4365        assert(res && (res->type == INTERRUPT));
     
    5981
    6082static void hw_res_parse_add_io_range(hw_res_list_parsed_t *out,
    61     hw_resource_t *res, int flags)
     83    const hw_resource_t *res, int flags)
    6284{
    6385        assert(res && (res->type == IO_RANGE));
     
    90112
    91113static void hw_res_parse_add_mem_range(hw_res_list_parsed_t *out,
    92     hw_resource_t *res, int flags)
     114    const hw_resource_t *res, int flags)
    93115{
    94116        assert(res && (res->type == MEM_RANGE));
     
    132154 *
    133155 */
    134 int hw_res_list_parse(hw_resource_list_t *hw_resources,
     156int hw_res_list_parse(const hw_resource_list_t *hw_resources,
    135157    hw_res_list_parsed_t *out, int flags)
    136158{
     
    141163        hw_res_list_parsed_clean(out);
    142164       
    143         out->irqs.irqs = malloc(res_count * sizeof(int));
    144         out->io_ranges.ranges = malloc(res_count * sizeof(io_range_t));
    145         out->mem_ranges.ranges = malloc(res_count * sizeof(mem_range_t));
     165        out->irqs.irqs = calloc(res_count, sizeof(int));
     166        out->dma_channels.channels = calloc(res_count, sizeof(int));
     167        out->io_ranges.ranges = calloc(res_count, sizeof(io_range_t));
     168        out->mem_ranges.ranges = calloc(res_count, sizeof(mem_range_t));
     169        if (!out->irqs.irqs || !out->dma_channels.channels ||
     170            !out->io_ranges.ranges || !out->mem_ranges.ranges) {
     171                hw_res_list_parsed_clean(out);
     172                return ENOMEM;
     173        }
    146174       
    147175        for (size_t i = 0; i < res_count; ++i) {
    148                 hw_resource_t *resource = &(hw_resources->resources[i]);
    149                
     176                const hw_resource_t *resource = &(hw_resources->resources[i]);
     177
    150178                switch (resource->type) {
    151179                case INTERRUPT:
     
    158186                        hw_res_parse_add_mem_range(out, resource, flags);
    159187                        break;
     188                case DMA_CHANNEL_8:
     189                case DMA_CHANNEL_16:
     190                        hw_res_parse_add_dma_channel(out, resource, flags);
     191                        break;
    160192                default:
     193                        hw_res_list_parsed_clean(out);
    161194                        return EINVAL;
    162195                }
    163196        }
    164        
     197
    165198        return EOK;
    166199};
  • uspace/lib/c/include/async.h

    r2921602 rab92305  
    399399extern int async_data_read_start(async_exch_t *, void *, size_t);
    400400extern bool async_data_read_receive(ipc_callid_t *, size_t *);
     401extern bool async_data_read_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    401402extern int async_data_read_finalize(ipc_callid_t, const void *, size_t);
    402403
     
    437438extern int async_data_write_start(async_exch_t *, const void *, size_t);
    438439extern bool async_data_write_receive(ipc_callid_t *, size_t *);
     440extern bool async_data_write_receive_call(ipc_callid_t *, ipc_call_t *, size_t *);
    439441extern int async_data_write_finalize(ipc_callid_t, void *, size_t);
    440442
  • uspace/lib/c/include/device/hw_res.h

    r2921602 rab92305  
    5353        HW_RES_ENABLE_INTERRUPT,
    5454        HW_RES_DMA_CHANNEL_SETUP,
     55        HW_RES_DMA_CHANNEL_REMAIN,
    5556} hw_res_method_t;
    5657
     
    115116
    116117extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
    117     uint16_t, uint8_t);
     118    uint32_t, uint8_t);
     119extern int hw_res_dma_channel_remain(async_sess_t *, unsigned);
    118120
    119121#endif
  • uspace/lib/c/include/device/hw_res_parsed.h

    r2921602 rab92305  
    139139}
    140140
    141 extern int hw_res_list_parse(hw_resource_list_t *, hw_res_list_parsed_t *, int);
     141extern int hw_res_list_parse(
     142    const hw_resource_list_t *, hw_res_list_parsed_t *, int);
    142143extern int hw_res_get_list_parsed(async_sess_t *, hw_res_list_parsed_t *, int);
    143144
  • uspace/lib/c/include/ipc/dev_iface.h

    r2921602 rab92305  
    3636typedef enum {
    3737        HW_RES_DEV_IFACE = 0,
     38
     39        /** Audio device mixer interface */
     40        AUDIO_MIXER_IFACE,
     41        /** Audio device pcm buffer interface */
     42        AUDIO_PCM_BUFFER_IFACE,
     43
    3844        /** Character device interface */
    3945        CHAR_DEV_IFACE,
  • uspace/lib/drv/Makefile

    r2921602 rab92305  
    2929
    3030USPACE_PREFIX = ../..
    31 EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include
     31EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include -I$(LIBPCM_PREFIX)/include
    3232LIBRARY = libdrv
    3333
     
    3838        generic/log.c \
    3939        generic/logbuf.c \
     40        generic/remote_audio_mixer.c \
     41        generic/remote_audio_pcm.c \
    4042        generic/remote_hw_res.c \
    4143        generic/remote_char_dev.c \
  • uspace/lib/drv/generic/dev_iface.c

    r2921602 rab92305  
    4949#include "remote_usbhid.h"
    5050#include "remote_pci.h"
     51#include "remote_audio_mixer.h"
     52#include "remote_audio_pcm.h"
    5153#include "remote_ahci.h"
    5254
    53 static iface_dipatch_table_t remote_ifaces = {
     55static const iface_dipatch_table_t remote_ifaces = {
    5456        .ifaces = {
    55                 &remote_hw_res_iface,
    56                 &remote_char_dev_iface,
    57                 &remote_graph_dev_iface,
    58                 &remote_nic_iface,
    59                 &remote_pci_iface,
    60                 &remote_usb_iface,
    61                 &remote_usbhc_iface,
    62                 &remote_usbhid_iface,
    63                 &remote_clock_dev_iface,
    64                 &remote_battery_dev_iface,
    65                 &remote_ahci_iface
     57                [AUDIO_MIXER_IFACE] = &remote_audio_mixer_iface,
     58                [AUDIO_PCM_BUFFER_IFACE] = &remote_audio_pcm_iface,
     59                [HW_RES_DEV_IFACE] = &remote_hw_res_iface,
     60                [CHAR_DEV_IFACE] = &remote_char_dev_iface,
     61                [GRAPH_DEV_IFACE] = &remote_graph_dev_iface,
     62                [NIC_DEV_IFACE] = &remote_nic_iface,
     63                [PCI_DEV_IFACE] = &remote_pci_iface,
     64                [USB_DEV_IFACE] = &remote_usb_iface,
     65                [USBHC_DEV_IFACE] = &remote_usbhc_iface,
     66                [USBHID_DEV_IFACE] = &remote_usbhid_iface,
     67                [CLOCK_DEV_IFACE] = &remote_clock_dev_iface,
     68                [BATTERY_DEV_IFACE] = &remote_battery_dev_iface,
     69                [AHCI_DEV_IFACE] = &remote_ahci_iface,
    6670        }
    6771};
  • uspace/lib/drv/generic/remote_hw_res.c

    r2921602 rab92305  
    11/*
    22 * Copyright (c) 2010 Lenka Trochtova
     3 * Copyright (c) 2011 Jan Vesely
    34 * All rights reserved.
    45 *
     
    4344static void remote_hw_res_enable_interrupt(ddf_fun_t *, void *, ipc_callid_t,
    4445    ipc_call_t *);
     46static void remote_hw_res_dma_channel_setup(ddf_fun_t *, void *, ipc_callid_t,
     47    ipc_call_t *);
     48static void remote_hw_res_dma_channel_remain(ddf_fun_t *, void *, ipc_callid_t,
     49    ipc_call_t *);
    4550
    4651static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = {
    47         &remote_hw_res_get_resource_list,
    48         &remote_hw_res_enable_interrupt
     52        [HW_RES_GET_RESOURCE_LIST] = &remote_hw_res_get_resource_list,
     53        [HW_RES_ENABLE_INTERRUPT] = &remote_hw_res_enable_interrupt,
     54        [HW_RES_DMA_CHANNEL_SETUP] = &remote_hw_res_dma_channel_setup,
     55        [HW_RES_DMA_CHANNEL_REMAIN] = &remote_hw_res_dma_channel_remain,
    4956};
    5057
     
    94101}
    95102
     103static void remote_hw_res_dma_channel_setup(ddf_fun_t *fun, void *ops,
     104    ipc_callid_t callid, ipc_call_t *call)
     105{
     106        hw_res_ops_t *hw_res_ops = ops;
     107
     108        if (hw_res_ops->dma_channel_setup == NULL) {
     109                async_answer_0(callid, ENOTSUP);
     110                return;
     111        }
     112        const unsigned channel = DEV_IPC_GET_ARG1(*call) & 0xffff;
     113        const uint8_t  mode = DEV_IPC_GET_ARG1(*call) >> 16;
     114        const uint32_t address = DEV_IPC_GET_ARG2(*call);
     115        const uint32_t size = DEV_IPC_GET_ARG3(*call);
     116
     117        const int ret = hw_res_ops->dma_channel_setup(
     118            fun, channel, address, size, mode);
     119        async_answer_0(callid, ret);
     120}
     121
     122static void remote_hw_res_dma_channel_remain(ddf_fun_t *fun, void *ops,
     123    ipc_callid_t callid, ipc_call_t *call)
     124{
     125        hw_res_ops_t *hw_res_ops = ops;
     126
     127        if (hw_res_ops->dma_channel_setup == NULL) {
     128                async_answer_0(callid, ENOTSUP);
     129                return;
     130        }
     131        const unsigned channel = DEV_IPC_GET_ARG1(*call);
     132        size_t remain = 0;
     133        const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain);
     134        async_answer_1(callid, ret, remain);
     135}
    96136/**
    97137 * @}
  • uspace/lib/drv/include/ops/hw_res.h

    r2921602 rab92305  
    4444        hw_resource_list_t *(*get_resource_list)(ddf_fun_t *);
    4545        bool (*enable_interrupt)(ddf_fun_t *);
    46         int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint16_t, uint8_t);
     46        int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint32_t, uint8_t);
     47        int (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *);
    4748} hw_res_ops_t;
    4849
  • uspace/lib/softfloat/softfloat.c

    r2921602 rab92305  
    12651265}
    12661266
     1267
     1268float __aeabi_i2f(int i)
     1269{
     1270        return __floatsisf(i);
     1271}
     1272
     1273float __aeabi_ui2f(int i)
     1274{
     1275        return __floatunsisf(i);
     1276}
     1277
    12671278double __aeabi_i2d(int i)
    12681279{
     
    12801291}
    12811292
     1293int __aeabi_f2uiz(float a)
     1294{
     1295        return __fixunssfsi(a);
     1296}
     1297
    12821298int __aeabi_d2iz(double a)
    12831299{
     
    12881304{
    12891305        return __fixunsdfsi(a);
     1306}
     1307
     1308int __aeabi_fcmpge(float a, float b)
     1309{
     1310        return __gesf2(a, b);
     1311}
     1312
     1313int __aeabi_fcmpgt(float a, float b)
     1314{
     1315        return __gtsf2(a, b);
     1316}
     1317
     1318int __aeabi_fcmplt(float a, float b)
     1319{
     1320        return __ltsf2(a, b);
     1321}
     1322
     1323int __aeabi_fcmpeq(float a, float b)
     1324{
     1325        return __eqsf2(a, b);
    12901326}
    12911327
  • uspace/lib/softfloat/softfloat.h

    r2921602 rab92305  
    204204
    205205/* ARM EABI */
     206extern float __aeabi_i2f(int);
     207extern float __aeabi_ui2f(int);
    206208extern double __aeabi_i2d(int);
    207209extern double __aeabi_ui2d(unsigned int);
     
    209211
    210212extern int __aeabi_f2iz(float);
     213extern int __aeabi_f2uiz(float);
    211214extern int __aeabi_d2iz(double);
     215
     216extern int __aeabi_fcmpge(float, float);
     217extern int __aeabi_fcmpgt(float, float);
     218extern int __aeabi_fcmplt(float, float);
     219extern int __aeabi_fcmpeq(float, float);
    212220
    213221extern int __aeabi_dcmpge(double, double);
  • uspace/srv/hid/compositor/compositor.c

    r2921602 rab92305  
    21722172        /* Establish input bidirectional connection. */
    21732173        rc = input_connect(input_svc);
    2174         if (rc != EOK)
     2174        if (rc != EOK) {
     2175                printf("%s: Failed to connect to input service.\n", NAME);
    21752176                return rc;
     2177        }
    21762178
    21772179        /* Create viewports and connect them to visualizers. */
     
    21792181        rc = loc_category_get_id("visualizer", &cat_id, IPC_FLAG_BLOCKING);
    21802182        if (rc != EOK) {
     2183                printf("%s: Failed to get visualizer category.\n", NAME);
    21812184                input_disconnect();
    21822185                return -1;
     
    21872190        rc = loc_category_get_svcs(cat_id, &svcs, &svcs_cnt);
    21882191        if (rc != EOK || svcs_cnt == 0) {
     2192                printf("%s: Failed to get visualizer category services.\n", NAME);
    21892193                input_disconnect();
    21902194                return -1;
     
    22032207       
    22042208        if (list_empty(&viewport_list)) {
     2209                printf("%s: Failed to get view ports.\n", NAME);
    22052210                input_disconnect();
    22062211                return -1;
  • uspace/srv/locsrv/locsrv.c

    r2921602 rab92305  
    13771377        categ_dir_add_cat(&cdir, cat);
    13781378       
     1379        cat = category_new("audio-pcm");
     1380        categ_dir_add_cat(&cdir, cat);
     1381       
    13791382        return true;
    13801383}
Note: See TracChangeset for help on using the changeset viewer.