Changeset ac307b2 in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2017-11-25T11:12:23Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
98cb5e0d
Parents:
f571ca49 (diff), 0851a3d (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 branch 'master' into callcaps

Location:
uspace/lib/c/include
Files:
3 edited
1 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/adt/circ_buf.h

    rf571ca49 rac307b2  
    11/*
    2  * Copyright (c) 2009 Jiri Svoboda
     2 * Copyright (c) 2017 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libcipc
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /** @file
    33  * @brief Character device interface.
     32/** @file Circular buffer
    3433 */
    3534
    36 #ifndef LIBC_IPC_CHAR_H_
    37 #define LIBC_IPC_CHAR_H_
     35#ifndef LIBC_CIRC_BUF_H_
     36#define LIBC_CIRC_BUF_H_
    3837
    39 #include <ipc/common.h>
     38#include <stddef.h>
    4039
    41 typedef enum {
    42         CHAR_WRITE_BYTE = IPC_FIRST_USER_METHOD
    43 } char_request_t;
     40/** Circular buffer */
     41typedef struct {
     42        /** Buffer */
     43        void *buf;
     44        /** Number of buffer members */
     45        size_t nmemb;
     46        /** Member size */
     47        size_t size;
     48        /** Read position */
     49        size_t rp;
     50        /** Write position */
     51        size_t wp;
     52        /** Number of used entries */
     53        size_t nused;
     54} circ_buf_t;
    4455
    45 typedef enum {
    46         CHAR_NOTIF_BYTE = IPC_FIRST_USER_METHOD
    47 } char_notif_t;
     56extern void circ_buf_init(circ_buf_t *, void *, size_t, size_t);
     57extern size_t circ_buf_nfree(circ_buf_t *);
     58extern size_t circ_buf_nused(circ_buf_t *);
     59extern int circ_buf_push(circ_buf_t *, const void *);
     60extern int circ_buf_pop(circ_buf_t *, void *);
    4861
    4962#endif
  • uspace/lib/c/include/io/chardev_srv.h

    rf571ca49 rac307b2  
    6161        int (*read)(chardev_srv_t *, void *, size_t, size_t *);
    6262        int (*write)(chardev_srv_t *, const void *, size_t, size_t *);
     63        void (*def_handler)(chardev_srv_t *, ipc_callid_t, ipc_call_t *);
    6364};
    6465
  • uspace/lib/c/include/ipc/chardev.h

    rf571ca49 rac307b2  
    4141typedef enum {
    4242        CHARDEV_READ = IPC_FIRST_USER_METHOD,
    43         CHARDEV_WRITE
     43        CHARDEV_WRITE,
    4444} chardev_request_t;
     45
     46enum {
     47        CHARDEV_LIMIT = CHARDEV_WRITE + 1
     48};
    4549
    4650#endif
  • uspace/lib/c/include/ipc/serial_ctl.h

    rf571ca49 rac307b2  
    3030#define LIBC_IPC_SERIAL_CTL_H_
    3131
    32 #include <ipc/dev_iface.h>
     32#include <ipc/chardev.h>
    3333
    3434/** IPC methods for getting/setting serial communication properties
     
    4141 */
    4242typedef enum {
    43         SERIAL_GET_COM_PROPS = DEV_FIRST_CUSTOM_METHOD,
     43        SERIAL_GET_COM_PROPS = CHARDEV_LIMIT,
    4444        SERIAL_SET_COM_PROPS
    4545} serial_ctl_t;
Note: See TracChangeset for help on using the changeset viewer.