Changeset e3bc355 in mainline for uspace/lib/c/include
- Timestamp:
- 2013-07-28T23:07:18Z (12 years ago)
- 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. - Location:
- uspace/lib/c/include
- Files:
-
- 7 added
- 50 edited
- 2 moved
-
adt/hash_table.h (modified) (1 diff)
-
async.h (modified) (2 diffs)
-
atomicdflt.h (modified) (1 diff)
-
bd_srv.h (modified) (3 diffs)
-
bitops.h (modified) (1 diff)
-
cc.h (added)
-
cfg.h (modified) (1 diff)
-
ddi.h (modified) (2 diffs)
-
device/hw_res.h (modified) (1 diff)
-
device/hw_res_parsed.h (modified) (2 diffs)
-
devman.h (modified) (1 diff)
-
fibril.h (modified) (1 diff)
-
fibril_synch.h (modified) (1 diff)
-
ieee_double.h (modified) (1 diff)
-
inet/addr.h (added)
-
inet/dnsr.h (added)
-
inet/inet.h (modified) (1 diff)
-
inet/inetcfg.h (modified) (1 diff)
-
inet/inetping.h (modified) (2 diffs)
-
inet/inetping6.h (added)
-
inet/iplink.h (modified) (4 diffs)
-
inet/iplink_srv.h (modified) (3 diffs)
-
io/charfield.h (modified) (1 diff)
-
io/con_srv.h (modified) (3 diffs)
-
io/cons_event.h (added)
-
io/console.h (modified) (2 diffs)
-
io/klog.h (modified) (1 diff)
-
io/pixel.h (modified) (1 diff)
-
io/pixelmap.h (modified) (1 diff)
-
io/pos_event.h (added)
-
io/verify.h (modified) (1 diff)
-
io/window.h (modified) (3 diffs)
-
ipc/dnsr.h (added)
-
ipc/inet.h (modified) (2 diffs)
-
ipc/iplink.h (modified) (1 diff)
-
ipc/services.h (modified) (1 diff)
-
ipc/vfs.h (modified) (1 diff)
-
loc.h (modified) (1 diff)
-
macros.h (modified) (2 diffs)
-
mem.h (modified) (1 diff)
-
net/in.h (modified) (2 diffs)
-
net/in6.h (modified) (2 diffs)
-
net/inet.h (modified) (1 diff)
-
net/ip_protocols.h (modified) (1 diff)
-
net/socket_codes.h (modified) (2 diffs)
-
nic/nic.h (modified) (1 diff)
-
rtld/dynamic.h (modified) (1 diff)
-
setjmp.h (modified) (2 diffs)
-
sort.h (modified) (1 diff)
-
stack.h (moved) (moved from uspace/lib/c/include/bool.h ) (2 diffs)
-
stacktrace.h (modified) (1 diff)
-
stats.h (modified) (1 diff)
-
stdbool.h (moved) (moved from uspace/lib/posix/include/posix/stdbool.h ) (2 diffs)
-
stdio.h (modified) (3 diffs)
-
str.h (modified) (2 diffs)
-
sys/stat.h (modified) (1 diff)
-
sys/types.h (modified) (1 diff)
-
sysinfo.h (modified) (1 diff)
-
tls.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/hash_table.h
r283ea3d re3bc355 40 40 #include <adt/list.h> 41 41 #include <unistd.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 #include <macros.h> 44 44 -
uspace/lib/c/include/async.h
r283ea3d re3bc355 44 44 #include <sys/time.h> 45 45 #include <atomic.h> 46 #include < bool.h>46 #include <stdbool.h> 47 47 #include <task.h> 48 48 … … 156 156 extern void async_set_client_connection(async_client_conn_t); 157 157 extern void async_set_interrupt_received(async_interrupt_handler_t); 158 extern void async_set_interrupt_handler_stack_size(size_t); 158 159 159 160 /* -
uspace/lib/c/include/atomicdflt.h
r283ea3d re3bc355 41 41 42 42 #include <stdint.h> 43 #include < bool.h>43 #include <stdbool.h> 44 44 45 45 typedef struct atomic { -
uspace/lib/c/include/bd_srv.h
r283ea3d re3bc355 39 39 #include <async.h> 40 40 #include <fibril_synch.h> 41 #include < bool.h>41 #include <stdbool.h> 42 42 #include <sys/types.h> 43 43 … … 57 57 } bd_srv_t; 58 58 59 typedefstruct bd_ops {59 struct bd_ops { 60 60 int (*open)(bd_srvs_t *, bd_srv_t *); 61 61 int (*close)(bd_srv_t *); … … 65 65 int (*get_block_size)(bd_srv_t *, size_t *); 66 66 int (*get_num_blocks)(bd_srv_t *, aoff64_t *); 67 } bd_ops_t;67 }; 68 68 69 69 extern void bd_srvs_init(bd_srvs_t *); -
uspace/lib/c/include/bitops.h
r283ea3d re3bc355 107 107 } 108 108 109 extern int __popcountsi2(int); 110 109 111 #endif 110 112 -
uspace/lib/c/include/cfg.h
r283ea3d re3bc355 41 41 #include <adt/list.h> 42 42 #include <sys/types.h> 43 #include < bool.h>43 #include <stdbool.h> 44 44 45 45 /** -
uspace/lib/c/include/ddi.h
r283ea3d re3bc355 36 36 #define LIBC_DDI_H_ 37 37 38 #include <stdbool.h> 38 39 #include <sys/types.h> 40 #include <sys/time.h> 39 41 #include <abi/ddi/irq.h> 40 42 #include <task.h> … … 50 52 extern int dmamem_unmap_anonymous(void *); 51 53 52 extern int iospace_enable(task_id_t, void *, unsigned long);53 54 extern int pio_enable(void *, size_t, void **); 55 56 typedef void (*trace_fnc)(const volatile void *place, uint32_t val, 57 volatile void* base, size_t size, void *data, bool write); 58 59 extern int pio_trace_enable(void *, size_t, trace_fnc, void *); 60 extern void pio_trace_log(const volatile void *, uint32_t val, bool write); 61 extern void pio_trace_disable(void *); 62 63 extern void pio_write_8(ioport8_t *, uint8_t); 64 extern void pio_write_16(ioport16_t *, uint16_t); 65 extern void pio_write_32(ioport32_t *, uint32_t); 66 67 extern uint8_t pio_read_8(const ioport8_t *); 68 extern uint16_t pio_read_16(const ioport16_t *); 69 extern uint32_t pio_read_32(const ioport32_t *); 70 71 static 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 80 static 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 89 static 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 98 static 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 } 102 static 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 } 106 static 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 111 static 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 } 115 static 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 } 119 static 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 } 54 123 55 124 extern int irq_register(int, int, int, irq_code_t *); -
uspace/lib/c/include/device/hw_res.h
r283ea3d re3bc355 38 38 #include <ipc/dev_iface.h> 39 39 #include <async.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 #define DMA_MODE_ON_DEMAND 0 -
uspace/lib/c/include/device/hw_res_parsed.h
r283ea3d re3bc355 127 127 free(list->dma_channels.channels); 128 128 129 bzero(list, sizeof(hw_res_list_parsed_t));129 memset(list, 0, sizeof(hw_res_list_parsed_t)); 130 130 } 131 131 … … 136 136 static inline void hw_res_list_parsed_init(hw_res_list_parsed_t *list) 137 137 { 138 bzero(list, sizeof(hw_res_list_parsed_t));138 memset(list, 0, sizeof(hw_res_list_parsed_t)); 139 139 } 140 140 -
uspace/lib/c/include/devman.h
r283ea3d re3bc355 40 40 #include <ipc/loc.h> 41 41 #include <async.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 44 44 extern async_exch_t *devman_exchange_begin_blocking(devman_interface_t); -
uspace/lib/c/include/fibril.h
r283ea3d re3bc355 86 86 extern void context_restore(context_t *ctx) __attribute__((noreturn)); 87 87 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) 92 extern fid_t fibril_create_generic(int (*func)(void *), void *arg, size_t); 89 93 extern void fibril_destroy(fid_t fid); 90 94 extern fibril_t *fibril_setup(void); -
uspace/lib/c/include/fibril_synch.h
r283ea3d re3bc355 40 40 #include <libarch/tls.h> 41 41 #include <sys/time.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 44 44 typedef struct { -
uspace/lib/c/include/ieee_double.h
r283ea3d re3bc355 31 31 32 32 #include <stdint.h> 33 #include < bool.h>33 #include <stdbool.h> 34 34 35 35 /** Represents a non-negative floating point number: significand * 2^exponent */ -
uspace/lib/c/include/inet/inet.h
r283ea3d re3bc355 36 36 #define LIBC_INET_INET_H_ 37 37 38 #include <inet/addr.h> 38 39 #include <sys/types.h> 39 40 40 41 #define INET_TTL_MAX 255 41 42 typedef struct {43 uint32_t ipv4;44 } inet_addr_t;45 42 46 43 typedef struct { -
uspace/lib/c/include/inet/inetcfg.h
r283ea3d re3bc355 38 38 #include <inet/inet.h> 39 39 #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;48 40 49 41 /** Address object info */ -
uspace/lib/c/include/inet/inetping.h
r283ea3d re3bc355 40 40 41 41 typedef struct { 42 inet_addr_t src;43 inet_addr_t dest;42 uint32_t src; 43 uint32_t dest; 44 44 uint16_t seq_no; 45 45 void *data; … … 53 53 extern int inetping_init(inetping_ev_ops_t *); 54 54 extern int inetping_send(inetping_sdu_t *); 55 extern int inetping_get_srcaddr(inet_addr_t *, inet_addr_t *); 56 55 extern int inetping_get_srcaddr(uint32_t, uint32_t *); 57 56 58 57 #endif -
uspace/lib/c/include/inet/iplink.h
r283ea3d re3bc355 38 38 #include <async.h> 39 39 #include <sys/types.h> 40 #include <inet/addr.h> 40 41 41 42 struct iplink_ev_ops; … … 46 47 } iplink_t; 47 48 48 typedef struct { 49 uint32_t ipv4; 50 } iplink_addr_t; 51 52 /** IP link Service Data Unit */ 49 /** IPv4 link Service Data Unit */ 53 50 typedef struct { 54 51 /** Local source address */ 55 iplink_addr_t lsrc;52 addr32_t src; 56 53 /** Local destination address */ 57 iplink_addr_t ldest;54 addr32_t dest; 58 55 /** Serialized IP packet */ 59 56 void *data; … … 62 59 } iplink_sdu_t; 63 60 61 /** IPv6 link Service Data Unit */ 62 typedef 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 */ 72 typedef struct { 73 /** Serialized datagram */ 74 void *data; 75 /** Size of @c data in bytes */ 76 size_t size; 77 } iplink_recv_sdu_t; 78 64 79 typedef struct iplink_ev_ops { 65 int (*recv)(iplink_t *, iplink_ sdu_t *);80 int (*recv)(iplink_t *, iplink_recv_sdu_t *, uint16_t); 66 81 } iplink_ev_ops_t; 67 82 … … 69 84 extern void iplink_close(iplink_t *); 70 85 extern 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 *); 86 extern int iplink_send6(iplink_t *, iplink_sdu6_t *); 87 extern int iplink_addr_add(iplink_t *, inet_addr_t *); 88 extern int iplink_addr_remove(iplink_t *, inet_addr_t *); 73 89 extern int iplink_get_mtu(iplink_t *, size_t *); 90 extern int iplink_get_mac48(iplink_t *, addr48_t *); 74 91 75 92 #endif -
uspace/lib/c/include/inet/iplink_srv.h
r283ea3d re3bc355 38 38 #include <async.h> 39 39 #include <fibril_synch.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 #include <sys/types.h> 42 #include <inet/addr.h> 43 #include <inet/iplink.h> 42 44 43 45 struct iplink_ops; … … 51 53 } iplink_srv_t; 52 54 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 69 55 typedef struct iplink_ops { 70 56 int (*open)(iplink_srv_t *); 71 57 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 *); 73 60 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 *); 76 64 } iplink_ops_t; 77 65 … … 79 67 80 68 extern int iplink_conn(ipc_callid_t, ipc_call_t *, void *); 81 extern int iplink_ev_recv(iplink_srv_t *, iplink_ srv_sdu_t *);69 extern int iplink_ev_recv(iplink_srv_t *, iplink_recv_sdu_t *, uint16_t); 82 70 83 71 #endif -
uspace/lib/c/include/io/charfield.h
r283ea3d re3bc355 38 38 39 39 #include <sys/types.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 #include <io/color.h> 42 42 #include <io/style.h> -
uspace/lib/c/include/io/con_srv.h
r283ea3d re3bc355 41 41 #include <io/color.h> 42 42 #include <io/concaps.h> 43 #include <io/ kbd_event.h>43 #include <io/cons_event.h> 44 44 #include <io/pixel.h> 45 45 #include <io/style.h> 46 #include < bool.h>46 #include <stdbool.h> 47 47 #include <sys/time.h> 48 48 #include <sys/types.h> … … 66 66 } con_srv_t; 67 67 68 typedefstruct con_ops {68 struct con_ops { 69 69 int (*open)(con_srvs_t *, con_srv_t *); 70 70 int (*close)(con_srv_t *); … … 82 82 void (*set_rgb_color)(con_srv_t *, pixel_t, pixel_t); 83 83 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 }; 86 86 87 87 extern void con_srvs_init(con_srvs_t *); -
uspace/lib/c/include/io/console.h
r283ea3d re3bc355 39 39 #include <io/concaps.h> 40 40 #include <io/kbd_event.h> 41 #include <io/cons_event.h> 41 42 #include <io/keycode.h> 42 43 #include <async.h> 43 #include < bool.h>44 #include <stdbool.h> 44 45 #include <stdio.h> 45 46 … … 82 83 extern void console_cursor_visibility(console_ctrl_t *, bool); 83 84 extern 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 *,85 extern bool console_get_event(console_ctrl_t *, cons_event_t *); 86 extern bool console_get_event_timeout(console_ctrl_t *, cons_event_t *, 86 87 suseconds_t *); 87 88 -
uspace/lib/c/include/io/klog.h
r283ea3d re3bc355 42 42 extern size_t klog_write(const void *, size_t); 43 43 extern void klog_update(void); 44 extern void klog_command(const void *, size_t); 44 45 extern int klog_printf(const char *, ...) 45 46 PRINTF_ATTRIBUTE(1, 2); -
uspace/lib/c/include/io/pixel.h
r283ea3d re3bc355 42 42 ((channel) >> (8 - (bits))) 43 43 44 #define INVERT(pixel) ((pixel) ^ 0x00ffffff) 45 44 46 #define ALPHA(pixel) ((pixel) >> 24) 45 47 #define RED(pixel) (((pixel) & 0x00ff0000) >> 16) -
uspace/lib/c/include/io/pixelmap.h
r283ea3d re3bc355 52 52 sysarg_t y) 53 53 { 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 } 57 61 } 58 62 -
uspace/lib/c/include/io/verify.h
r283ea3d re3bc355 38 38 #ifndef NVERIFY_PRINTF 39 39 40 #ifdef __clang__ 41 #define PRINTF_ATTRIBUTE(start, end) \ 42 __attribute__((format(__printf__, start, end))) 43 #else 40 44 #define PRINTF_ATTRIBUTE(start, end) \ 41 45 __attribute__((format(gnu_printf, start, end))) 46 #endif 42 47 43 48 #else /* NVERIFY_PRINTF */ -
uspace/lib/c/include/io/window.h
r283ea3d re3bc355 36 36 #define LIBC_IO_WINDOW_H_ 37 37 38 #include < bool.h>38 #include <stdbool.h> 39 39 #include <sys/types.h> 40 40 #include <async.h> 41 41 #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> 57 44 58 45 typedef struct { … … 71 58 ET_POSITION_EVENT, 72 59 ET_SIGNAL_EVENT, 60 ET_WINDOW_FOCUS, 61 ET_WINDOW_UNFOCUS, 73 62 ET_WINDOW_RESIZE, 74 63 ET_WINDOW_REFRESH, … … 100 89 } window_grab_flags_t; 101 90 102 extern int win_register(async_sess_t *, service_id_t *, service_id_t * );91 extern int win_register(async_sess_t *, service_id_t *, service_id_t *, sysarg_t, sysarg_t); 103 92 104 93 extern int win_get_event(async_sess_t *, window_event_t *); -
uspace/lib/c/include/ipc/inet.h
r283ea3d re3bc355 45 45 INET_PORT_CFG, 46 46 /** Ping service port */ 47 INET_PORT_PING 47 INET_PORT_PING, 48 /** Ping6 service port */ 49 INET_PORT_PING6 48 50 } inet_port_t; 49 51 … … 88 90 } inetping_request_t; 89 91 92 /** Events on Inet ping6 port */ 93 typedef enum { 94 INETPING6_EV_RECV = IPC_FIRST_USER_METHOD 95 } inetping6_event_t; 96 97 /** Requests on Inet ping6 port */ 98 typedef enum { 99 INETPING6_SEND = IPC_FIRST_USER_METHOD, 100 INETPING6_GET_SRCADDR 101 } inetping6_request_t; 102 90 103 #endif 91 104 -
uspace/lib/c/include/ipc/iplink.h
r283ea3d re3bc355 40 40 typedef enum { 41 41 IPLINK_GET_MTU = IPC_FIRST_USER_METHOD, 42 IPLINK_GET_MAC48, 42 43 IPLINK_SEND, 44 IPLINK_SEND6, 43 45 IPLINK_ADDR_ADD, 44 46 IPLINK_ADDR_REMOVE -
uspace/lib/c/include/ipc/services.h
r283ea3d re3bc355 53 53 } services_t; 54 54 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" 58 60 59 61 #endif -
uspace/lib/c/include/ipc/vfs.h
r283ea3d re3bc355 38 38 #include <ipc/common.h> 39 39 #include <sys/types.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 #define FS_NAME_MAXLEN 20 -
uspace/lib/c/include/loc.h
r283ea3d re3bc355 38 38 #include <ipc/loc.h> 39 39 #include <async.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 typedef void (*loc_cat_change_cb_t)(void); -
uspace/lib/c/include/macros.h
r283ea3d re3bc355 38 38 #define min(a, b) ((a) < (b) ? (a) : (b)) 39 39 #define max(a, b) ((a) > (b) ? (a) : (b)) 40 #define abs(a) ((a) >= 0 ? (a) : (-a))40 #define abs(a) ((a) >= 0 ? (a) : -(a)) 41 41 42 42 … … 62 62 #endif 63 63 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 64 70 /** @} 65 71 */ -
uspace/lib/c/include/mem.h
r283ea3d re3bc355 37 37 38 38 #include <sys/types.h> 39 #include <cc.h> 39 40 40 #define bzero(ptr, len) memset((ptr), 0, (len))41 42 extern void *mem set(void *, int, size_t);43 extern void *memcpy(void *, const void *, size_t);41 extern void *memset(void *, int, size_t) 42 ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns"); 43 extern void *memcpy(void *, const void *, size_t) 44 ATTRIBUTE_OPTIMIZE("-fno-tree-loop-distribute-patterns"); 44 45 extern void *memmove(void *, const void *, size_t); 45 46 extern int bcmp(const void *, const void *, size_t); 46 extern int memcmp(const void *, const void *, size_t); 47 47 48 48 #endif -
uspace/lib/c/include/net/in.h
r283ea3d re3bc355 45 45 #define INET_ADDRSTRLEN (4 * 3 + 3 + 1) 46 46 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 58 48 59 49 /** INET address. */ 60 struct in_addr {50 typedef struct in_addr { 61 51 /** 4 byte IP address. */ 62 52 uint32_t s_addr; 63 } ;53 } in_addr_t; 64 54 65 55 /** INET socket address. 66 56 * @see sockaddr 67 57 */ 68 struct sockaddr_in {58 typedef struct sockaddr_in { 69 59 /** Address family. Should be AF_INET. */ 70 60 uint16_t sin_family; … … 72 62 uint16_t sin_port; 73 63 /** Internet address. */ 74 struct in_addrsin_addr;64 in_addr_t sin_addr; 75 65 /** Padding to meet the sockaddr size. */ 76 66 uint8_t sin_zero[8]; 77 } ;67 } sockaddr_in_t; 78 68 79 69 #endif -
uspace/lib/c/include/net/in6.h
r283ea3d re3bc355 43 43 44 44 /** 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) 56 46 57 47 /** INET6 address. */ 58 struct in6_addr {48 typedef struct in6_addr { 59 49 /** 16 byte IPv6 address. */ 60 u nsigned chars6_addr[16];61 } ;50 uint8_t s6_addr[16]; 51 } in6_addr_t; 62 52 63 53 /** INET6 socket address. 64 54 * @see sockaddr 65 55 */ 66 struct sockaddr_in6 {56 typedef struct sockaddr_in6 { 67 57 /** Address family. Should be AF_INET6. */ 68 58 uint16_t sin6_family; … … 75 65 /** Scope identifier. */ 76 66 uint32_t sin6_scope_id; 77 }; 67 } sockaddr_in6_t; 68 69 extern const in6_addr_t in6addr_any; 78 70 79 71 #endif -
uspace/lib/c/include/net/inet.h
r283ea3d re3bc355 41 41 #include <byteorder.h> 42 42 43 /** Type definition of the socket address.44 * @see sockaddr45 */46 typedef struct sockaddr sockaddr_t;47 48 43 /** Type definition of the address information. 49 44 * @see addrinfo 50 45 */ 51 typedef struct addrinfo addrinfo_t;46 typedef struct addrinfo addrinfo_t; 52 47 53 48 /** Socket address. */ 54 struct sockaddr {49 typedef struct sockaddr { 55 50 /** Address family. @see socket.h */ 56 51 uint16_t sa_family; 57 52 /** 14 byte protocol address. */ 58 53 uint8_t sa_data[14]; 59 } ;54 } sockaddr_t; 60 55 61 56 extern int inet_ntop(uint16_t, const uint8_t *, char *, size_t); -
uspace/lib/c/include/net/ip_protocols.h
r283ea3d re3bc355 44 44 /*@{*/ 45 45 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 49 50 50 51 /*@}*/ -
uspace/lib/c/include/net/socket_codes.h
r283ea3d re3bc355 45 45 46 46 enum { 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 */ 50 50 }; 51 51 … … 53 53 54 54 /** @name Protocol families definitions 55 * Same as address families.55 * Same as address families. 56 56 */ 57 57 /*@{*/ 58 58 59 #define PF_INET AF_INET60 #define PF_INET6 AF_INET659 #define PF_INET AF_INET 60 #define PF_INET6 AF_INET6 61 61 62 62 /*@}*/ -
uspace/lib/c/include/nic/nic.h
r283ea3d re3bc355 40 40 41 41 #include <nic/eth_phys.h> 42 #include < bool.h>42 #include <stdbool.h> 43 43 44 44 /** Ethernet address length. */ -
uspace/lib/c/include/rtld/dynamic.h
r283ea3d re3bc355 36 36 #define LIBC_RTLD_DYNAMIC_H_ 37 37 38 #include < bool.h>38 #include <stdbool.h> 39 39 #include <rtld/elf_dyn.h> 40 40 #include <libarch/rtld/dynamic.h> -
uspace/lib/c/include/setjmp.h
r283ea3d re3bc355 38 38 #include <libarch/fibril.h> 39 39 40 typedef context_t jmp_buf ;40 typedef context_t jmp_buf[1]; 41 41 42 42 extern int setjmp(jmp_buf env); … … 47 47 /** @} 48 48 */ 49 -
uspace/lib/c/include/sort.h
r283ea3d re3bc355 37 37 38 38 #include <sys/types.h> 39 #include < bool.h>39 #include <stdbool.h> 40 40 41 41 typedef int (* sort_cmp_t)(void *, void *, void *); -
uspace/lib/c/include/stack.h
r283ea3d re3bc355 1 1 /* 2 * Copyright (c) 20 06 Martin Decky2 * Copyright (c) 2012 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 33 33 */ 34 34 35 #ifndef LIBC_ BOOL_H_36 #define LIBC_ BOOL_H_35 #ifndef LIBC_STACK_H_ 36 #define LIBC_STACK_H_ 37 37 38 38 #include <libarch/types.h> 39 #include <abi/bool.h>40 39 41 #define false 0 42 #define true 1 40 extern size_t stack_size_get(void); 43 41 44 42 #endif -
uspace/lib/c/include/stacktrace.h
r283ea3d re3bc355 38 38 39 39 #include <sys/types.h> 40 #include < bool.h>40 #include <stdbool.h> 41 41 42 42 typedef struct { -
uspace/lib/c/include/stats.h
r283ea3d re3bc355 39 39 #include <thread.h> 40 40 #include <stdint.h> 41 #include < bool.h>41 #include <stdbool.h> 42 42 #include <sys/types.h> 43 43 #include <abi/sysinfo.h> -
uspace/lib/c/include/stdbool.h
r283ea3d re3bc355 1 1 /* 2 * Copyright (c) 20 11 Jiri Zarevucky2 * Copyright (c) 2006 Martin Decky 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup lib posix29 /** @addtogroup libc 30 30 * @{ 31 31 */ 32 /** @file Boolean type and values.32 /** @file 33 33 */ 34 34 35 #ifndef POSIX_STDBOOL_H_36 #define POSIX_STDBOOL_H_35 #ifndef LIBC_BOOL_H_ 36 #define LIBC_BOOL_H_ 37 37 38 #ifdef LIBC_BOOL_H_ 38 #include <libarch/types.h> 39 #include <abi/bool.h> 39 40 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 44 46 #endif 45 47 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 40 40 #include <str.h> 41 41 #include <io/verify.h> 42 #include <abi/klog.h> 42 43 43 44 #define EOF (-1) … … 51 52 int _n = snprintf(_buf, sizeof(_buf), fmt, ##__VA_ARGS__); \ 52 53 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)); \ 54 55 } 55 56 … … 142 143 143 144 extern void setvbuf(FILE *, void *, int, size_t); 145 extern void setbuf(FILE *, void *); 144 146 145 147 /* Misc file functions */ -
uspace/lib/c/include/str.h
r283ea3d re3bc355 39 39 #include <mem.h> 40 40 #include <sys/types.h> 41 #include < bool.h>41 #include <stdbool.h> 42 42 43 43 #define U_SPECIAL '?' … … 109 109 extern char *str_ndup(const char *, size_t max_size); 110 110 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 *); 111 extern int str_uint8_t(const char *, const char **, unsigned int, bool, 112 uint8_t *); 113 extern int str_uint16_t(const char *, const char **, unsigned int, bool, 114 uint16_t *); 115 extern int str_uint32_t(const char *, const char **, unsigned int, bool, 116 uint32_t *); 117 extern int str_uint64_t(const char *, const char **, unsigned int, bool, 118 uint64_t *); 119 extern int str_size_t(const char *, const char **, unsigned int, bool, 120 size_t *); 116 121 117 122 extern void order_suffix(const uint64_t, uint64_t *, char *); -
uspace/lib/c/include/sys/stat.h
r283ea3d re3bc355 37 37 38 38 #include <sys/types.h> 39 #include < bool.h>39 #include <stdbool.h> 40 40 #include <ipc/vfs.h> 41 41 #include <ipc/loc.h> -
uspace/lib/c/include/sys/types.h
r283ea3d re3bc355 50 50 typedef volatile uint32_t ioport32_t; 51 51 52 typedef int16_t unaligned_int16_t __attribute__ ((aligned(1))); 53 typedef int32_t unaligned_int32_t __attribute__ ((aligned(1))); 54 typedef int64_t unaligned_int64_t __attribute__ ((aligned(1))); 55 56 typedef uint16_t unaligned_uint16_t __attribute__ ((aligned(1))); 57 typedef uint32_t unaligned_uint32_t __attribute__ ((aligned(1))); 58 typedef uint64_t unaligned_uint64_t __attribute__ ((aligned(1))); 59 52 60 #endif 53 61 -
uspace/lib/c/include/sysinfo.h
r283ea3d re3bc355 37 37 38 38 #include <sys/types.h> 39 #include < bool.h>39 #include <stdbool.h> 40 40 #include <abi/sysinfo.h> 41 41 -
uspace/lib/c/include/tls.h
r283ea3d re3bc355 48 48 extern char _tbss_end; 49 49 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);50 extern tcb_t *tls_make(void); 51 extern tcb_t *tls_alloc_arch(void **, size_t); 52 extern void tls_free(tcb_t *); 53 extern void tls_free_arch(tcb_t *, size_t); 54 54 55 55 #ifdef CONFIG_TLS_VARIANT_1
Note:
See TracChangeset
for help on using the changeset viewer.
