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


Ignore:
Timestamp:
2013-07-28T23:07:18Z (12 years ago)
Author:
Dominik Taborsky (AT DOT) <brembyseznamcz>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
2b55edb
Parents:
283ea3d (diff), ccdc63e (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:

mainline merge

Location:
uspace/lib/c/include
Files:
7 added
50 edited
2 moved

Legend:

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

    r283ea3d re3bc355  
    4040#include <adt/list.h>
    4141#include <unistd.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343#include <macros.h>
    4444
  • uspace/lib/c/include/async.h

    r283ea3d re3bc355  
    4444#include <sys/time.h>
    4545#include <atomic.h>
    46 #include <bool.h>
     46#include <stdbool.h>
    4747#include <task.h>
    4848
     
    156156extern void async_set_client_connection(async_client_conn_t);
    157157extern void async_set_interrupt_received(async_interrupt_handler_t);
     158extern void async_set_interrupt_handler_stack_size(size_t);
    158159
    159160/*
  • uspace/lib/c/include/atomicdflt.h

    r283ea3d re3bc355  
    4141
    4242#include <stdint.h>
    43 #include <bool.h>
     43#include <stdbool.h>
    4444
    4545typedef struct atomic {
  • uspace/lib/c/include/bd_srv.h

    r283ea3d re3bc355  
    3939#include <async.h>
    4040#include <fibril_synch.h>
    41 #include <bool.h>
     41#include <stdbool.h>
    4242#include <sys/types.h>
    4343
     
    5757} bd_srv_t;
    5858
    59 typedef struct bd_ops {
     59struct bd_ops {
    6060        int (*open)(bd_srvs_t *, bd_srv_t *);
    6161        int (*close)(bd_srv_t *);
     
    6565        int (*get_block_size)(bd_srv_t *, size_t *);
    6666        int (*get_num_blocks)(bd_srv_t *, aoff64_t *);
    67 } bd_ops_t;
     67};
    6868
    6969extern void bd_srvs_init(bd_srvs_t *);
  • uspace/lib/c/include/bitops.h

    r283ea3d re3bc355  
    107107}
    108108
     109extern int __popcountsi2(int);
     110
    109111#endif
    110112
  • uspace/lib/c/include/cfg.h

    r283ea3d re3bc355  
    4141#include <adt/list.h>
    4242#include <sys/types.h>
    43 #include <bool.h>
     43#include <stdbool.h>
    4444
    4545/**
  • uspace/lib/c/include/ddi.h

    r283ea3d re3bc355  
    3636#define LIBC_DDI_H_
    3737
     38#include <stdbool.h>
    3839#include <sys/types.h>
     40#include <sys/time.h>
    3941#include <abi/ddi/irq.h>
    4042#include <task.h>
     
    5052extern int dmamem_unmap_anonymous(void *);
    5153
    52 extern int iospace_enable(task_id_t, void *, unsigned long);
    5354extern int pio_enable(void *, size_t, void **);
     55
     56typedef void (*trace_fnc)(const volatile void *place, uint32_t val,
     57    volatile void* base, size_t size, void *data, bool write);
     58
     59extern int pio_trace_enable(void *, size_t, trace_fnc, void *);
     60extern void pio_trace_log(const volatile void *, uint32_t val, bool write);
     61extern void pio_trace_disable(void *);
     62
     63extern void pio_write_8(ioport8_t *, uint8_t);
     64extern void pio_write_16(ioport16_t *, uint16_t);
     65extern void pio_write_32(ioport32_t *, uint32_t);
     66
     67extern uint8_t pio_read_8(const ioport8_t *);
     68extern uint16_t pio_read_16(const ioport16_t *);
     69extern uint32_t pio_read_32(const ioport32_t *);
     70
     71static inline uint8_t pio_change_8(
     72    ioport8_t *reg, uint8_t val, uint8_t mask, useconds_t delay)
     73{
     74        uint8_t v = pio_read_8(reg);
     75        udelay(delay);
     76        pio_write_8(reg, (v & ~mask) | val);
     77        return v;
     78}
     79
     80static inline uint16_t pio_change_16(
     81    ioport16_t *reg, uint16_t val, uint16_t mask, useconds_t delay)
     82{
     83        uint16_t v = pio_read_16(reg);
     84        udelay(delay);
     85        pio_write_16(reg, (v & ~mask) | val);
     86        return v;
     87}
     88
     89static inline uint32_t pio_change_32(
     90    ioport32_t *reg, uint32_t val, uint32_t mask, useconds_t delay)
     91{
     92        uint32_t v = pio_read_32(reg);
     93        udelay(delay);
     94        pio_write_32(reg, (v & ~mask) | val);
     95        return v;
     96}
     97
     98static inline uint8_t pio_set_8(ioport8_t *r, uint8_t v, useconds_t d)
     99{
     100        return pio_change_8(r, v, 0, d);
     101}
     102static inline uint16_t pio_set_16(ioport16_t *r, uint16_t v, useconds_t d)
     103{
     104        return pio_change_16(r, v, 0, d);
     105}
     106static inline uint32_t pio_set_32(ioport32_t *r, uint32_t v, useconds_t d)
     107{
     108        return pio_change_32(r, v, 0, d);
     109}
     110
     111static inline uint8_t pio_clear_8(ioport8_t *r, uint8_t v, useconds_t d)
     112{
     113        return pio_change_8(r, 0, v, d);
     114}
     115static inline uint16_t pio_clear_16(ioport16_t *r, uint16_t v, useconds_t d)
     116{
     117        return pio_change_16(r, 0, v, d);
     118}
     119static inline uint32_t pio_clear_32(ioport32_t *r, uint32_t v, useconds_t d)
     120{
     121        return pio_change_32(r, 0, v, d);
     122}
    54123
    55124extern int irq_register(int, int, int, irq_code_t *);
  • uspace/lib/c/include/device/hw_res.h

    r283ea3d re3bc355  
    3838#include <ipc/dev_iface.h>
    3939#include <async.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242#define DMA_MODE_ON_DEMAND  0
  • uspace/lib/c/include/device/hw_res_parsed.h

    r283ea3d re3bc355  
    127127        free(list->dma_channels.channels);
    128128       
    129         bzero(list, sizeof(hw_res_list_parsed_t));
     129        memset(list, 0, sizeof(hw_res_list_parsed_t));
    130130}
    131131
     
    136136static inline void hw_res_list_parsed_init(hw_res_list_parsed_t *list)
    137137{
    138         bzero(list, sizeof(hw_res_list_parsed_t));
     138        memset(list, 0, sizeof(hw_res_list_parsed_t));
    139139}
    140140
  • uspace/lib/c/include/devman.h

    r283ea3d re3bc355  
    4040#include <ipc/loc.h>
    4141#include <async.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343
    4444extern async_exch_t *devman_exchange_begin_blocking(devman_interface_t);
  • uspace/lib/c/include/fibril.h

    r283ea3d re3bc355  
    8686extern void context_restore(context_t *ctx) __attribute__((noreturn));
    8787
    88 extern fid_t fibril_create(int (*func)(void *), void *arg);
     88#define FIBRIL_DFLT_STK_SIZE    0
     89
     90#define fibril_create(func, arg) \
     91        fibril_create_generic((func), (arg), FIBRIL_DFLT_STK_SIZE)
     92extern fid_t fibril_create_generic(int (*func)(void *), void *arg, size_t);
    8993extern void fibril_destroy(fid_t fid);
    9094extern fibril_t *fibril_setup(void);
  • uspace/lib/c/include/fibril_synch.h

    r283ea3d re3bc355  
    4040#include <libarch/tls.h>
    4141#include <sys/time.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343
    4444typedef struct {
  • uspace/lib/c/include/ieee_double.h

    r283ea3d re3bc355  
    3131
    3232#include <stdint.h>
    33 #include <bool.h>
     33#include <stdbool.h>
    3434
    3535/** Represents a non-negative floating point number: significand * 2^exponent */
  • uspace/lib/c/include/inet/inet.h

    r283ea3d re3bc355  
    3636#define LIBC_INET_INET_H_
    3737
     38#include <inet/addr.h>
    3839#include <sys/types.h>
    3940
    4041#define INET_TTL_MAX 255
    41 
    42 typedef struct {
    43         uint32_t ipv4;
    44 } inet_addr_t;
    4542
    4643typedef struct {
  • uspace/lib/c/include/inet/inetcfg.h

    r283ea3d re3bc355  
    3838#include <inet/inet.h>
    3939#include <sys/types.h>
    40 
    41 /** Network address */
    42 typedef struct {
    43         /** Address */
    44         uint32_t ipv4;
    45         /** Number of valid bits in @c ipv4 */
    46         int bits;
    47 } inet_naddr_t;
    4840
    4941/** Address object info */
  • uspace/lib/c/include/inet/inetping.h

    r283ea3d re3bc355  
    4040
    4141typedef struct {
    42         inet_addr_t src;
    43         inet_addr_t dest;
     42        uint32_t src;
     43        uint32_t dest;
    4444        uint16_t seq_no;
    4545        void *data;
     
    5353extern int inetping_init(inetping_ev_ops_t *);
    5454extern int inetping_send(inetping_sdu_t *);
    55 extern int inetping_get_srcaddr(inet_addr_t *, inet_addr_t *);
    56 
     55extern int inetping_get_srcaddr(uint32_t, uint32_t *);
    5756
    5857#endif
  • uspace/lib/c/include/inet/iplink.h

    r283ea3d re3bc355  
    3838#include <async.h>
    3939#include <sys/types.h>
     40#include <inet/addr.h>
    4041
    4142struct iplink_ev_ops;
     
    4647} iplink_t;
    4748
    48 typedef struct {
    49         uint32_t ipv4;
    50 } iplink_addr_t;
    51 
    52 /** IP link Service Data Unit */
     49/** IPv4 link Service Data Unit */
    5350typedef struct {
    5451        /** Local source address */
    55         iplink_addr_t lsrc;
     52        addr32_t src;
    5653        /** Local destination address */
    57         iplink_addr_t ldest;
     54        addr32_t dest;
    5855        /** Serialized IP packet */
    5956        void *data;
     
    6259} iplink_sdu_t;
    6360
     61/** IPv6 link Service Data Unit */
     62typedef struct {
     63        /** Local MAC destination address */
     64        addr48_t dest;
     65        /** Serialized IP packet */
     66        void *data;
     67        /** Size of @c data in bytes */
     68        size_t size;
     69} iplink_sdu6_t;
     70
     71/** Internet link receive Service Data Unit */
     72typedef struct {
     73        /** Serialized datagram */
     74        void *data;
     75        /** Size of @c data in bytes */
     76        size_t size;
     77} iplink_recv_sdu_t;
     78
    6479typedef struct iplink_ev_ops {
    65         int (*recv)(iplink_t *, iplink_sdu_t *);
     80        int (*recv)(iplink_t *, iplink_recv_sdu_t *, uint16_t);
    6681} iplink_ev_ops_t;
    6782
     
    6984extern void iplink_close(iplink_t *);
    7085extern int iplink_send(iplink_t *, iplink_sdu_t *);
    71 extern int iplink_addr_add(iplink_t *, iplink_addr_t *);
    72 extern int iplink_addr_remove(iplink_t *, iplink_addr_t *);
     86extern int iplink_send6(iplink_t *, iplink_sdu6_t *);
     87extern int iplink_addr_add(iplink_t *, inet_addr_t *);
     88extern int iplink_addr_remove(iplink_t *, inet_addr_t *);
    7389extern int iplink_get_mtu(iplink_t *, size_t *);
     90extern int iplink_get_mac48(iplink_t *, addr48_t *);
    7491
    7592#endif
  • uspace/lib/c/include/inet/iplink_srv.h

    r283ea3d re3bc355  
    3838#include <async.h>
    3939#include <fibril_synch.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141#include <sys/types.h>
     42#include <inet/addr.h>
     43#include <inet/iplink.h>
    4244
    4345struct iplink_ops;
     
    5153} iplink_srv_t;
    5254
    53 typedef struct {
    54         uint32_t ipv4;
    55 } iplink_srv_addr_t;
    56 
    57 /** IP link Service Data Unit */
    58 typedef struct {
    59         /** Local source address */
    60         iplink_srv_addr_t lsrc;
    61         /** Local destination address */
    62         iplink_srv_addr_t ldest;
    63         /** Serialized IP packet */
    64         void *data;
    65         /** Size of @c data in bytes */
    66         size_t size;
    67 } iplink_srv_sdu_t;
    68 
    6955typedef struct iplink_ops {
    7056        int (*open)(iplink_srv_t *);
    7157        int (*close)(iplink_srv_t *);
    72         int (*send)(iplink_srv_t *, iplink_srv_sdu_t *);
     58        int (*send)(iplink_srv_t *, iplink_sdu_t *);
     59        int (*send6)(iplink_srv_t *, iplink_sdu6_t *);
    7360        int (*get_mtu)(iplink_srv_t *, size_t *);
    74         int (*addr_add)(iplink_srv_t *, iplink_srv_addr_t *);
    75         int (*addr_remove)(iplink_srv_t *, iplink_srv_addr_t *);
     61        int (*get_mac48)(iplink_srv_t *, addr48_t *);
     62        int (*addr_add)(iplink_srv_t *, inet_addr_t *);
     63        int (*addr_remove)(iplink_srv_t *, inet_addr_t *);
    7664} iplink_ops_t;
    7765
     
    7967
    8068extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *);
    81 extern int iplink_ev_recv(iplink_srv_t *, iplink_srv_sdu_t *);
     69extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, uint16_t);
    8270
    8371#endif
  • uspace/lib/c/include/io/charfield.h

    r283ea3d re3bc355  
    3838
    3939#include <sys/types.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141#include <io/color.h>
    4242#include <io/style.h>
  • uspace/lib/c/include/io/con_srv.h

    r283ea3d re3bc355  
    4141#include <io/color.h>
    4242#include <io/concaps.h>
    43 #include <io/kbd_event.h>
     43#include <io/cons_event.h>
    4444#include <io/pixel.h>
    4545#include <io/style.h>
    46 #include <bool.h>
     46#include <stdbool.h>
    4747#include <sys/time.h>
    4848#include <sys/types.h>
     
    6666} con_srv_t;
    6767
    68 typedef struct con_ops {
     68struct con_ops {
    6969        int (*open)(con_srvs_t *, con_srv_t *);
    7070        int (*close)(con_srv_t *);
     
    8282        void (*set_rgb_color)(con_srv_t *, pixel_t, pixel_t);
    8383        void (*set_cursor_visibility)(con_srv_t *, bool);
    84         int (*get_event)(con_srv_t *, kbd_event_t *);
    85 } con_ops_t;
     84        int (*get_event)(con_srv_t *, cons_event_t *);
     85};
    8686
    8787extern void con_srvs_init(con_srvs_t *);
  • uspace/lib/c/include/io/console.h

    r283ea3d re3bc355  
    3939#include <io/concaps.h>
    4040#include <io/kbd_event.h>
     41#include <io/cons_event.h>
    4142#include <io/keycode.h>
    4243#include <async.h>
    43 #include <bool.h>
     44#include <stdbool.h>
    4445#include <stdio.h>
    4546
     
    8283extern void console_cursor_visibility(console_ctrl_t *, bool);
    8384extern int console_get_color_cap(console_ctrl_t *, sysarg_t *);
    84 extern bool console_get_kbd_event(console_ctrl_t *, kbd_event_t *);
    85 extern bool console_get_kbd_event_timeout(console_ctrl_t *, kbd_event_t *,
     85extern bool console_get_event(console_ctrl_t *, cons_event_t *);
     86extern bool console_get_event_timeout(console_ctrl_t *, cons_event_t *,
    8687    suseconds_t *);
    8788
  • uspace/lib/c/include/io/klog.h

    r283ea3d re3bc355  
    4242extern size_t klog_write(const void *, size_t);
    4343extern void klog_update(void);
     44extern void klog_command(const void *, size_t);
    4445extern int klog_printf(const char *, ...)
    4546    PRINTF_ATTRIBUTE(1, 2);
  • uspace/lib/c/include/io/pixel.h

    r283ea3d re3bc355  
    4242        ((channel) >> (8 - (bits)))
    4343
     44#define INVERT(pixel) ((pixel) ^ 0x00ffffff)
     45
    4446#define ALPHA(pixel)  ((pixel) >> 24)
    4547#define RED(pixel)    (((pixel) & 0x00ff0000) >> 16)
  • uspace/lib/c/include/io/pixelmap.h

    r283ea3d re3bc355  
    5252    sysarg_t y)
    5353{
    54         size_t offset = y * pixelmap->width + x;
    55         pixel_t *pixel = pixelmap->data + offset;
    56         return pixel;
     54        if (x < pixelmap->width && y < pixelmap->height) {
     55                size_t offset = y * pixelmap->width + x;
     56                pixel_t *pixel = pixelmap->data + offset;
     57                return pixel;
     58        } else {
     59                return NULL;
     60        }
    5761}
    5862
  • uspace/lib/c/include/io/verify.h

    r283ea3d re3bc355  
    3838#ifndef NVERIFY_PRINTF
    3939
     40#ifdef __clang__
     41#define PRINTF_ATTRIBUTE(start, end) \
     42        __attribute__((format(__printf__, start, end)))
     43#else
    4044#define PRINTF_ATTRIBUTE(start, end) \
    4145        __attribute__((format(gnu_printf, start, end)))
     46#endif
    4247
    4348#else /* NVERIFY_PRINTF */
  • uspace/lib/c/include/io/window.h

    r283ea3d re3bc355  
    3636#define LIBC_IO_WINDOW_H_
    3737
    38 #include <bool.h>
     38#include <stdbool.h>
    3939#include <sys/types.h>
    4040#include <async.h>
    4141#include <loc.h>
    42 #include <io/console.h>
    43 
    44 typedef enum {
    45         POS_UPDATE,
    46         POS_PRESS,
    47         POS_RELEASE
    48 } pos_event_type_t;
    49 
    50 typedef struct {
    51         sysarg_t pos_id;
    52         pos_event_type_t type;
    53         sysarg_t btn_num;
    54         sysarg_t hpos;
    55         sysarg_t vpos;
    56 } pos_event_t;
     42#include <io/kbd_event.h>
     43#include <io/pos_event.h>
    5744
    5845typedef struct {
     
    7158        ET_POSITION_EVENT,
    7259        ET_SIGNAL_EVENT,
     60        ET_WINDOW_FOCUS,
     61        ET_WINDOW_UNFOCUS,
    7362        ET_WINDOW_RESIZE,
    7463        ET_WINDOW_REFRESH,
     
    10089} window_grab_flags_t;
    10190
    102 extern int win_register(async_sess_t *, service_id_t *, service_id_t *);
     91extern int win_register(async_sess_t *, service_id_t *, service_id_t *, sysarg_t, sysarg_t);
    10392
    10493extern int win_get_event(async_sess_t *, window_event_t *);
  • uspace/lib/c/include/ipc/inet.h

    r283ea3d re3bc355  
    4545        INET_PORT_CFG,
    4646        /** Ping service port */
    47         INET_PORT_PING
     47        INET_PORT_PING,
     48        /** Ping6 service port */
     49        INET_PORT_PING6
    4850} inet_port_t;
    4951
     
    8890} inetping_request_t;
    8991
     92/** Events on Inet ping6 port */
     93typedef enum {
     94        INETPING6_EV_RECV = IPC_FIRST_USER_METHOD
     95} inetping6_event_t;
     96
     97/** Requests on Inet ping6 port */
     98typedef enum {
     99        INETPING6_SEND = IPC_FIRST_USER_METHOD,
     100        INETPING6_GET_SRCADDR
     101} inetping6_request_t;
     102
    90103#endif
    91104
  • uspace/lib/c/include/ipc/iplink.h

    r283ea3d re3bc355  
    4040typedef enum {
    4141        IPLINK_GET_MTU = IPC_FIRST_USER_METHOD,
     42        IPLINK_GET_MAC48,
    4243        IPLINK_SEND,
     44        IPLINK_SEND6,
    4345        IPLINK_ADDR_ADD,
    4446        IPLINK_ADDR_REMOVE
  • uspace/lib/c/include/ipc/services.h

    r283ea3d re3bc355  
    5353} services_t;
    5454
    55 #define SERVICE_NAME_INET     "net/inet"
    56 #define SERVICE_NAME_INETCFG  "net/inetcfg"
    57 #define SERVICE_NAME_INETPING "net/inetping"
     55#define SERVICE_NAME_DNSR       "net/dnsr"
     56#define SERVICE_NAME_INET       "net/inet"
     57#define SERVICE_NAME_INETCFG    "net/inetcfg"
     58#define SERVICE_NAME_INETPING   "net/inetping"
     59#define SERVICE_NAME_INETPING6  "net/inetping6"
    5860
    5961#endif
  • uspace/lib/c/include/ipc/vfs.h

    r283ea3d re3bc355  
    3838#include <ipc/common.h>
    3939#include <sys/types.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242#define FS_NAME_MAXLEN  20
  • uspace/lib/c/include/loc.h

    r283ea3d re3bc355  
    3838#include <ipc/loc.h>
    3939#include <async.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242typedef void (*loc_cat_change_cb_t)(void);
  • uspace/lib/c/include/macros.h

    r283ea3d re3bc355  
    3838#define min(a, b)  ((a) < (b) ? (a) : (b))
    3939#define max(a, b)  ((a) > (b) ? (a) : (b))
    40 #define abs(a)     ((a) >= 0 ? (a) : (-a))
     40#define abs(a)     ((a) >= 0 ? (a) : -(a))
    4141
    4242
     
    6262#endif
    6363
     64#define _paddname(line) PADD_ ## line ## __
     65#define _padd(width, line) uint ## width ## _t _paddname(line)
     66#define PADD32 _padd(32, __LINE__)
     67#define PADD16 _padd(16, __LINE__)
     68#define PADD8 _padd(8, __LINE__)
     69
    6470/** @}
    6571 */
  • uspace/lib/c/include/mem.h

    r283ea3d re3bc355  
    3737
    3838#include <sys/types.h>
     39#include <cc.h>
    3940
    40 #define bzero(ptr, len)  memset((ptr), 0, (len))
    41 
    42 extern void *memset(void *, int, size_t);
    43 extern void *memcpy(void *, const void *, size_t);
     41extern void *memset(void *, int, size_t)
     42    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
     43extern void *memcpy(void *, const void *, size_t)
     44    ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns");
    4445extern void *memmove(void *, const void *, size_t);
    45 
    46 extern int bcmp(const void *, const void *, size_t);
     46extern int memcmp(const void *, const void *, size_t);
    4747
    4848#endif
  • uspace/lib/c/include/net/in.h

    r283ea3d re3bc355  
    4545#define INET_ADDRSTRLEN  (4 * 3 + 3 + 1)
    4646
    47 #define INADDR_ANY 0
    48 
    49 /** Type definition of the INET address.
    50  * @see in_addr
    51  */
    52 typedef struct in_addr in_addr_t;
    53 
    54 /** Type definition of the INET socket address.
    55  * @see sockaddr_in
    56  */
    57 typedef struct sockaddr_in      sockaddr_in_t;
     47#define INADDR_ANY  0
    5848
    5949/** INET address. */
    60 struct in_addr {
     50typedef struct in_addr {
    6151        /** 4 byte IP address. */
    6252        uint32_t s_addr;
    63 };
     53} in_addr_t;
    6454
    6555/** INET socket address.
    6656 * @see sockaddr
    6757 */
    68 struct sockaddr_in {
     58typedef struct sockaddr_in {
    6959        /** Address family. Should be AF_INET. */
    7060        uint16_t sin_family;
     
    7262        uint16_t sin_port;
    7363        /** Internet address. */
    74         struct in_addr sin_addr;
     64        in_addr_t sin_addr;
    7565        /** Padding to meet the sockaddr size. */
    7666        uint8_t sin_zero[8];
    77 };
     67} sockaddr_in_t;
    7868
    7969#endif
  • uspace/lib/c/include/net/in6.h

    r283ea3d re3bc355  
    4343
    4444/** INET6 string address maximum length. */
    45 #define INET6_ADDRSTRLEN        (8 * 4 + 7 + 1)
    46 
    47 /** Type definition of the INET6 address.
    48  * @see in6_addr
    49  */
    50 typedef struct in6_addr in6_addr_t;
    51 
    52 /** Type definition of the INET6 socket address.
    53  * @see sockaddr_in6
    54  */
    55 typedef struct sockaddr_in6     sockaddr_in6_t;
     45#define INET6_ADDRSTRLEN  (8 * 4 + 7 + 1)
    5646
    5747/** INET6 address. */
    58 struct in6_addr {
     48typedef struct in6_addr {
    5949        /** 16 byte IPv6 address. */
    60         unsigned char s6_addr[16];
    61 };
     50        uint8_t s6_addr[16];
     51} in6_addr_t;
    6252
    6353/** INET6 socket address.
    6454 * @see sockaddr
    6555 */
    66 struct sockaddr_in6 {
     56typedef struct sockaddr_in6 {
    6757        /** Address family. Should be AF_INET6. */
    6858        uint16_t sin6_family;
     
    7565        /** Scope identifier. */
    7666        uint32_t sin6_scope_id;
    77 };
     67} sockaddr_in6_t;
     68
     69extern const in6_addr_t in6addr_any;
    7870
    7971#endif
  • uspace/lib/c/include/net/inet.h

    r283ea3d re3bc355  
    4141#include <byteorder.h>
    4242
    43 /** Type definition of the socket address.
    44  * @see sockaddr
    45  */
    46 typedef struct sockaddr         sockaddr_t;
    47 
    4843/** Type definition of the address information.
    4944 * @see addrinfo
    5045 */
    51 typedef struct addrinfo         addrinfo_t;
     46typedef struct addrinfo addrinfo_t;
    5247
    5348/** Socket address. */
    54 struct sockaddr {
     49typedef struct sockaddr {
    5550        /** Address family. @see socket.h */
    5651        uint16_t sa_family;
    5752        /** 14 byte protocol address. */
    5853        uint8_t sa_data[14];
    59 };
     54} sockaddr_t;
    6055
    6156extern int inet_ntop(uint16_t, const uint8_t *, char *, size_t);
  • uspace/lib/c/include/net/ip_protocols.h

    r283ea3d re3bc355  
    4444/*@{*/
    4545
    46 #define IPPROTO_ICMP    1
    47 #define IPPROTO_TCP     6
    48 #define IPPROTO_UDP     17
     46#define IPPROTO_ICMP    1
     47#define IPPROTO_TCP     6
     48#define IPPROTO_UDP     17
     49#define IPPROTO_ICMPV6  58
    4950
    5051/*@}*/
  • uspace/lib/c/include/net/socket_codes.h

    r283ea3d re3bc355  
    4545
    4646enum {
    47         AF_UNKNOWN = 0,
    48         AF_INET,        /* IPv4 address */
    49         AF_INET6        /* IPv6 address */
     47        AF_NONE = 0,
     48        AF_INET,  /* IPv4 address */
     49        AF_INET6  /* IPv6 address */
    5050};
    5151
     
    5353
    5454/** @name Protocol families definitions
    55  *  Same as address families.
     55 * Same as address families.
    5656 */
    5757/*@{*/
    5858
    59 #define PF_INET         AF_INET
    60 #define PF_INET6        AF_INET6
     59#define PF_INET   AF_INET
     60#define PF_INET6  AF_INET6
    6161
    6262/*@}*/
  • uspace/lib/c/include/nic/nic.h

    r283ea3d re3bc355  
    4040
    4141#include <nic/eth_phys.h>
    42 #include <bool.h>
     42#include <stdbool.h>
    4343
    4444/** Ethernet address length. */
  • uspace/lib/c/include/rtld/dynamic.h

    r283ea3d re3bc355  
    3636#define LIBC_RTLD_DYNAMIC_H_
    3737
    38 #include <bool.h>
     38#include <stdbool.h>
    3939#include <rtld/elf_dyn.h>
    4040#include <libarch/rtld/dynamic.h>
  • uspace/lib/c/include/setjmp.h

    r283ea3d re3bc355  
    3838#include <libarch/fibril.h>
    3939
    40 typedef context_t jmp_buf;
     40typedef context_t jmp_buf[1];
    4141
    4242extern int setjmp(jmp_buf env);
     
    4747/** @}
    4848 */
    49 
  • uspace/lib/c/include/sort.h

    r283ea3d re3bc355  
    3737
    3838#include <sys/types.h>
    39 #include <bool.h>
     39#include <stdbool.h>
    4040
    4141typedef int (* sort_cmp_t)(void *, void *, void *);
  • uspace/lib/c/include/stack.h

    r283ea3d re3bc355  
    11/*
    2  * Copyright (c) 2006 Martin Decky
     2 * Copyright (c) 2012 Jakub Jermar
    33 * All rights reserved.
    44 *
     
    3333 */
    3434
    35 #ifndef LIBC_BOOL_H_
    36 #define LIBC_BOOL_H_
     35#ifndef LIBC_STACK_H_
     36#define LIBC_STACK_H_
    3737
    3838#include <libarch/types.h>
    39 #include <abi/bool.h>
    4039
    41 #define false  0
    42 #define true   1
     40extern size_t stack_size_get(void);
    4341
    4442#endif
  • uspace/lib/c/include/stacktrace.h

    r283ea3d re3bc355  
    3838
    3939#include <sys/types.h>
    40 #include <bool.h>
     40#include <stdbool.h>
    4141
    4242typedef struct {
  • uspace/lib/c/include/stats.h

    r283ea3d re3bc355  
    3939#include <thread.h>
    4040#include <stdint.h>
    41 #include <bool.h>
     41#include <stdbool.h>
    4242#include <sys/types.h>
    4343#include <abi/sysinfo.h>
  • uspace/lib/c/include/stdbool.h

    r283ea3d re3bc355  
    11/*
    2  * Copyright (c) 2011 Jiri Zarevucky
     2 * Copyright (c) 2006 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup libposix
     29/** @addtogroup libc
    3030 * @{
    3131 */
    32 /** @file Boolean type and values.
     32/** @file
    3333 */
    3434
    35 #ifndef POSIX_STDBOOL_H_
    36 #define POSIX_STDBOOL_H_
     35#ifndef LIBC_BOOL_H_
     36#define LIBC_BOOL_H_
    3737
    38 #ifdef LIBC_BOOL_H_
     38#include <libarch/types.h>
     39#include <abi/bool.h>
    3940
    40 #if (!defined(POSIX_STDIO_H_)) && \
    41     (!defined(POSIX_STDLIB_H_)) && \
    42     (!defined(POSIX_STRING_H_))
    43         #error "You can't include bool.h and stdbool.h at the same time."
     41#define false  0
     42#define true   1
     43
     44#define __bool_true_false_are_defined 1
     45
    4446#endif
    4547
    46 #endif /* LIBC_BOOL_H */
    47 
    48 #define LIBC_BOOL_H_
    49 
    50 #define bool _Bool
    51 #define true 1
    52 #define false 0
    53 #define __bool_true_false_are_defined 1
    54 
    55 #endif /* POSIX_STDBOOL_H_ */
     48/** @}
     49 */
  • uspace/lib/c/include/stdio.h

    r283ea3d re3bc355  
    4040#include <str.h>
    4141#include <io/verify.h>
     42#include <abi/klog.h>
    4243
    4344#define EOF  (-1)
     
    5152                int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \
    5253                if (_n > 0) \
    53                         (void) __SYSCALL3(SYS_KLOG, 1, (sysarg_t) _buf, str_size(_buf)); \
     54                        (void) __SYSCALL3(SYS_KLOG, KLOG_WRITE, (sysarg_t) _buf, str_size(_buf)); \
    5455        }
    5556
     
    142143
    143144extern void setvbuf(FILE *, void *, int, size_t);
     145extern void setbuf(FILE *, void *);
    144146
    145147/* Misc file functions */
  • uspace/lib/c/include/str.h

    r283ea3d re3bc355  
    3939#include <mem.h>
    4040#include <sys/types.h>
    41 #include <bool.h>
     41#include <stdbool.h>
    4242
    4343#define U_SPECIAL  '?'
     
    109109extern char *str_ndup(const char *, size_t max_size);
    110110
    111 extern int str_uint8_t(const char *, char **, unsigned int, bool, uint8_t *);
    112 extern int str_uint16_t(const char *, char **, unsigned int, bool, uint16_t *);
    113 extern int str_uint32_t(const char *, char **, unsigned int, bool, uint32_t *);
    114 extern int str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *);
    115 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *);
     111extern int str_uint8_t(const char *, const char **, unsigned int, bool,
     112    uint8_t *);
     113extern int str_uint16_t(const char *, const char **, unsigned int, bool,
     114    uint16_t *);
     115extern int str_uint32_t(const char *, const char **, unsigned int, bool,
     116    uint32_t *);
     117extern int str_uint64_t(const char *, const char **, unsigned int, bool,
     118    uint64_t *);
     119extern int str_size_t(const char *, const char **, unsigned int, bool,
     120    size_t *);
    116121
    117122extern void order_suffix(const uint64_t, uint64_t *, char *);
  • uspace/lib/c/include/sys/stat.h

    r283ea3d re3bc355  
    3737
    3838#include <sys/types.h>
    39 #include <bool.h>
     39#include <stdbool.h>
    4040#include <ipc/vfs.h>
    4141#include <ipc/loc.h>
  • uspace/lib/c/include/sys/types.h

    r283ea3d re3bc355  
    5050typedef volatile uint32_t ioport32_t;
    5151
     52typedef int16_t unaligned_int16_t __attribute__ ((aligned(1)));
     53typedef int32_t unaligned_int32_t __attribute__ ((aligned(1)));
     54typedef int64_t unaligned_int64_t __attribute__ ((aligned(1)));
     55
     56typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1)));
     57typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1)));
     58typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1)));
     59
    5260#endif
    5361
  • uspace/lib/c/include/sysinfo.h

    r283ea3d re3bc355  
    3737
    3838#include <sys/types.h>
    39 #include <bool.h>
     39#include <stdbool.h>
    4040#include <abi/sysinfo.h>
    4141
  • uspace/lib/c/include/tls.h

    r283ea3d re3bc355  
    4848extern char _tbss_end;
    4949
    50 extern tcb_t *__make_tls(void);
    51 extern tcb_t *__alloc_tls(void **, size_t);
    52 extern void __free_tls(tcb_t *);
    53 extern void __free_tls_arch(tcb_t *, size_t);
     50extern tcb_t *tls_make(void);
     51extern tcb_t *tls_alloc_arch(void **, size_t);
     52extern void tls_free(tcb_t *);
     53extern void tls_free_arch(tcb_t *, size_t);
    5454
    5555#ifdef CONFIG_TLS_VARIANT_1
Note: See TracChangeset for help on using the changeset viewer.