Changeset 6843a9c in mainline for uspace/lib/c/include


Ignore:
Timestamp:
2012-06-29T13:02:14Z (14 years ago)
Author:
Jan Vesely <jano.vesely@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
722912e
Parents:
ba72f2b (diff), 0bbd13e (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

Trivial conflicts.

Location:
uspace/lib/c/include
Files:
5 added
10 deleted
28 edited
6 moved

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/include/as.h

    rba72f2b r6843a9c  
    4141#include <libarch/config.h>
    4242
     43#define AS_AREA_ANY    ((void *) -1)
     44#define AS_MAP_FAILED  ((void *) -1)
     45
    4346static inline size_t SIZE2PAGES(size_t size)
    4447{
     
    5962extern int as_area_destroy(void *);
    6063extern void *set_maxheapsize(size_t);
    61 extern void *as_get_mappable_page(size_t);
    6264extern int as_get_physical_mapping(const void *, uintptr_t *);
    6365
  • uspace/lib/c/include/async.h

    rba72f2b r6843a9c  
    139139extern void async_wait_for(aid_t, sysarg_t *);
    140140extern int async_wait_timeout(aid_t, sysarg_t *, suseconds_t);
     141extern void async_forget(aid_t);
    141142
    142143extern fid_t async_new_connection(task_id_t, sysarg_t, ipc_callid_t,
     
    320321    sysarg_t *, sysarg_t *);
    321322
    322 extern async_sess_t *async_connect_me(exch_mgmt_t, async_exch_t *);
     323extern async_sess_t *async_clone_establish(exch_mgmt_t, async_exch_t *);
    323324extern async_sess_t *async_connect_me_to(exch_mgmt_t, async_exch_t *, sysarg_t,
    324325    sysarg_t, sysarg_t);
     
    346347 */
    347348
    348 #define async_share_in_start_0_0(exch, dst, size) \
    349         async_share_in_start(exch, dst, size, 0, NULL)
    350 #define async_share_in_start_0_1(exch, dst, size, flags) \
    351         async_share_in_start(exch, dst, size, 0, flags)
    352 #define async_share_in_start_1_0(exch, dst, size, arg) \
    353         async_share_in_start(exch, dst, size, arg, NULL)
    354 #define async_share_in_start_1_1(exch, dst, size, arg, flags) \
    355         async_share_in_start(exch, dst, size, arg, flags)
    356 
    357 extern int async_share_in_start(async_exch_t *, void *, size_t, sysarg_t,
    358     unsigned int *);
     349#define async_share_in_start_0_0(exch, size, dst) \
     350        async_share_in_start(exch, size, 0, NULL, dst)
     351#define async_share_in_start_0_1(exch, size, flags, dst) \
     352        async_share_in_start(exch, size, 0, flags, dst)
     353#define async_share_in_start_1_0(exch, size, arg, dst) \
     354        async_share_in_start(exch, size, arg, NULL, dst)
     355#define async_share_in_start_1_1(exch, size, arg, flags, dst) \
     356        async_share_in_start(exch, size, arg, flags, dst)
     357
     358extern int async_share_in_start(async_exch_t *, size_t, sysarg_t,
     359    unsigned int *, void **);
    359360extern bool async_share_in_receive(ipc_callid_t *, size_t *);
    360361extern int async_share_in_finalize(ipc_callid_t, void *, unsigned int);
     
    362363extern int async_share_out_start(async_exch_t *, void *, unsigned int);
    363364extern bool async_share_out_receive(ipc_callid_t *, size_t *, unsigned int *);
    364 extern int async_share_out_finalize(ipc_callid_t, void *);
     365extern int async_share_out_finalize(ipc_callid_t, void **);
    365366
    366367/*
  • uspace/lib/c/include/bitops.h

    rba72f2b r6843a9c  
    4040/** Mask with bit @a n set. */
    4141#define BIT_V(type, n) \
    42     ((type)1 << ((n) - 1))
     42    ((type) 1 << (n))
    4343
    4444/** Mask with rightmost @a n bits set. */
    4545#define BIT_RRANGE(type, n) \
    46     (BIT_V(type, (n) + 1) - 1)
     46    (BIT_V(type, (n)) - 1)
    4747
    4848/** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */
  • uspace/lib/c/include/ddi.h

    rba72f2b r6843a9c  
    4141
    4242extern int device_assign_devno(void);
    43 extern int physmem_map(void *, void *, unsigned long, int);
     43
     44extern int physmem_map(void *, size_t, unsigned int, void **);
     45
     46extern int dmamem_map(void *, size_t, unsigned int, unsigned int, void **);
     47extern int dmamem_map_anonymous(size_t, unsigned int, unsigned int, void **,
     48    void **);
     49extern int dmamem_unmap(void *, size_t);
     50extern int dmamem_unmap_anonymous(void *);
     51
    4452extern int iospace_enable(task_id_t, void *, unsigned long);
    4553extern int pio_enable(void *, size_t, void **);
    46 extern int register_irq(int, int, int, irq_code_t *);
    47 extern int unregister_irq(int, int);
     54
     55extern int irq_register(int, int, int, irq_code_t *);
     56extern int irq_unregister(int, int);
    4857
    4958#endif
  • uspace/lib/c/include/device/hw_res.h

    rba72f2b r6843a9c  
    4040#include <bool.h>
    4141
     42#define DMA_MODE_ON_DEMAND  0
     43#define DMA_MODE_WRITE      (1 << 2)
     44#define DMA_MODE_READ       (1 << 3)
     45#define DMA_MODE_AUTO       (1 << 4)
     46#define DMA_MODE_DOWN       (1 << 5)
     47#define DMA_MODE_SINGLE     (1 << 6)
     48#define DMA_MODE_BLOCK      (1 << 7)
     49
    4250/** HW resource provider interface */
    4351typedef enum {
     
    8088                        int irq;
    8189                } interrupt;
    82 
     90               
    8391                union {
    84                         int dma8;
    85                         int dma16;
     92                        unsigned int dma8;
     93                        unsigned int dma16;
    8694                } dma_channel;
    8795        } res;
     
    106114extern bool hw_res_enable_interrupt(async_sess_t *);
    107115
    108 #define DMA_MODE_WRITE (1 << 2)
    109 #define DMA_MODE_READ (1 << 3)
    110 #define DMA_MODE_AUTO (1 << 4)
    111 #define DMA_MODE_DOWN (1 << 5)
    112 #define DMA_MODE_SINGLE (1 << 6)
    113 #define DMA_MODE_BLOCK (1 << 7)
    114 #define DMA_MODE_ON_DEMAND (0)
    115 
    116 extern int hw_res_dma_channel_setup(async_sess_t *,
    117     unsigned, uint32_t, uint16_t, uint8_t);
     116extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t,
     117    uint16_t, uint8_t);
    118118
    119119#endif
  • uspace/lib/c/include/device/hw_res_parsed.h

    rba72f2b r6843a9c  
    7878
    7979        /** Array of channels */
    80         int *channels;
     80        unsigned int *channels;
    8181} dma_list_t;
    8282
     
    101101        irq_list_t irqs;
    102102
     103        /** List of DMA channels */
     104        dma_list_t dma_channels;
     105       
    103106        /** List of DMA channels */
    104107        dma_list_t dma_channels;
  • uspace/lib/c/include/device/nic.h

    rba72f2b r6843a9c  
    3737
    3838#include <async.h>
    39 #include <net/device.h>
    40 #include <net/packet.h>
    41 #include <ipc/services.h>
     39#include <nic/nic.h>
     40#include <ipc/common.h>
    4241
    4342typedef enum {
    4443        NIC_SEND_MESSAGE = 0,
    45         NIC_CONNECT_TO_NIL,
     44        NIC_CALLBACK_CREATE,
    4645        NIC_GET_STATE,
    4746        NIC_SET_STATE,
     
    8584} nic_funcs_t;
    8685
    87 extern int nic_send_message(async_sess_t *, packet_id_t);
    88 extern int nic_connect_to_nil(async_sess_t *, services_t, nic_device_id_t);
     86typedef enum {
     87        NIC_EV_ADDR_CHANGED = IPC_FIRST_USER_METHOD,
     88        NIC_EV_RECEIVED,
     89        NIC_EV_DEVICE_STATE
     90} nic_event_t;
     91
     92extern int nic_send_frame(async_sess_t *, void *, size_t);
     93extern int nic_callback_create(async_sess_t *, async_client_conn_t, void *);
    8994extern int nic_get_state(async_sess_t *, nic_device_state_t *);
    9095extern int nic_set_state(async_sess_t *, nic_device_state_t);
     
    127132extern int nic_vlan_get_mask(async_sess_t *, nic_vlan_mask_t *);
    128133extern int nic_vlan_set_mask(async_sess_t *, const nic_vlan_mask_t *);
    129 extern int nic_vlan_set_tag(async_sess_t *, uint16_t, int, int);
     134extern int nic_vlan_set_tag(async_sess_t *, uint16_t, bool, bool);
    130135
    131136extern int nic_wol_virtue_add(async_sess_t *, nic_wv_type_t, const void *,
  • uspace/lib/c/include/device/pci.h

    rba72f2b r6843a9c  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2011 Jiri Michalec
    33 * All rights reserved.
    44 *
     
    3030 * @{
    3131 */
    32 
    3332/** @file
    34  * Networking subsystem central module messages.
    35  * @see net_interface.h
    3633 */
    3734
    38 #ifndef LIBC_NET_NET_MESSAGES_H_
    39 #define LIBC_NET_NET_MESSAGES_H_
     35#ifndef LIBC_DEVICE_PCI_H_
     36#define LIBC_DEVICE_PCI_H_
    4037
    41 #include <ipc/net.h>
     38#include <async.h>
    4239
    43 /** Networking subsystem central module messages. */
     40#define PCI_DEVICE_ID  0x02
     41
    4442typedef enum {
    45         /** Return general configuration
    46          * @see net_get_conf_req()
    47          */
    48         NET_NET_GET_CONF = NET_FIRST,
    49         /** Return device specific configuration
    50          * @see net_get_device_conf_req()
    51          */
    52         NET_NET_GET_DEVICE_CONF,
    53         /** Return number of mastered devices */
    54         NET_NET_GET_DEVICES_COUNT,
    55         /** Return names and device IDs of all devices */
    56         NET_NET_GET_DEVICES,
    57         /** Notify the networking service about a ready device */
    58         NET_NET_DRIVER_READY
    59 } net_messages;
     43        IPC_M_CONFIG_SPACE_READ_8,
     44        IPC_M_CONFIG_SPACE_READ_16,
     45        IPC_M_CONFIG_SPACE_READ_32,
     46       
     47        IPC_M_CONFIG_SPACE_WRITE_8,
     48        IPC_M_CONFIG_SPACE_WRITE_16,
     49        IPC_M_CONFIG_SPACE_WRITE_32
     50} pci_dev_iface_funcs_t;
     51
     52extern int pci_config_space_read_8(async_sess_t *, uint32_t, uint8_t *);
     53extern int pci_config_space_read_16(async_sess_t *, uint32_t, uint16_t *);
     54extern int pci_config_space_read_32(async_sess_t *, uint32_t, uint32_t *);
     55
     56extern int pci_config_space_write_8(async_sess_t *, uint32_t, uint8_t);
     57extern int pci_config_space_write_16(async_sess_t *, uint32_t, uint16_t);
     58extern int pci_config_space_write_32(async_sess_t *, uint32_t, uint32_t);
    6059
    6160#endif
  • uspace/lib/c/include/devman.h

    rba72f2b r6843a9c  
    4646extern void devman_exchange_end(async_exch_t *);
    4747
    48 extern int devman_driver_register(const char *, async_client_conn_t);
     48extern int devman_driver_register(const char *);
    4949extern int devman_add_function(const char *, fun_type_t, match_id_list_t *,
    5050    devman_handle_t, devman_handle_t *);
     
    6464    size_t *);
    6565extern int devman_fun_get_name(devman_handle_t, char *, size_t);
     66extern int devman_fun_get_driver_name(devman_handle_t, char *, size_t);
    6667extern int devman_fun_get_path(devman_handle_t, char *, size_t);
    6768extern int devman_fun_online(devman_handle_t);
  • uspace/lib/c/include/errno.h

    rba72f2b r6843a9c  
    3737
    3838#include <abi/errno.h>
    39 #include <fibril.h>
    4039
    4140#define errno  (*(__errno()))
     
    9695#define ENOTCONN  (-10057)
    9796
     97#define ECONNREFUSED  (-10058)
     98
     99#define ECONNABORTED  (-10059)
     100
    98101/** The requested operation was not performed. Try again later. */
    99102#define EAGAIN  (-11002)
  • uspace/lib/c/include/fibril.h

    rba72f2b r6843a9c  
    4141
    4242#define context_set_generic(c, _pc, stack, size, ptls) \
    43         (c)->pc = (sysarg_t) (_pc); \
    44         (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
    45         (c)->tls = (sysarg_t) (ptls);
     43        do { \
     44                (c)->pc = (sysarg_t) (_pc); \
     45                (c)->sp = ((sysarg_t) (stack)) + (size) - SP_DELTA; \
     46                (c)->tls = (sysarg_t) (ptls); \
     47        } while (0)
    4648
    4749#define FIBRIL_SERIALIZED  1
     
    8587
    8688extern fid_t fibril_create(int (*func)(void *), void *arg);
     89extern void fibril_destroy(fid_t fid);
    8790extern fibril_t *fibril_setup(void);
    8891extern void fibril_teardown(fibril_t *f);
  • uspace/lib/c/include/fibril_synch.h

    rba72f2b r6843a9c  
    107107        fibril_condvar_t name = FIBRIL_CONDVAR_INITIALIZER(name)
    108108
     109typedef void (*fibril_timer_fun_t)(void *);
     110
     111typedef enum {
     112        /** Timer has not been set or has been cleared */
     113        fts_not_set,
     114        /** Timer was set but did not fire yet */
     115        fts_active,
     116        /** Timer has fired and has not been cleared since */
     117        fts_fired,
     118        /** Timer is being destroyed */
     119        fts_cleanup
     120} fibril_timer_state_t;
     121
     122/** Fibril timer.
     123 *
     124 * When a timer is set it executes a callback function (in a separate
     125 * fibril) after a specified time interval. The timer can be cleared
     126 * (canceled) before that. From the return value of fibril_timer_clear()
     127 * one can tell whether the timer fired or not.
     128 */
     129typedef struct {
     130        fibril_mutex_t lock;
     131        fibril_condvar_t cv;
     132        fid_t fibril;
     133        fibril_timer_state_t state;
     134
     135        suseconds_t delay;
     136        fibril_timer_fun_t fun;
     137        void *arg;
     138} fibril_timer_t;
     139
    109140extern void fibril_mutex_initialize(fibril_mutex_t *);
    110141extern void fibril_mutex_lock(fibril_mutex_t *);
     
    129160extern void fibril_condvar_broadcast(fibril_condvar_t *);
    130161
     162extern fibril_timer_t *fibril_timer_create(void);
     163extern void fibril_timer_destroy(fibril_timer_t *);
     164extern void fibril_timer_set(fibril_timer_t *, suseconds_t, fibril_timer_fun_t,
     165    void *);
     166extern fibril_timer_state_t fibril_timer_clear(fibril_timer_t *);
     167
    131168#endif
    132169
  • uspace/lib/c/include/inet/inet.h

    rba72f2b r6843a9c  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libnet
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 
    3332/** @file
    34  * Hardware types according to the on-line IANA - Address Resolution Protocol
    35  * (ARP) Parameters
    36  * http://www.iana.org/assignments/arp-parameters/arp-parameters.xml,
    37  * cited January 14 2009.
    3833 */
    3934
    40 #ifndef LIBNET_NET_HARDWARE_H_
    41 #define LIBNET_NET_HARDWARE_H_
     35#ifndef LIBC_INET_INET_H_
     36#define LIBC_INET_INET_H_
    4237
    4338#include <sys/types.h>
    4439
    45 /** Network interface layer type type definition. */
    46 typedef uint8_t hw_type_t;
     40#define INET_TTL_MAX 255
    4741
    48 /** @name Network interface layer types definitions */
    49 /*@{*/
     42typedef struct {
     43        uint32_t ipv4;
     44} inet_addr_t;
    5045
    51 /** Ethernet (10Mb) hardware type. */
    52 #define HW_ETHER                1
     46typedef struct {
     47        inet_addr_t src;
     48        inet_addr_t dest;
     49        uint8_t tos;
     50        void *data;
     51        size_t size;
     52} inet_dgram_t;
    5353
    54 /*@}*/
     54typedef struct {
     55        int (*recv)(inet_dgram_t *);
     56} inet_ev_ops_t;
     57
     58typedef enum {
     59        INET_DF = 1
     60} inet_df_t;
     61
     62extern int inet_init(uint8_t, inet_ev_ops_t *);
     63extern int inet_send(inet_dgram_t *, uint8_t, inet_df_t);
     64extern int inet_get_srcaddr(inet_addr_t *, uint8_t, inet_addr_t *);
    5565
    5666#endif
     
    5868/** @}
    5969 */
    60 
  • uspace/lib/c/include/inet/inetping.h

    rba72f2b r6843a9c  
    11/*
    2  * Copyright (c) 2006 Josef Cejka
     2 * Copyright (c) 2012 Jiri Svoboda
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup kbd_port
    30  * @ingroup  kbd
     29/** @addtogroup libc
    3130 * @{
    3231 */
    33 
    3432/** @file
    35  * @brief i8042 port driver.
    3633 */
    3734
    38 #ifndef i8042_H_
    39 #define i8042_H_
     35#ifndef LIBC_INET_INETPING_H_
     36#define LIBC_INET_INETPING_H_
    4037
     38#include <inet/inet.h>
    4139#include <sys/types.h>
    42 #include <libarch/ddi.h>
    43 #include <async.h>
    4440
    45 /** i8042 HW I/O interface */
    46 struct i8042 {
    47         ioport8_t data;
    48         uint8_t pad[3];
    49         ioport8_t status;
    50 } __attribute__ ((packed));
    51 typedef struct i8042 i8042_t;
     41typedef struct {
     42        inet_addr_t src;
     43        inet_addr_t dest;
     44        uint16_t seq_no;
     45        void *data;
     46        size_t size;
     47} inetping_sdu_t;
    5248
    53 /** Softstate structure, one for each serial port (primary and aux). */
    54 typedef struct {
    55         service_id_t service_id;
    56         async_sess_t *client_sess;
    57 } i8042_port_t;
     49typedef struct inetping_ev_ops {
     50        int (*recv)(inetping_sdu_t *);
     51} inetping_ev_ops_t;
     52
     53extern int inetping_init(inetping_ev_ops_t *);
     54extern int inetping_send(inetping_sdu_t *);
     55extern int inetping_get_srcaddr(inet_addr_t *, inet_addr_t *);
     56
    5857
    5958#endif
    6059
    61 /**
    62  * @}
     60/** @}
    6361 */
  • uspace/lib/c/include/ipc/devman.h

    rba72f2b r6843a9c  
    146146typedef enum {
    147147        DRIVER_DEV_ADD = IPC_FIRST_USER_METHOD,
    148         DRIVER_DEV_ADDED,
    149148        DRIVER_DEV_REMOVE,
    150149        DRIVER_DEV_GONE,
     
    158157        DEVMAN_FUN_GET_CHILD,
    159158        DEVMAN_FUN_GET_NAME,
     159        DEVMAN_FUN_GET_DRIVER_NAME,
    160160        DEVMAN_FUN_ONLINE,
    161161        DEVMAN_FUN_OFFLINE,
  • uspace/lib/c/include/ipc/inet.h

    rba72f2b r6843a9c  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
    3  * Copyright (c) 2011 Radim Vansa
     2 * Copyright (c) 2012 Jiri Svoboda
    43 * All rights reserved.
    54 *
     
    2827 */
    2928
    30 /** @addtogroup libpacket
     29/** @addtogroup libcipc
    3130 * @{
    3231 */
    33 
    3432/** @file
    35  * Packet server.
    36  * The hosting module has to be compiled with both the packet.c and the
    37  * packet_server.c source files. To function correctly, initialization of the
    38  * packet map by the pm_init() function has to happen at the first place. Then
    39  * the packet messages have to be processed by the packet_server_message()
    40  * function. The packet map should be released by the pm_destroy() function
    41  * during the module termination.
    42  * @see IS_NET_PACKET_MESSAGE()
    4333 */
    4434
    45 #ifndef NET_PACKET_SERVER_H_
    46 #define NET_PACKET_SERVER_H_
     35#ifndef LIBC_IPC_INET_H_
     36#define LIBC_IPC_INET_H_
    4737
    4838#include <ipc/common.h>
    4939
    50 extern int packet_server_init(void);
    51 extern int packet_server_message(ipc_callid_t, ipc_call_t *, ipc_call_t *,
    52     size_t *);
     40/** Inet ports */
     41typedef enum {
     42        /** Default port */
     43        INET_PORT_DEFAULT = 1,
     44        /** Configuration port */
     45        INET_PORT_CFG,
     46        /** Ping service port */
     47        INET_PORT_PING
     48} inet_port_t;
     49
     50/** Requests on Inet default port */
     51typedef enum {
     52        INET_CALLBACK_CREATE = IPC_FIRST_USER_METHOD,
     53        INET_GET_SRCADDR,
     54        INET_SEND,
     55        INET_SET_PROTO
     56} inet_request_t;
     57
     58/** Events on Inet default port */
     59typedef enum {
     60        INET_EV_RECV = IPC_FIRST_USER_METHOD
     61} inet_event_t;
     62
     63/** Requests on Inet configuration port */
     64typedef enum {
     65        INETCFG_ADDR_CREATE_STATIC = IPC_FIRST_USER_METHOD,
     66        INETCFG_ADDR_DELETE,
     67        INETCFG_ADDR_GET,
     68        INETCFG_ADDR_GET_ID,
     69        INETCFG_GET_ADDR_LIST,
     70        INETCFG_GET_LINK_LIST,
     71        INETCFG_GET_SROUTE_LIST,
     72        INETCFG_LINK_GET,
     73        INETCFG_SROUTE_CREATE,
     74        INETCFG_SROUTE_DELETE,
     75        INETCFG_SROUTE_GET,
     76        INETCFG_SROUTE_GET_ID
     77} inetcfg_request_t;
     78
     79/** Events on Inet ping port */
     80typedef enum {
     81        INETPING_EV_RECV = IPC_FIRST_USER_METHOD
     82} inetping_event_t;
     83
     84/** Requests on Inet ping port */
     85typedef enum {
     86        INETPING_SEND = IPC_FIRST_USER_METHOD,
     87        INETPING_GET_SRCADDR
     88} inetping_request_t;
    5389
    5490#endif
    5591
    56 /** @}
     92/**
     93 * @}
    5794 */
  • uspace/lib/c/include/ipc/ipc.h

    rba72f2b r6843a9c  
    254254    sysarg_t, sysarg_t, void *, ipc_async_callback_t, bool);
    255255
     256extern int ipc_clone_establish(int);
    256257extern int ipc_connect_to_me(int, sysarg_t, sysarg_t, sysarg_t, task_id_t *,
    257258    sysarg_t *);
    258 extern int ipc_connect_me(int);
    259259extern int ipc_connect_me_to(int, sysarg_t, sysarg_t, sysarg_t);
    260260extern int ipc_connect_me_to_blocking(int, sysarg_t, sysarg_t, sysarg_t);
     
    271271 */
    272272
    273 #define ipc_share_in_start_0_0(phoneid, dst, size) \
    274         ipc_share_in_start((phoneid), (dst), (size), 0, NULL)
    275 #define ipc_share_in_start_0_1(phoneid, dst, size, flags) \
    276         ipc_share_in_start((phoneid), (dst), (size), 0, (flags))
    277 #define ipc_share_in_start_1_0(phoneid, dst, size, arg) \
    278         ipc_share_in_start((phoneid), (dst), (size), (arg), NULL)
    279 #define ipc_share_in_start_1_1(phoneid, dst, size, arg, flags) \
    280         ipc_share_in_start((phoneid), (dst), (size), (arg), (flags))
    281 
    282 extern int ipc_share_in_start(int, void *, size_t, sysarg_t, unsigned int *);
     273#define ipc_share_in_start_0_0(phoneid, size, dst) \
     274        ipc_share_in_start((phoneid), (size), 0, NULL, (dst))
     275#define ipc_share_in_start_0_1(phoneid, size, flags, dst) \
     276        ipc_share_in_start((phoneid), (size), 0, (flags), (dst))
     277#define ipc_share_in_start_1_0(phoneid, size, arg, dst) \
     278        ipc_share_in_start((phoneid), (size), (arg), NULL, (dst))
     279#define ipc_share_in_start_1_1(phoneid, size, arg, flags, dst) \
     280        ipc_share_in_start((phoneid), (size), (arg), (flags), (dst))
     281
     282extern int ipc_share_in_start(int, size_t, sysarg_t, unsigned int *, void **);
    283283extern int ipc_share_in_finalize(ipc_callid_t, void *, unsigned int);
    284284extern int ipc_share_out_start(int, void *, unsigned int);
    285 extern int ipc_share_out_finalize(ipc_callid_t, void *);
     285extern int ipc_share_out_finalize(ipc_callid_t, void **);
    286286extern int ipc_data_read_start(int, void *, size_t);
    287287extern int ipc_data_read_finalize(ipc_callid_t, const void *, size_t);
  • uspace/lib/c/include/ipc/loc.h

    rba72f2b r6843a9c  
    5656        LOC_SERVICE_GET_ID,
    5757        LOC_SERVICE_GET_NAME,
     58        LOC_SERVICE_GET_SERVER_NAME,
    5859        LOC_NAMESPACE_GET_ID,
    5960        LOC_CALLBACK_CREATE,
  • uspace/lib/c/include/ipc/services.h

    rba72f2b r6843a9c  
    4848        SERVICE_IRC        = FOURCC('i', 'r', 'c', ' '),
    4949        SERVICE_CLIPBOARD  = FOURCC('c', 'l', 'i', 'p'),
    50         SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '),
    51         SERVICE_ETHERNET   = FOURCC('e', 't', 'h', ' '),
    52         SERVICE_NILDUMMY   = FOURCC('n', 'i', 'l', 'd'),
    53         SERVICE_IP         = FOURCC('i', 'p', 'v', '4'),
    54         SERVICE_ARP        = FOURCC('a', 'r', 'p', ' '),
    55         SERVICE_ICMP       = FOURCC('i', 'c', 'm', 'p'),
    5650        SERVICE_UDP        = FOURCC('u', 'd', 'p', ' '),
    5751        SERVICE_TCP        = FOURCC('t', 'c', 'p', ' ')
    5852} services_t;
     53
     54#define SERVICE_NAME_INET     "net/inet"
     55#define SERVICE_NAME_INETCFG  "net/inetcfg"
     56#define SERVICE_NAME_INETPING "net/inetping"
    5957
    6058#endif
  • uspace/lib/c/include/ipc/socket.h

    rba72f2b r6843a9c  
    3838#define LIBC_SOCKET_MESSAGES_H_
    3939
    40 #include <ipc/net.h>
    41 
    4240/** Socket client messages. */
    4341typedef enum {
    4442        /** Creates a new socket. @see socket() */
    45         NET_SOCKET = NET_SOCKET_FIRST,
     43        NET_SOCKET = IPC_FIRST_USER_METHOD,
    4644        /** Binds the socket. @see bind() */
    4745        NET_SOCKET_BIND,
  • uspace/lib/c/include/ipc/vfs.h

    rba72f2b r6843a9c  
    4242#define FS_NAME_MAXLEN  20
    4343#define MAX_PATH_LEN    (64 * 1024)
     44#define MAX_MNTOPTS_LEN 256
    4445#define PLB_SIZE        (2 * MAX_PATH_LEN)
    4546
     
    8081        VFS_IN_DUP,
    8182        VFS_IN_WAIT_HANDLE,
     83        VFS_IN_MTAB_GET,
    8284} vfs_in_request_t;
    8385
  • uspace/lib/c/include/loc.h

    rba72f2b r6843a9c  
    4646extern void loc_exchange_end(async_exch_t *);
    4747
    48 extern int loc_server_register(const char *, async_client_conn_t);
     48extern int loc_server_register(const char *);
    4949extern int loc_service_register(const char *, service_id_t *);
    5050extern int loc_service_register_with_iface(const char *, service_id_t *,
     
    5656    unsigned int);
    5757extern int loc_service_get_name(service_id_t, char **);
     58extern int loc_service_get_server_name(service_id_t, char **);
    5859extern int loc_namespace_get_id(const char *, service_id_t *,
    5960    unsigned int);
  • uspace/lib/c/include/net/device.h

    rba72f2b r6843a9c  
    11/*
    22 * Copyright (c) 2009 Lukas Mejdrech
    3  * Copyright (c) 2011 Radim Vansa
    43 * All rights reserved.
    54 *
     
    3332
    3433/** @file
    35  * Device identifier, state and usage statistics.
     34 * Network device.
    3635 */
    3736
    38 #ifndef LIBC_DEVICE_ID_TYPE_H_
    39 #define LIBC_DEVICE_ID_TYPE_H_
     37#ifndef LIBC_NET_DEVICE_H_
     38#define LIBC_NET_DEVICE_H_
    4039
    4140#include <adt/int_map.h>
    42 #include <net/eth_phys.h>
    43 #include <bool.h>
    44 
    45 /** Ethernet address length. */
    46 #define ETH_ADDR  6
    47 
    48 /** MAC printing format */
    49 #define PRIMAC  "%02x:%02x:%02x:%02x:%02x:%02x"
    50 
    51 /** MAC arguments */
    52 #define ARGSMAC(__a) \
    53         (__a)[0], (__a)[1], (__a)[2], (__a)[3], (__a)[4], (__a)[5]
    54 
    55 /* Compare MAC address with specific value */
    56 #define MAC_EQUALS_VALUE(__a, __a0, __a1, __a2, __a3, __a4, __a5) \
    57         ((__a)[0] == (__a0) && (__a)[1] == (__a1) && (__a)[2] == (__a2) \
    58         && (__a)[3] == (__a3) && (__a)[4] == (__a4) && (__a)[5] == (__a5))
    59 
    60 #define MAC_IS_ZERO(__x) \
    61         MAC_EQUALS_VALUE(__x, 0, 0, 0, 0, 0, 0)
     41#include <nic/nic.h>
    6242
    6343/** Device identifier to generic type map declaration. */
     
    6747#define DEVICE_MAP_IMPLEMENT  INT_MAP_IMPLEMENT
    6848
    69 /** Max length of any hw nic address (currently only eth) */
    70 #define NIC_MAX_ADDRESS_LENGTH  16
     49/** Device identifier type. */
     50typedef int nic_device_id_t;
    7151
    7252/** Invalid device identifier. */
    7353#define NIC_DEVICE_INVALID_ID  (-1)
    74 
    75 #define NIC_VENDOR_MAX_LENGTH         64
    76 #define NIC_MODEL_MAX_LENGTH          64
    77 #define NIC_PART_NUMBER_MAX_LENGTH    64
    78 #define NIC_SERIAL_NUMBER_MAX_LENGTH  64
    79 
    80 /**
    81  * The bitmap uses single bit for each of the 2^12 = 4096 possible VLAN tags.
    82  * This means its size is 4096/8 = 512 bytes.
    83  */
    84 #define NIC_VLAN_BITMAP_SIZE  512
    85 
    86 #define NIC_DEVICE_PRINT_FMT  "%x"
    87 
    88 /** Device identifier type. */
    89 typedef int nic_device_id_t;
    90 
    91 /**
    92  * Structure covering the MAC address.
    93  */
    94 typedef struct nic_address {
    95         uint8_t address[ETH_ADDR];
    96 } nic_address_t;
    97 
    98 /** Device state. */
    99 typedef enum nic_device_state {
    100         /**
    101          * Device present and stopped. Moving device to this state means to discard
    102          * all settings and WOL virtues, rebooting the NIC to state as if the
    103          * computer just booted (or the NIC was just inserted in case of removable
    104          * NIC).
    105          */
    106         NIC_STATE_STOPPED,
    107         /**
    108          * If the NIC is in this state no packets (frames) are transmitted nor
    109          * received. However, the settings are not restarted. You can use this state
    110          * to temporarily disable transmition/reception or atomically (with respect
    111          * to incoming/outcoming packets) change frames acceptance etc.
    112          */
    113         NIC_STATE_DOWN,
    114         /** Device is normally operating. */
    115         NIC_STATE_ACTIVE,
    116         /** Just a constant to limit the state numbers */
    117         NIC_STATE_MAX,
    118 } nic_device_state_t;
    119 
    120 /**
    121  * Channel operating mode used on the medium.
    122  */
    123 typedef enum {
    124         NIC_CM_UNKNOWN,
    125         NIC_CM_FULL_DUPLEX,
    126         NIC_CM_HALF_DUPLEX,
    127         NIC_CM_SIMPLEX
    128 } nic_channel_mode_t;
    129 
    130 /**
    131  * Role for the device (used e.g. for 1000Gb ethernet)
    132  */
    133 typedef enum {
    134         NIC_ROLE_UNKNOWN,
    135         NIC_ROLE_AUTO,
    136         NIC_ROLE_MASTER,
    137         NIC_ROLE_SLAVE
    138 } nic_role_t;
    139 
    140 /**
    141  * Current state of the cable in the device
    142  */
    143 typedef enum {
    144         NIC_CS_UNKNOWN,
    145         NIC_CS_PLUGGED,
    146         NIC_CS_UNPLUGGED
    147 } nic_cable_state_t;
    148 
    149 /**
    150  * Result of the requested operation
    151  */
    152 typedef enum {
    153         /** Successfully disabled */
    154         NIC_RESULT_DISABLED,
    155         /** Successfully enabled */
    156         NIC_RESULT_ENABLED,
    157         /** Not supported at all */
    158         NIC_RESULT_NOT_SUPPORTED,
    159         /** Temporarily not available */
    160         NIC_RESULT_NOT_AVAILABLE,
    161         /** Result extensions */
    162         NIC_RESULT_FIRST_EXTENSION
    163 } nic_result_t;
    164 
    165 /** Device usage statistics. */
    166 typedef struct nic_device_stats {
    167         /** Total packets received (accepted). */
    168         unsigned long receive_packets;
    169         /** Total packets transmitted. */
    170         unsigned long send_packets;
    171         /** Total bytes received (accepted). */
    172         unsigned long receive_bytes;
    173         /** Total bytes transmitted. */
    174         unsigned long send_bytes;
    175         /** Bad packets received counter. */
    176         unsigned long receive_errors;
    177         /** Packet transmition problems counter. */
    178         unsigned long send_errors;
    179         /** Number of frames dropped due to insufficient space in RX buffers */
    180         unsigned long receive_dropped;
    181         /** Number of frames dropped due to insufficient space in TX buffers */
    182         unsigned long send_dropped;
    183         /** Total multicast packets received (accepted). */
    184         unsigned long receive_multicast;
    185         /** Total broadcast packets received (accepted). */
    186         unsigned long receive_broadcast;
    187         /** The number of collisions due to congestion on the medium. */
    188         unsigned long collisions;
    189         /** Unicast packets received but not accepted (filtered) */
    190         unsigned long receive_filtered_unicast;
    191         /** Multicast packets received but not accepted (filtered) */
    192         unsigned long receive_filtered_multicast;
    193         /** Broadcast packets received but not accepted (filtered) */
    194         unsigned long receive_filtered_broadcast;
    195 
    196         /* detailed receive_errors */
    197 
    198         /** Received packet length error counter. */
    199         unsigned long receive_length_errors;
    200         /** Receiver buffer overflow counter. */
    201         unsigned long receive_over_errors;
    202         /** Received packet with crc error counter. */
    203         unsigned long receive_crc_errors;
    204         /** Received frame alignment error counter. */
    205         unsigned long receive_frame_errors;
    206         /** Receiver fifo overrun counter. */
    207         unsigned long receive_fifo_errors;
    208         /** Receiver missed packet counter. */
    209         unsigned long receive_missed_errors;
    210 
    211         /* detailed send_errors */
    212 
    213         /** Transmitter aborted counter. */
    214         unsigned long send_aborted_errors;
    215         /** Transmitter carrier errors counter. */
    216         unsigned long send_carrier_errors;
    217         /** Transmitter fifo overrun counter. */
    218         unsigned long send_fifo_errors;
    219         /** Transmitter carrier errors counter. */
    220         unsigned long send_heartbeat_errors;
    221         /** Transmitter window errors counter. */
    222         unsigned long send_window_errors;
    223 
    224         /* for cslip etc */
    225        
    226         /** Total compressed packets received. */
    227         unsigned long receive_compressed;
    228         /** Total compressed packet transmitted. */
    229         unsigned long send_compressed;
    230 } nic_device_stats_t;
    231 
    232 /** Errors corresponding to those in the nic_device_stats_t */
    233 typedef enum {
    234         NIC_SEC_BUFFER_FULL,
    235         NIC_SEC_ABORTED,
    236         NIC_SEC_CARRIER_LOST,
    237         NIC_SEC_FIFO_OVERRUN,
    238         NIC_SEC_HEARTBEAT,
    239         NIC_SEC_WINDOW_ERROR,
    240         /* Error encountered during TX but with other type of error */
    241         NIC_SEC_OTHER
    242 } nic_send_error_cause_t;
    243 
    244 /** Errors corresponding to those in the nic_device_stats_t */
    245 typedef enum {
    246         NIC_REC_BUFFER_FULL,
    247         NIC_REC_LENGTH,
    248         NIC_REC_BUFFER_OVERFLOW,
    249         NIC_REC_CRC,
    250         NIC_REC_FRAME_ALIGNMENT,
    251         NIC_REC_FIFO_OVERRUN,
    252         NIC_REC_MISSED,
    253         /* Error encountered during RX but with other type of error */
    254         NIC_REC_OTHER
    255 } nic_receive_error_cause_t;
    256 
    257 /**
    258  * Information about the NIC that never changes - name, vendor, model,
    259  * capabilites and so on.
    260  */
    261 typedef struct nic_device_info {
    262         /* Device identification */
    263         char vendor_name[NIC_VENDOR_MAX_LENGTH];
    264         char model_name[NIC_MODEL_MAX_LENGTH];
    265         char part_number[NIC_PART_NUMBER_MAX_LENGTH];
    266         char serial_number[NIC_SERIAL_NUMBER_MAX_LENGTH];
    267         uint16_t vendor_id;
    268         uint16_t device_id;
    269         uint16_t subsystem_vendor_id;
    270         uint16_t subsystem_id;
    271         /* Device capabilities */
    272         uint16_t ethernet_support[ETH_PHYS_LAYERS];
    273 
    274         /** The mask of all modes which the device can advertise
    275          *
    276          *  see ETH_AUTONEG_ macros in net/eth_phys.h of libc
    277          */
    278         uint32_t autoneg_support;
    279 } nic_device_info_t;
    280 
    281 /**
    282  * Type of the ethernet frame
    283  */
    284 typedef enum nic_frame_type {
    285         NIC_FRAME_UNICAST,
    286         NIC_FRAME_MULTICAST,
    287         NIC_FRAME_BROADCAST
    288 } nic_frame_type_t;
    289 
    290 /**
    291  * Specifies which unicast frames is the NIC receiving.
    292  */
    293 typedef enum nic_unicast_mode {
    294         NIC_UNICAST_UNKNOWN,
    295         /** No unicast frames are received */
    296         NIC_UNICAST_BLOCKED,
    297         /** Only the frames with this NIC's MAC as destination are received */
    298         NIC_UNICAST_DEFAULT,
    299         /**
    300          * Both frames with this NIC's MAC and those specified in the list are
    301          * received
    302          */
    303         NIC_UNICAST_LIST,
    304         /** All unicast frames are received */
    305         NIC_UNICAST_PROMISC
    306 } nic_unicast_mode_t;
    307 
    308 typedef enum nic_multicast_mode {
    309         NIC_MULTICAST_UNKNOWN,
    310         /** No multicast frames are received */
    311         NIC_MULTICAST_BLOCKED,
    312         /** Frames with multicast addresses specified in this list are received */
    313         NIC_MULTICAST_LIST,
    314         /** All multicast frames are received */
    315         NIC_MULTICAST_PROMISC
    316 } nic_multicast_mode_t;
    317 
    318 typedef enum nic_broadcast_mode {
    319         NIC_BROADCAST_UNKNOWN,
    320         /** Broadcast frames are dropped */
    321         NIC_BROADCAST_BLOCKED,
    322         /** Broadcast frames are received */
    323         NIC_BROADCAST_ACCEPTED
    324 } nic_broadcast_mode_t;
    325 
    326 /**
    327  * Structure covering the bitmap with VLAN tags.
    328  */
    329 typedef struct nic_vlan_mask {
    330         uint8_t bitmap[NIC_VLAN_BITMAP_SIZE];
    331 } nic_vlan_mask_t;
    332 
    333 /* WOL virtue identifier */
    334 typedef unsigned int nic_wv_id_t;
    335 
    336 /**
    337  * Structure passed as argument for virtue NIC_WV_MAGIC_PACKET.
    338  */
    339 typedef struct nic_wv_magic_packet_data {
    340         uint8_t password[6];
    341 } nic_wv_magic_packet_data_t;
    342 
    343 /**
    344  * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV4
    345  */
    346 typedef struct nic_wv_ipv4_data {
    347         uint8_t address[4];
    348 } nic_wv_ipv4_data_t;
    349 
    350 /**
    351  * Structure passed as argument for virtue NIC_WV_DIRECTED_IPV6
    352  */
    353 typedef struct nic_wv_ipv6_data {
    354         uint8_t address[16];
    355 } nic_wv_ipv6_data_t;
    356 
    357 /**
    358  * WOL virtue types defining the interpretation of data passed to the virtue.
    359  * Those tagged with S can have only single virtue active at one moment, those
    360  * tagged with M can have multiple ones.
    361  */
    362 typedef enum nic_wv_type {
    363         /**
    364          * Used for deletion of the virtue - in this case the mask, data and length
    365          * arguments are ignored.
    366          */
    367         NIC_WV_NONE,
    368         /** S
    369          * Enabled <=> wakeup upon link change
    370          */
    371         NIC_WV_LINK_CHANGE,
    372         /** S
    373          * If this virtue is set up, wakeup can be issued by a magic packet frame.
    374          * If the data argument is not NULL, it must contain
    375          * nic_wv_magic_packet_data structure with the SecureOn password.
    376          */
    377         NIC_WV_MAGIC_PACKET,
    378         /** M
    379          * If the virtue is set up, wakeup can be issued by a frame targeted to
    380          * device with MAC address specified in data. The data must contain
    381          * nic_address_t structure.
    382          */
    383         NIC_WV_DESTINATION,
    384         /** S
    385          * Enabled <=> wakeup upon receiving broadcast frame
    386          */
    387         NIC_WV_BROADCAST,
    388         /** S
    389          * Enabled <=> wakeup upon receiving ARP Request
    390          */
    391         NIC_WV_ARP_REQUEST,
    392         /** M
    393          * If enabled, the wakeup is issued upon receiving frame with an IPv4 packet
    394          * with IPv4 address specified in data. The data must contain
    395          * nic_wv_ipv4_data structure.
    396          */
    397         NIC_WV_DIRECTED_IPV4,
    398         /** M
    399          * If enabled, the wakeup is issued upon receiving frame with an IPv4 packet
    400          * with IPv6 address specified in data. The data must contain
    401          * nic_wv_ipv6_data structure.
    402          */
    403         NIC_WV_DIRECTED_IPV6,
    404         /** M
    405          * First length/2 bytes in the argument are interpreted as mask, second
    406          * length/2 bytes are interpreted as content.
    407          * If enabled, the wakeup is issued upon receiving frame where the bytes
    408          * with non-zero value in the mask equal to those in the content.
    409          */
    410         NIC_WV_FULL_MATCH,
    411         /**
    412          * Dummy value, do not use.
    413          */
    414         NIC_WV_MAX
    415 } nic_wv_type_t;
    416 
    417 /**
    418  * Specifies the interrupt/polling mode used by the driver and NIC
    419  */
    420 typedef enum nic_poll_mode {
    421         /**
    422          * NIC issues interrupts upon events.
    423          */
    424         NIC_POLL_IMMEDIATE,
    425         /**
    426          * Some uspace app calls nic_poll_now(...) in order to check the NIC state
    427          * - no interrupts are received from the NIC.
    428          */
    429         NIC_POLL_ON_DEMAND,
    430         /**
    431          * The driver itself issues a poll request in a periodic manner. It is
    432          * allowed to use hardware timer if the NIC supports it.
    433          */
    434         NIC_POLL_PERIODIC,
    435         /**
    436          * The driver itself issued a poll request in a periodic manner. The driver
    437          * must create software timer, internal hardware timer of NIC must not be
    438          * used even if the NIC supports it.
    439          */
    440         NIC_POLL_SOFTWARE_PERIODIC
    441 } nic_poll_mode_t;
    442 
    443 /**
    444  * Says if this virtue type is a multi-virtue (there can be multiple virtues of
    445  * this type at once).
    446  *
    447  * @param type
    448  *
    449  * @return true or false
    450  */
    451 static inline int nic_wv_is_multi(nic_wv_type_t type) {
    452         switch (type) {
    453         case NIC_WV_FULL_MATCH:
    454         case NIC_WV_DESTINATION:
    455         case NIC_WV_DIRECTED_IPV4:
    456         case NIC_WV_DIRECTED_IPV6:
    457                 return true;
    458         default:
    459                 return false;
    460         }
    461 }
    462 
    463 static inline const char *nic_device_state_to_string(nic_device_state_t state)
    464 {
    465         switch (state) {
    466         case NIC_STATE_STOPPED:
    467                 return "stopped";
    468         case NIC_STATE_DOWN:
    469                 return "down";
    470         case NIC_STATE_ACTIVE:
    471                 return "active";
    472         default:
    473                 return "undefined";
    474         }
    475 }
    47654
    47755#endif
  • uspace/lib/c/include/net/in.h

    rba72f2b r6843a9c  
    4545#define INET_ADDRSTRLEN  (4 * 3 + 3 + 1)
    4646
     47#define INADDR_ANY 0
     48
    4749/** Type definition of the INET address.
    4850 * @see in_addr
  • uspace/lib/c/include/nic/eth_phys.h

    rba72f2b r6843a9c  
    2828 */
    2929
    30 #ifndef LIBC_NET_ETH_PHYS_H_
    31 #define LIBC_NET_ETH_PHYS_H_
     30#ifndef LIBC_NIC_ETH_PHYS_H_
     31#define LIBC_NIC_ETH_PHYS_H_
    3232
    3333#include <sys/types.h>
  • uspace/lib/c/include/ns.h

    rba72f2b r6843a9c  
    3737
    3838#include <sys/types.h>
     39#include <ipc/services.h>
    3940#include <task.h>
    4041#include <async.h>
    4142
    4243extern int service_register(sysarg_t);
    43 extern async_sess_t *service_connect(exch_mgmt_t, sysarg_t, sysarg_t, sysarg_t);
    44 extern async_sess_t *service_connect_blocking(exch_mgmt_t, sysarg_t, sysarg_t,
     44extern async_sess_t *service_connect(exch_mgmt_t, services_t, sysarg_t, sysarg_t);
     45extern async_sess_t *service_connect_blocking(exch_mgmt_t, services_t, sysarg_t,
    4546    sysarg_t);
     47extern async_sess_t *service_bind(services_t, sysarg_t, sysarg_t, sysarg_t,
     48    async_client_conn_t);
    4649
    4750extern int ns_ping(void);
  • uspace/lib/c/include/stdarg.h

    rba72f2b r6843a9c  
    4343#define va_arg(ap, type)    __builtin_va_arg(ap, type)
    4444#define va_end(ap)          __builtin_va_end(ap)
     45#define va_copy(dst, src)   __builtin_va_copy(dst, src)
    4546
    4647#endif
  • uspace/lib/c/include/stdio.h

    rba72f2b r6843a9c  
    3939#include <stdarg.h>
    4040#include <str.h>
    41 #include <adt/list.h>
    4241
    4342#ifndef NVERIFY_PRINTF
  • uspace/lib/c/include/str.h

    rba72f2b r6843a9c  
    6161extern size_t wstr_size(const wchar_t *str);
    6262
     63extern size_t str_nsize(const char *str, size_t max_size);
     64extern size_t wstr_nsize(const wchar_t *str, size_t max_size);
     65
    6366extern size_t str_lsize(const char *str, size_t max_len);
    6467extern size_t wstr_lsize(const wchar_t *str, size_t max_len);
     
    9194extern char *str_rchr(const char *str, wchar_t ch);
    9295
     96extern void str_rtrim(char *str, wchar_t ch);
     97extern void str_ltrim(char *str, wchar_t ch);
     98
    9399extern bool wstr_linsert(wchar_t *str, wchar_t ch, size_t pos, size_t max_pos);
    94100extern bool wstr_remove(wchar_t *str, size_t pos);
     
    100106extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *);
    101107extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *);
    102 extern int str_uint64(const char *, char **, unsigned int, bool, uint64_t *);
     108extern int str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *);
    103109extern int str_size_t(const char *, char **, unsigned int, bool, size_t *);
    104110
  • uspace/lib/c/include/sys/mman.h

    rba72f2b r6843a9c  
    3939#include <sys/types.h>
    4040
    41 #define MAP_FAILED  ((void *) -1)
     41#define MAP_FAILED  AS_MAP_FAILED
    4242
    4343#define MAP_SHARED     (1 << 0)
  • uspace/lib/c/include/sysinfo.h

    rba72f2b r6843a9c  
    4040#include <abi/sysinfo.h>
    4141
     42extern char *sysinfo_get_keys(const char *, size_t *);
    4243extern sysinfo_item_val_type_t sysinfo_get_val_type(const char *);
    4344extern int sysinfo_get_value(const char *, sysarg_t *);
    4445extern void *sysinfo_get_data(const char *, size_t *);
     46extern void *sysinfo_get_property(const char *, const char *, size_t *);
    4547
    4648#endif
  • uspace/lib/c/include/unistd.h

    rba72f2b r6843a9c  
    5858#define getpagesize()  (PAGE_SIZE)
    5959
    60 extern int dup2(int oldfd, int newfd);
     60extern int dup2(int, int);
    6161
    6262extern ssize_t write(int, const void *, size_t);
     
    7373extern int unlink(const char *);
    7474
    75 extern char *getcwd(char *buf, size_t);
     75extern char *getcwd(char *, size_t);
    7676extern int rmdir(const char *);
    7777extern int chdir(const char *);
  • uspace/lib/c/include/vfs/vfs.h

    rba72f2b r6843a9c  
    3939#include <ipc/vfs.h>
    4040#include <ipc/loc.h>
     41#include <adt/list.h>
    4142#include <stdio.h>
    4243#include <async.h>
     44#include "vfs_mtab.h"
    4345
    4446enum vfs_change_state_type {
     
    5557
    5658extern int fd_wait(void);
     59extern int get_mtab_list(list_t *mtab_list);
    5760
    5861extern async_exch_t *vfs_exchange_begin(void);
  • uspace/lib/c/include/vfs/vfs_mtab.h

    rba72f2b r6843a9c  
    11/*
    2  * Copyright (c) 2009 Lukas Mejdrech
     2 * Copyright (c) 2011 Maurizio Lombardi
    33 * All rights reserved.
    44 *
     
    3030 * @{
    3131 */
    32 
    3332/** @file
    34  * Transport layer modules messages.
    35  * @see tl_interface.h
    3633 */
    3734
    38 #ifndef LIBC_TL_MESSAGES_H_
    39 #define LIBC_TL_MESSAGES_H_
     35#ifndef LIBC_VFS_MTAB_H_
     36#define LIBC_VFS_MTAB_H_
    4037
    41 #include <ipc/net.h>
     38#include <sys/types.h>
     39#include <ipc/vfs.h>
     40#include <adt/list.h>
    4241
    43 /** Transport layer modules messages. */
    44 typedef enum {
    45         /** Packet received message.
    46          * @see tl_received_msg()
    47          */
    48         NET_TL_RECEIVED = NET_TL_FIRST
    49 } tl_messages;
     42typedef struct mtab_ent {
     43        link_t link;
     44        char mp[MAX_PATH_LEN];
     45        char opts[MAX_MNTOPTS_LEN];
     46        char fs_name[FS_NAME_MAXLEN];
     47        unsigned int instance;
     48        service_id_t service_id;
     49} mtab_ent_t;
    5050
    5151#endif
Note: See TracChangeset for help on using the changeset viewer.