Changes in / [16639bb:f7ea5400] in mainline


Ignore:
Files:
4 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • boot/Makefile.common

    r16639bb rf7ea5400  
    108108        $(USPACE_PATH)/srv/fs/ext4fs/ext4fs \
    109109        $(USPACE_PATH)/srv/hid/remcons/remcons \
    110         $(USPACE_PATH)/srv/hid/isdv4_tablet/isdv4_tablet \
    111110        $(USPACE_PATH)/srv/net/ethip/ethip \
    112111        $(USPACE_PATH)/srv/net/inetsrv/inetsrv \
  • uspace/Makefile

    r16639bb rf7ea5400  
    102102        srv/hid/console \
    103103        srv/hid/s3c24xx_ts \
    104         srv/hid/isdv4_tablet \
    105104        srv/hid/fb \
    106105        srv/hid/input \
  • uspace/app/edit/edit.c

    r16639bb rf7ea5400  
    842842                /* Fill until the end of display area. */
    843843
    844                 if ((unsigned)s_column - 1 < scr_columns)
    845                         fill = scr_columns - (s_column - 1);
     844                if (str_length(row_buf) < (unsigned) scr_columns)
     845                        fill = scr_columns - str_length(row_buf);
    846846                else
    847847                        fill = 0;
  • uspace/app/sportdmp/sportdmp.c

    r16639bb rf7ea5400  
    140140                ssize_t i;
    141141                for (i = 0; i < read; i++) {
    142                         printf("%02hhx ", buf[i]);
     142                        if ((buf[i] >= 32) && (buf[i] < 128))
     143                                putchar((wchar_t) buf[i]);
     144                        else
     145                                putchar('.');
     146                        fflush(stdout);
    143147                }
    144                 fflush(stdout);
    145148        }
    146149       
  • uspace/drv/bus/usb/usbmast/main.c

    r16639bb rf7ea5400  
    8282    void *arg);
    8383
    84 static int usbmast_bd_open(bd_srvs_t *, bd_srv_t *);
     84static int usbmast_bd_open(bd_srv_t *);
    8585static int usbmast_bd_close(bd_srv_t *);
    8686static int usbmast_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    100100static usbmast_fun_t *bd_srv_usbmast(bd_srv_t *bd)
    101101{
    102         return (usbmast_fun_t *)bd->srvs->sarg;
     102        return (usbmast_fun_t *)bd->arg;
    103103}
    104104
     
    240240        mfun->lun = lun;
    241241
    242         bd_srvs_init(&mfun->bds);
    243         mfun->bds.ops = &usbmast_bd_ops;
    244         mfun->bds.sarg = mfun;
     242        bd_srv_init(&mfun->bd);
     243        mfun->bd.ops = &usbmast_bd_ops;
     244        mfun->bd.arg = mfun;
    245245
    246246        /* Set up a connection handler. */
     
    311311
    312312        mfun = (usbmast_fun_t *) ((ddf_fun_t *)arg)->driver_data;
    313         bd_conn(iid, icall, &mfun->bds);
     313        bd_conn(iid, icall, &mfun->bd);
    314314}
    315315
    316316/** Open device. */
    317 static int usbmast_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     317static int usbmast_bd_open(bd_srv_t *bd)
    318318{
    319319        return EOK;
  • uspace/drv/bus/usb/usbmast/usbmast.h

    r16639bb rf7ea5400  
    6969        /** Block size in bytes */
    7070        size_t block_size;
    71         /** Block device service structure */
    72         bd_srvs_t bds;
     71        /** Block device server structure */
     72        bd_srv_t bd;
    7373} usbmast_fun_t;
    7474
  • uspace/drv/char/ns8250/cyclic_buffer.h

    r16639bb rf7ea5400  
    3636#define CYCLIC_BUFFER_H_
    3737
    38 #define BUF_LEN 4096
     38#define BUF_LEN 256
    3939
    4040typedef struct cyclic_buffer {
  • uspace/drv/char/ns8250/ns8250.c

    r16639bb rf7ea5400  
    8282/** Interrupt ID Register definition. */
    8383#define NS8250_IID_ACTIVE       (1 << 0)
    84 #define NS8250_IID_CAUSE_MASK 0x0e
    85 #define NS8250_IID_CAUSE_RXSTATUS 0x06
    8684
    8785/** FIFO Control Register definition. */
     
    181179        /** The fibril mutex for synchronizing the access to the device. */
    182180        fibril_mutex_t mutex;
    183         /** Indicates that some data has become available */
    184         fibril_condvar_t input_buffer_available;
    185181        /** True if device is removed. */
    186182        bool removed;
     
    242238{
    243239        ns8250_t *ns = NS8250(fun);
    244         int ret = 0;
    245        
    246         if (count == 0) return 0;
     240        int ret = EOK;
    247241       
    248242        fibril_mutex_lock(&ns->mutex);
    249         while (buf_is_empty(&ns->input_buffer))
    250                 fibril_condvar_wait(&ns->input_buffer_available, &ns->mutex);
    251243        while (!buf_is_empty(&ns->input_buffer) && (size_t)ret < count) {
    252244                buf[ret] = (char)buf_pop_front(&ns->input_buffer);
     
    468460{
    469461        /* Interrupt when data received. */
    470         pio_write_8(&regs->ier, NS8250_IER_RXREADY | NS8250_IER_RXSTATUS);
     462        pio_write_8(&regs->ier, NS8250_IER_RXREADY);
    471463        pio_write_8(&regs->mcr, NS8250_MCR_DTR | NS8250_MCR_RTS
    472464            | NS8250_MCR_OUT2);
     
    507499        async_exchange_end(exch);
    508500
    509         /* Read LSR to clear possible previous LSR interrupt */
    510         pio_read_8(&ns->regs->lsr);
    511 
    512501        /* Enable interrupt on the serial port. */
    513502        ns8250_port_interrupts_enable(ns->regs);
     
    706695        /* 8 bits, no parity, two stop bits. */
    707696        ns8250_port_set_com_props(ns->regs, SERIAL_NO_PARITY, 8, 2);
    708         /*
    709          * Enable FIFO, clear them, with 4-byte threshold for greater
    710          * reliability.
    711          */
     697        /* Enable FIFO, clear them, with 14-byte threshold. */
    712698        pio_write_8(&ns->regs->iid, NS8250_FCR_FIFOENABLE
    713             | NS8250_FCR_RXFIFORESET | NS8250_FCR_TXFIFORESET
    714             | NS8250_FCR_RXTRIGGERLOW);
     699            | NS8250_FCR_RXFIFORESET | NS8250_FCR_TXFIFORESET 
     700            | NS8250_FCR_RXTRIGGERLOW | NS8250_FCR_RXTRIGGERHI);
    715701        /*
    716702         * RTS/DSR set (Request to Send and Data Terminal Ready lines enabled),
     
    745731        bool cont = true;
    746732       
    747         fibril_mutex_lock(&ns->mutex);
    748733        while (cont) {
     734                fibril_mutex_lock(&ns->mutex);
     735               
    749736                cont = ns8250_received(regs);
    750737                if (cont) {
     
    752739                       
    753740                        if (ns->client_connected) {
    754                                 bool buf_was_empty = buf_is_empty(&ns->input_buffer);
    755741                                if (!buf_push_back(&ns->input_buffer, val)) {
    756742                                        ddf_msg(LVL_WARN, "Buffer overflow on "
    757743                                            "%s.", ns->dev->name);
    758                                         break;
    759744                                } else {
    760745                                        ddf_msg(LVL_DEBUG2, "Character %c saved "
    761746                                            "to the buffer of %s.",
    762747                                            val, ns->dev->name);
    763                                         if (buf_was_empty)
    764                                                 fibril_condvar_broadcast(&ns->input_buffer_available);
    765748                                }
    766749                        }
    767750                }
    768         }
    769         fibril_mutex_unlock(&ns->mutex);
    770         fibril_yield();
     751               
     752                fibril_mutex_unlock(&ns->mutex);
     753                fibril_yield();
     754        }
    771755}
    772756
    773757/** The interrupt handler.
    774758 *
    775  * The serial port is initialized to interrupt when some data come or line
    776  * status register changes, so the interrupt is handled by reading the incoming
    777  * data and reading the line status register.
     759 * The serial port is initialized to interrupt when some data come, so the
     760 * interrupt is handled by reading the incomming data.
    778761 *
    779762 * @param dev           The serial port device.
     
    782765    ipc_call_t *icall)
    783766{
    784         ns8250_t *ns = NS8250_FROM_DEV(dev);
    785 
    786         uint8_t iir = pio_read_8(&ns->regs->iid);
    787         if ((iir & NS8250_IID_CAUSE_MASK) == NS8250_IID_CAUSE_RXSTATUS) {
    788                 uint8_t lsr = pio_read_8(&ns->regs->lsr);
    789                 if (lsr & NS8250_LSR_OE) {
    790                         ddf_msg(LVL_WARN, "Overrun error on %s", ns->dev->name);
    791                 }
    792         }
    793        
    794         ns8250_read_from_device(ns);
     767        ns8250_read_from_device(NS8250_FROM_DEV(dev));
    795768}
    796769
     
    838811       
    839812        fibril_mutex_initialize(&ns->mutex);
    840         fibril_condvar_initialize(&ns->input_buffer_available);
    841813        ns->dev = dev;
    842814       
     
    10811053static void ns8250_init(void)
    10821054{
    1083         ddf_log_init(NAME, LVL_WARN);
     1055        ddf_log_init(NAME, LVL_ERROR);
    10841056       
    10851057        ns8250_dev_ops.open = &ns8250_open;
  • uspace/lib/c/generic/bd_srv.c

    r16639bb rf7ea5400  
    6767        }
    6868
    69         if (srv->srvs->ops->read_blocks == NULL) {
     69        if (srv->ops->read_blocks == NULL) {
    7070                async_answer_0(rcallid, ENOTSUP);
    7171                async_answer_0(callid, ENOTSUP);
     
    7373        }
    7474
    75         rc = srv->srvs->ops->read_blocks(srv, ba, cnt, buf, size);
     75        rc = srv->ops->read_blocks(srv, ba, cnt, buf, size);
    7676        if (rc != EOK) {
    7777                async_answer_0(rcallid, ENOMEM);
     
    109109        }
    110110
    111         if (srv->srvs->ops->read_toc == NULL) {
     111        if (srv->ops->read_toc == NULL) {
    112112                async_answer_0(rcallid, ENOTSUP);
    113113                async_answer_0(callid, ENOTSUP);
     
    115115        }
    116116
    117         rc = srv->srvs->ops->read_toc(srv, session, buf, size);
     117        rc = srv->ops->read_toc(srv, session, buf, size);
    118118        if (rc != EOK) {
    119119                async_answer_0(rcallid, ENOMEM);
     
    146146        }
    147147
    148         if (srv->srvs->ops->write_blocks == NULL) {
    149                 async_answer_0(callid, ENOTSUP);
    150                 return;
    151         }
    152 
    153         rc = srv->srvs->ops->write_blocks(srv, ba, cnt, data, size);
     148        if (srv->ops->write_blocks == NULL) {
     149                async_answer_0(callid, ENOTSUP);
     150                return;
     151        }
     152
     153        rc = srv->ops->write_blocks(srv, ba, cnt, data, size);
    154154        free(data);
    155155        async_answer_0(callid, rc);
     
    162162        size_t block_size;
    163163
    164         if (srv->srvs->ops->get_block_size == NULL) {
    165                 async_answer_0(callid, ENOTSUP);
    166                 return;
    167         }
    168 
    169         rc = srv->srvs->ops->get_block_size(srv, &block_size);
     164        if (srv->ops->get_block_size == NULL) {
     165                async_answer_0(callid, ENOTSUP);
     166                return;
     167        }
     168
     169        rc = srv->ops->get_block_size(srv, &block_size);
    170170        async_answer_1(callid, rc, block_size);
    171171}
     
    177177        aoff64_t num_blocks;
    178178
    179         if (srv->srvs->ops->get_num_blocks == NULL) {
    180                 async_answer_0(callid, ENOTSUP);
    181                 return;
    182         }
    183 
    184         rc = srv->srvs->ops->get_num_blocks(srv, &num_blocks);
     179        if (srv->ops->get_num_blocks == NULL) {
     180                async_answer_0(callid, ENOTSUP);
     181                return;
     182        }
     183
     184        rc = srv->ops->get_num_blocks(srv, &num_blocks);
    185185        async_answer_2(callid, rc, LOWER32(num_blocks), UPPER32(num_blocks));
    186186}
    187187
    188 static bd_srv_t *bd_srv_create(bd_srvs_t *srvs)
    189 {
    190         bd_srv_t *srv;
    191 
    192         srv = calloc(1, sizeof(srv));
    193         if (srv == NULL)
    194                 return NULL;
    195 
    196         srv->srvs = srvs;
    197         return srv;
    198 }
    199 
    200 void bd_srvs_init(bd_srvs_t *srvs)
    201 {
    202         srvs->ops = NULL;
    203         srvs->sarg = NULL;
    204 }
    205 
    206 int bd_conn(ipc_callid_t iid, ipc_call_t *icall, bd_srvs_t *srvs)
    207 {
    208         bd_srv_t *srv;
    209         int rc;
     188void bd_srv_init(bd_srv_t *srv)
     189{
     190        fibril_mutex_initialize(&srv->lock);
     191        srv->connected = false;
     192        srv->ops = NULL;
     193        srv->arg = NULL;
     194        srv->client_sess = NULL;
     195}
     196
     197int bd_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
     198{
     199        bd_srv_t *srv = (bd_srv_t *)arg;
     200        int rc;
     201
     202        fibril_mutex_lock(&srv->lock);
     203        if (srv->connected) {
     204                fibril_mutex_unlock(&srv->lock);
     205                async_answer_0(iid, EBUSY);
     206                return EBUSY;
     207        }
     208
     209        srv->connected = true;
     210        fibril_mutex_unlock(&srv->lock);
    210211
    211212        /* Accept the connection */
    212213        async_answer_0(iid, EOK);
    213 
    214         srv = bd_srv_create(srvs);
    215         if (srv == NULL)
    216                 return ENOMEM;
    217214
    218215        async_sess_t *sess = async_callback_receive(EXCHANGE_SERIALIZE);
     
    222219        srv->client_sess = sess;
    223220
    224         rc = srvs->ops->open(srvs, srv);
     221        rc = srv->ops->open(srv);
    225222        if (rc != EOK)
    226223                return rc;
     
    233230                if (!method) {
    234231                        /* The other side has hung up */
     232                        fibril_mutex_lock(&srv->lock);
     233                        srv->connected = false;
     234                        fibril_mutex_unlock(&srv->lock);
    235235                        async_answer_0(callid, EOK);
    236236                        break;
     
    258258        }
    259259
    260         rc = srvs->ops->close(srv);
    261         free(srv);
    262 
    263         return rc;
     260        return srv->ops->close(srv);
    264261}
    265262
  • uspace/lib/c/include/bd_srv.h

    r16639bb rf7ea5400  
    3636#define LIBC_BD_SRV_H_
    3737
    38 #include <adt/list.h>
    3938#include <async.h>
    4039#include <fibril_synch.h>
     
    4443typedef struct bd_ops bd_ops_t;
    4544
    46 /** Service setup (per sevice) */
    4745typedef struct {
     46        fibril_mutex_t lock;
     47        bool connected;
    4848        bd_ops_t *ops;
    49         void *sarg;
    50 } bd_srvs_t;
    51 
    52 /** Server structure (per client session) */
    53 typedef struct {
    54         bd_srvs_t *srvs;
     49        void *arg;
    5550        async_sess_t *client_sess;
    56         void *carg;
    5751} bd_srv_t;
    5852
    5953typedef struct bd_ops {
    60         int (*open)(bd_srvs_t *, bd_srv_t *);
     54        int (*open)(bd_srv_t *);
    6155        int (*close)(bd_srv_t *);
    6256        int (*read_blocks)(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    6761} bd_ops_t;
    6862
    69 extern void bd_srvs_init(bd_srvs_t *);
     63extern void bd_srv_init(bd_srv_t *);
    7064
    71 extern int bd_conn(ipc_callid_t, ipc_call_t *, bd_srvs_t *);
     65extern int bd_conn(ipc_callid_t, ipc_call_t *, void *);
    7266
    7367#endif
  • uspace/lib/c/include/ipc/input.h

    r16639bb rf7ea5400  
    4646        INPUT_EVENT_KEY = IPC_FIRST_USER_METHOD,
    4747        INPUT_EVENT_MOVE,
    48         INPUT_EVENT_ABS_MOVE,
    4948        INPUT_EVENT_BUTTON
    5049} input_notif_t;
  • uspace/lib/c/include/ipc/mouseev.h

    r16639bb rf7ea5400  
    4747typedef enum {
    4848        MOUSEEV_MOVE_EVENT = IPC_FIRST_USER_METHOD,
    49         MOUSEEV_ABS_MOVE_EVENT,
    5049        MOUSEEV_BUTTON_EVENT
    5150} mouseev_notif_t;
  • uspace/srv/bd/ata_bd/ata_bd.c

    r16639bb rf7ea5400  
    104104static void ata_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *);
    105105
    106 static int ata_bd_open(bd_srvs_t *, bd_srv_t *);
     106static int ata_bd_open(bd_srv_t *);
    107107static int ata_bd_close(bd_srv_t *);
    108108static int ata_bd_read_blocks(bd_srv_t *, uint64_t ba, size_t cnt, void *buf,
     
    146146static disk_t *bd_srv_disk(bd_srv_t *bd)
    147147{
    148         return (disk_t *)bd->srvs->sarg;
     148        return (disk_t *)bd->arg;
    149149}
    150150
     
    312312        }
    313313
    314         bd_conn(iid, icall, &ata_disk[disk_id].bds);
     314        bd_conn(iid, icall, &ata_disk[disk_id].bd);
    315315}
    316316
     
    336336        fibril_mutex_initialize(&d->lock);
    337337
    338         bd_srvs_init(&d->bds);
    339         d->bds.ops = &ata_bd_ops;
    340         d->bds.sarg = d;
     338        bd_srv_init(&d->bd);
     339        d->bd.ops = &ata_bd_ops;
     340        d->bd.arg = d;
    341341
    342342        /* Try identify command. */
     
    467467}
    468468
    469 static int ata_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     469static int ata_bd_open(bd_srv_t *bd)
    470470{
    471471        return EOK;
  • uspace/srv/bd/ata_bd/ata_bd.h

    r16639bb rf7ea5400  
    119119        service_id_t service_id;
    120120        int disk_id;
    121         bd_srvs_t bds;
     121        bd_srv_t bd;
    122122} disk_t;
    123123
  • uspace/srv/bd/file_bd/file_bd.c

    r16639bb rf7ea5400  
    6262
    6363static service_id_t service_id;
    64 static bd_srvs_t bd_srvs;
     64static bd_srv_t bd_srv;
    6565static fibril_mutex_t dev_lock;
    6666
     
    6969static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *);
    7070
    71 static int file_bd_open(bd_srvs_t *, bd_srv_t *);
     71static int file_bd_open(bd_srv_t *);
    7272static int file_bd_close(bd_srv_t *);
    7373static int file_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    154154static int file_bd_init(const char *fname)
    155155{
    156         bd_srvs_init(&bd_srvs);
    157         bd_srvs.ops = &file_bd_ops;
     156        bd_srv_init(&bd_srv);
     157        bd_srv.ops = &file_bd_ops;
    158158       
    159159        async_set_client_connection(file_bd_connection);
     
    188188static void file_bd_connection(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    189189{
    190         bd_conn(iid, icall, &bd_srvs);
     190        bd_conn(iid, icall, &bd_srv);
    191191}
    192192
    193193/** Open device. */
    194 static int file_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     194static int file_bd_open(bd_srv_t *bd)
    195195{
    196196        return EOK;
  • uspace/srv/bd/gxe_bd/gxe_bd.c

    r16639bb rf7ea5400  
    8888/** GXE block device soft state */
    8989typedef struct {
    90         /** Block device service structure */
    91         bd_srvs_t bds;
     90        /** Block device server structure */
     91        bd_srv_t bd;
    9292        int disk_id;
    9393} gxe_bd_t;
     
    109109static int gxe_bd_write_block(int disk_id, uint64_t ba, const void *buf);
    110110
    111 static int gxe_bd_open(bd_srvs_t *, bd_srv_t *);
     111static int gxe_bd_open(bd_srv_t *);
    112112static int gxe_bd_close(bd_srv_t *);
    113113static int gxe_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    127127static gxe_bd_t *bd_srv_gxe(bd_srv_t *bd)
    128128{
    129         return (gxe_bd_t *)bd->srvs->sarg;
     129        return (gxe_bd_t *)bd->arg;
    130130}
    131131
     
    166166                char name[16];
    167167               
    168                 bd_srvs_init(&gxe_bd[i].bds);
    169                 gxe_bd[i].bds.ops = &gxe_bd_ops;
    170                 gxe_bd[i].bds.sarg = (void *)&gxe_bd[i];
     168                bd_srv_init(&gxe_bd[i].bd);
     169                gxe_bd[i].bd.ops = &gxe_bd_ops;
     170                gxe_bd[i].bd.arg = (void *)&gxe_bd[i];
    171171               
    172172                snprintf(name, 16, "%s/disk%u", NAMESPACE, i);
     
    203203        }
    204204
    205         bd_conn(iid, icall, &gxe_bd[disk_id].bds);
     205        bd_conn(iid, icall, &gxe_bd[disk_id].bd);
    206206}
    207207
    208208/** Open device. */
    209 static int gxe_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     209static int gxe_bd_open(bd_srv_t *bd)
    210210{
    211211        return EOK;
  • uspace/srv/bd/part/guid_part/guid_part.c

    r16639bb rf7ea5400  
    8383        /** Service representing the partition (outbound device) */
    8484        service_id_t dsid;
    85         /** Block device service structure */
    86         bd_srvs_t bds;
     85        /** Block device server structure */
     86        bd_srv_t bd;
    8787        /** Points to next partition structure. */
    8888        struct part *next;
     
    104104static int gpt_bsa_translate(part_t *p, aoff64_t ba, size_t cnt, aoff64_t *gba);
    105105
    106 static int gpt_bd_open(bd_srvs_t *, bd_srv_t *);
     106static int gpt_bd_open(bd_srv_t *);
    107107static int gpt_bd_close(bd_srv_t *);
    108108static int gpt_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    122122static part_t *bd_srv_part(bd_srv_t *bd)
    123123{
    124         return (part_t *)bd->srvs->sarg;
     124        return (part_t *)bd->arg;
    125125}
    126126
     
    325325        }
    326326
    327         bd_srvs_init(&part->bds);
    328         part->bds.ops = &gpt_bd_ops;
    329         part->bds.sarg = part;
     327        bd_srv_init(&part->bd);
     328        part->bd.ops = &gpt_bd_ops;
     329        part->bd.arg = part;
    330330
    331331        part->dsid = 0;
     
    357357        assert(part->present == true);
    358358
    359         bd_conn(iid, icall, &part->bds);
     359        bd_conn(iid, icall, &part->bd);
    360360}
    361361
    362362/** Open device. */
    363 static int gpt_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     363static int gpt_bd_open(bd_srv_t *bd)
    364364{
    365365        return EOK;
  • uspace/srv/bd/part/mbr_part/mbr_part.c

    r16639bb rf7ea5400  
    100100        /** Device representing the partition (outbound device) */
    101101        service_id_t dsid;
    102         /** Block device service sturcture */
    103         bd_srvs_t bds;
     102        /** Block device server structure */
     103        bd_srv_t bd;
    104104        /** Points to next partition structure. */
    105105        struct part *next;
     
    154154static int mbr_bsa_translate(part_t *p, uint64_t ba, size_t cnt, uint64_t *gba);
    155155
    156 static int mbr_bd_open(bd_srvs_t *, bd_srv_t *);
     156static int mbr_bd_open(bd_srv_t *);
    157157static int mbr_bd_close(bd_srv_t *);
    158158static int mbr_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    172172static part_t *bd_srv_part(bd_srv_t *bd)
    173173{
    174         return (part_t *)bd->srvs->sarg;
     174        return (part_t *)bd->arg;
    175175}
    176176
     
    402402        part->present = (pte->ptype != PT_UNUSED) ? true : false;
    403403
    404         bd_srvs_init(&part->bds);
    405         part->bds.ops = &mbr_bd_ops;
    406         part->bds.sarg = part;
     404        bd_srv_init(&part->bd);
     405        part->bd.ops = &mbr_bd_ops;
     406        part->bd.arg = part;
    407407
    408408        part->dsid = 0;
     
    433433
    434434        assert(part->present == true);
    435         bd_conn(iid, icall, &part->bds);
     435        bd_conn(iid, icall, &part->bd);
    436436}
    437437
    438438/** Open device. */
    439 static int mbr_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     439static int mbr_bd_open(bd_srv_t *bd)
    440440{
    441441        return EOK;
  • uspace/srv/bd/rd/rd.c

    r16639bb rf7ea5400  
    6868static const size_t block_size = 512;
    6969
    70 static int rd_open(bd_srvs_t *, bd_srv_t *);
     70static int rd_open(bd_srv_t *);
    7171static int rd_close(bd_srv_t *);
    7272static int rd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    9393};
    9494
    95 static bd_srvs_t bd_srvs;
     95static bd_srv_t bd_srv;
    9696
    9797static void rd_client_conn(ipc_callid_t iid, ipc_call_t *icall, void *arg)
    9898{
    99         bd_conn(iid, icall, &bd_srvs);
     99        bd_conn(iid, icall, &bd_srv);
    100100}
    101101
    102102/** Open device. */
    103 static int rd_open(bd_srvs_t *bds, bd_srv_t *bd)
     103static int rd_open(bd_srv_t *bd)
    104104{
    105105        return EOK;
     
    175175            (void *) addr_phys, size);
    176176       
    177         bd_srvs_init(&bd_srvs);
    178         bd_srvs.ops = &rd_bd_ops;
     177        bd_srv_init(&bd_srv);
     178        bd_srv.ops = &rd_bd_ops;
    179179       
    180180        async_set_client_connection(rd_client_conn);
  • uspace/srv/bd/sata_bd/sata_bd.c

    r16639bb rf7ea5400  
    5757static int disk_count;
    5858
    59 static int sata_bd_open(bd_srvs_t *, bd_srv_t *);
     59static int sata_bd_open(bd_srv_t *);
    6060static int sata_bd_close(bd_srv_t *);
    6161static int sata_bd_read_blocks(bd_srv_t *, aoff64_t, size_t, void *, size_t);
     
    7575static sata_bd_dev_t *bd_srv_sata(bd_srv_t *bd)
    7676{
    77         return (sata_bd_dev_t *)bd->srvs->sarg;
     77        return (sata_bd_dev_t *)bd->arg;
    7878}
    7979
     
    104104                ahci_get_num_blocks(disk[disk_count].sess, &disk[disk_count].blocks);
    105105               
    106                 bd_srvs_init(&disk[disk_count].bds);
    107                 disk[disk_count].bds.ops = &sata_bd_ops;
    108                 disk[disk_count].bds.sarg = &disk[disk_count];
     106                bd_srv_init(&disk[disk_count].bd);
     107                disk[disk_count].bd.ops = &sata_bd_ops;
     108                disk[disk_count].bd.arg = &disk[disk_count];
    109109               
    110110                printf("Device %s - %s , blocks: %lu, block_size: %lu\n",
     
    183183        }
    184184
    185         bd_conn(iid, icall, &disk[disk_id].bds);
     185        bd_conn(iid, icall, &disk[disk_id].bd);
    186186}
    187187
    188188/** Open device. */
    189 static int sata_bd_open(bd_srvs_t *bds, bd_srv_t *bd)
     189static int sata_bd_open(bd_srv_t *bd)
    190190{
    191191        return EOK;
  • uspace/srv/bd/sata_bd/sata_bd.h

    r16639bb rf7ea5400  
    5858        size_t block_size;
    5959        /** Block device server structure */
    60         bd_srvs_t bds;
     60        bd_srv_t bd;
    6161} sata_bd_dev_t;
    6262
  • uspace/srv/hid/console/console.c

    r16639bb rf7ea5400  
    383383       
    384384        fb_pointer_update(fb_sess, mouse.x, mouse.y, true);
    385 }
    386 
    387 static void cons_mouse_abs_move(sysarg_t x, sysarg_t y,
    388     sysarg_t max_x, sysarg_t max_y)
    389 {
    390         if (max_x && max_y) {
    391                 mouse.x = limit(x * xres / max_x, 0, xres);
    392                 mouse.y = limit(y * yres / max_y, 0, yres);
    393                
    394                 fb_pointer_update(fb_sess, mouse.x, mouse.y, true);
    395         }
    396385}
    397386
     
    514503                        async_answer_0(callid, EOK);
    515504                        break;
    516                 case INPUT_EVENT_ABS_MOVE:
    517                         cons_mouse_abs_move(IPC_GET_ARG1(call), IPC_GET_ARG2(call),
    518                             IPC_GET_ARG3(call), IPC_GET_ARG4(call));
    519                         async_answer_0(callid, EOK);
    520                         break;
    521505                case INPUT_EVENT_BUTTON:
    522506                        /* Got pointer button press/release event */
  • uspace/srv/hid/input/generic/input.c

    r16639bb rf7ea5400  
    191191}
    192192
    193 /** Mouse pointer has moved in absolute mode. */
    194 void mouse_push_event_abs_move(mouse_dev_t *mdev, unsigned int x, unsigned int y,
    195     unsigned int max_x, unsigned int max_y)
    196 {
    197         if (max_x && max_y) {
    198                 async_exch_t *exch = async_exchange_begin(client_sess);
    199                 async_msg_4(exch, INPUT_EVENT_ABS_MOVE, x, y, max_x, max_y);
    200                 async_exchange_end(exch);
    201         }
    202 }
    203 
    204193/** Mouse button has been pressed. */
    205194void mouse_push_event_button(mouse_dev_t *mdev, int bnum, int press)
  • uspace/srv/hid/input/include/mouse.h

    r16639bb rf7ea5400  
    6363extern void mouse_push_data(mouse_dev_t *, sysarg_t);
    6464extern void mouse_push_event_move(mouse_dev_t *, int, int, int);
    65 extern void mouse_push_event_abs_move(mouse_dev_t *, unsigned int, unsigned int,
    66     unsigned int, unsigned int);
    6765extern void mouse_push_event_button(mouse_dev_t *, int, int);
    6866
  • uspace/srv/hid/input/proto/mousedev.c

    r16639bb rf7ea5400  
    9696                        retval = EOK;
    9797                        break;
    98                 case MOUSEEV_ABS_MOVE_EVENT:
    99                         mouse_push_event_abs_move(mousedev->mouse_dev,
    100                                 IPC_GET_ARG1(call), IPC_GET_ARG2(call),
    101                                 IPC_GET_ARG3(call), IPC_GET_ARG4(call));
    102                         retval = EOK;
    103                         break;
    10498                case MOUSEEV_BUTTON_EVENT:
    10599                        mouse_push_event_button(mousedev->mouse_dev,
Note: See TracChangeset for help on using the changeset viewer.