Changeset 5856b627 in mainline for uspace/lib
- Timestamp:
- 2013-08-20T12:36:48Z (12 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 26e2de3
- Parents:
- 0ee999d (diff), 4da8fdb (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
- Files:
-
- 16 added
- 22 edited
-
c/generic/async.c (modified) (2 diffs)
-
c/generic/device/hw_res.c (modified) (3 diffs)
-
c/generic/device/hw_res_parsed.c (modified) (6 diffs)
-
c/generic/inet/addr.c (modified) (2 diffs)
-
c/include/async.h (modified) (2 diffs)
-
c/include/device/hw_res.h (modified) (2 diffs)
-
c/include/device/hw_res_parsed.h (modified) (1 diff)
-
c/include/inet/addr.h (modified) (1 diff)
-
c/include/ipc/dev_iface.h (modified) (1 diff)
-
drv/Makefile (modified) (2 diffs)
-
drv/generic/dev_iface.c (modified) (1 diff)
-
drv/generic/remote_audio_mixer.c (added)
-
drv/generic/remote_audio_pcm.c (added)
-
drv/generic/remote_hw_res.c (modified) (3 diffs)
-
drv/include/audio_mixer_iface.h (added)
-
drv/include/audio_pcm_iface.h (added)
-
drv/include/ops/hw_res.h (modified) (1 diff)
-
drv/include/remote_audio_mixer.h (added)
-
drv/include/remote_audio_pcm.h (added)
-
hound/Makefile (added)
-
hound/include/hound/client.h (added)
-
hound/include/hound/protocol.h (added)
-
hound/include/hound/server.h (added)
-
hound/src/client.c (added)
-
hound/src/protocol.c (added)
-
pcm/Makefile (added)
-
pcm/include/pcm/format.h (added)
-
pcm/include/pcm/sample_format.h (added)
-
pcm/src/format.c (added)
-
posix/include/posix/stdio.h (modified) (1 diff)
-
posix/include/posix/stdlib.h (modified) (2 diffs)
-
posix/include/posix/time.h (modified) (1 diff)
-
posix/include/posix/unistd.h (modified) (2 diffs)
-
posix/source/stdlib.c (modified) (1 diff)
-
posix/source/time.c (modified) (1 diff)
-
posix/source/unistd.c (modified) (1 diff)
-
softfloat/softfloat.c (modified) (3 diffs)
-
softfloat/softfloat.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/async.c
r0ee999d r5856b627 2281 2281 bool async_data_read_receive(ipc_callid_t *callid, size_t *size) 2282 2282 { 2283 ipc_call_t data; 2284 return async_data_read_receive_call(callid, &data, size); 2285 } 2286 2287 /** Wrapper for receiving the IPC_M_DATA_READ calls using the async framework. 2288 * 2289 * This wrapper only makes it more comfortable to receive IPC_M_DATA_READ 2290 * calls so that the user doesn't have to remember the meaning of each IPC 2291 * argument. 2292 * 2293 * So far, this wrapper is to be used from within a connection fibril. 2294 * 2295 * @param callid Storage for the hash of the IPC_M_DATA_READ. 2296 * @param size Storage for the maximum size. Can be NULL. 2297 * 2298 * @return True on success, false on failure. 2299 * 2300 */ 2301 bool async_data_read_receive_call(ipc_callid_t *callid, ipc_call_t *data, 2302 size_t *size) 2303 { 2283 2304 assert(callid); 2284 2285 ipc_call_t data;2286 *callid = async_get_call( &data);2287 2288 if (IPC_GET_IMETHOD( data) != IPC_M_DATA_READ)2305 assert(data); 2306 2307 *callid = async_get_call(data); 2308 2309 if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_READ) 2289 2310 return false; 2290 2311 2291 2312 if (size) 2292 *size = (size_t) IPC_GET_ARG2( data);2313 *size = (size_t) IPC_GET_ARG2(*data); 2293 2314 2294 2315 return true; … … 2385 2406 bool async_data_write_receive(ipc_callid_t *callid, size_t *size) 2386 2407 { 2408 ipc_call_t data; 2409 return async_data_write_receive_call(callid, &data, size); 2410 } 2411 2412 /** Wrapper for receiving the IPC_M_DATA_WRITE calls using the async framework. 2413 * 2414 * This wrapper only makes it more comfortable to receive IPC_M_DATA_WRITE 2415 * calls so that the user doesn't have to remember the meaning of each IPC 2416 * argument. 2417 * 2418 * So far, this wrapper is to be used from within a connection fibril. 2419 * 2420 * @param callid Storage for the hash of the IPC_M_DATA_WRITE. 2421 * @param data Storage for the ipc call data. 2422 * @param size Storage for the suggested size. May be NULL. 2423 * 2424 * @return True on success, false on failure. 2425 * 2426 */ 2427 bool async_data_write_receive_call(ipc_callid_t *callid, ipc_call_t *data, 2428 size_t *size) 2429 { 2387 2430 assert(callid); 2388 2389 ipc_call_t data;2390 *callid = async_get_call( &data);2391 2392 if (IPC_GET_IMETHOD( data) != IPC_M_DATA_WRITE)2431 assert(data); 2432 2433 *callid = async_get_call(data); 2434 2435 if (IPC_GET_IMETHOD(*data) != IPC_M_DATA_WRITE) 2393 2436 return false; 2394 2437 2395 2438 if (size) 2396 *size = (size_t) IPC_GET_ARG2( data);2439 *size = (size_t) IPC_GET_ARG2(*data); 2397 2440 2398 2441 return true; -
uspace/lib/c/generic/device/hw_res.c
r0ee999d r5856b627 42 42 { 43 43 sysarg_t count = 0; 44 44 45 45 async_exch_t *exch = async_exchange_begin(sess); 46 if (exch == NULL) 47 return ENOMEM; 46 48 int rc = async_req_1_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 47 49 HW_RES_GET_RESOURCE_LIST, &count); 48 50 49 51 if (rc != EOK) { 50 52 async_exchange_end(exch); 51 53 return rc; 52 54 } 53 55 54 56 size_t size = count * sizeof(hw_resource_t); 55 57 hw_resource_t *resources = (hw_resource_t *) malloc(size); … … 59 61 return ENOMEM; 60 62 } 61 63 62 64 rc = async_data_read_start(exch, resources, size); 63 65 async_exchange_end(exch); 64 66 65 67 if (rc != EOK) { 66 68 free(resources); 67 69 return rc; 68 70 } 69 71 70 72 hw_resources->resources = resources; 71 73 hw_resources->count = count; 72 74 73 75 return EOK; 74 76 } … … 77 79 { 78 80 async_exch_t *exch = async_exchange_begin(sess); 81 if (exch == NULL) 82 return false; 79 83 int rc = async_req_1_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 80 84 HW_RES_ENABLE_INTERRUPT); 81 85 async_exchange_end(exch); 82 86 83 87 return (rc == EOK); 88 } 89 90 /** 91 * Setup DMA channel to specified place and mode. 92 * @param channel DMA Channel 1,2,3 for 8 bit transfers, 5,6,7 for 16 bit. 93 * @param pa Physical address of the buffer. Must be < 16MB for 16 bit and < 1MB 94 * for 8 bit transfers. 95 * @param size DMA buffer size, limited to 64K. 96 * @param mode Mode of the DMA channel: 97 * - Read or Write 98 * - Allow automatic reset 99 * - Use address decrement instead of increment 100 * - Use SINGLE/BLOCK/ON DEMAND transfer mode 101 * @return Error code. 102 */ 103 int hw_res_dma_channel_setup(async_sess_t *sess, 104 unsigned channel, uint32_t pa, uint32_t size, uint8_t mode) 105 { 106 async_exch_t *exch = async_exchange_begin(sess); 107 if (exch == NULL) 108 return ENOMEM; 109 const uint32_t packed = (channel & 0xffff) | (mode << 16); 110 const int ret = async_req_4_0(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 111 HW_RES_DMA_CHANNEL_SETUP, packed, pa, size); 112 async_exchange_end(exch); 113 114 return ret; 115 } 116 117 /** 118 * Query remaining bytes in the buffer. 119 * @param channel DMA Channel 1,2,3 for 8 bit transfers, 5,6,7 for 16 bit. 120 * @return Number of bytes remaining in the buffer(>=0) or error code(<0). 121 */ 122 int hw_res_dma_channel_remain(async_sess_t *sess, unsigned channel) 123 { 124 async_exch_t *exch = async_exchange_begin(sess); 125 if (exch == NULL) 126 return ENOMEM; 127 sysarg_t remain; 128 const int ret = async_req_2_1(exch, DEV_IFACE_ID(HW_RES_DEV_IFACE), 129 HW_RES_DMA_CHANNEL_REMAIN, channel, &remain); 130 async_exchange_end(exch); 131 if (ret == EOK) 132 return remain; 133 return ret; 84 134 } 85 135 -
uspace/lib/c/generic/device/hw_res_parsed.c
r0ee999d r5856b627 38 38 #include <errno.h> 39 39 40 static void hw_res_parse_add_irq(hw_res_list_parsed_t *out, hw_resource_t *res, 41 int flags) 40 static void hw_res_parse_add_dma_channel(hw_res_list_parsed_t *out, 41 const hw_resource_t *res, int flags) 42 { 43 assert(res); 44 assert((res->type == DMA_CHANNEL_8) || (res->type == DMA_CHANNEL_16)); 45 46 const unsigned channel = (res->type == DMA_CHANNEL_8) ? 47 res->res.dma_channel.dma8 : res->res.dma_channel.dma16; 48 const size_t count = out->dma_channels.count; 49 const int keep_duplicit = flags & HW_RES_KEEP_DUPLICIT; 50 51 if (!keep_duplicit) { 52 for (size_t i = 0; i < count; ++i) { 53 if (out->dma_channels.channels[i] == channel) 54 return; 55 } 56 } 57 58 out->dma_channels.channels[count] = channel; 59 ++out->dma_channels.count; 60 } 61 62 static void hw_res_parse_add_irq(hw_res_list_parsed_t *out, 63 const hw_resource_t *res, int flags) 42 64 { 43 65 assert(res && (res->type == INTERRUPT)); … … 59 81 60 82 static void hw_res_parse_add_io_range(hw_res_list_parsed_t *out, 61 hw_resource_t *res, int flags)83 const hw_resource_t *res, int flags) 62 84 { 63 85 assert(res && (res->type == IO_RANGE)); … … 90 112 91 113 static void hw_res_parse_add_mem_range(hw_res_list_parsed_t *out, 92 hw_resource_t *res, int flags)114 const hw_resource_t *res, int flags) 93 115 { 94 116 assert(res && (res->type == MEM_RANGE)); … … 132 154 * 133 155 */ 134 int hw_res_list_parse( hw_resource_list_t *hw_resources,156 int hw_res_list_parse(const hw_resource_list_t *hw_resources, 135 157 hw_res_list_parsed_t *out, int flags) 136 158 { … … 141 163 hw_res_list_parsed_clean(out); 142 164 143 out->irqs.irqs = malloc(res_count * sizeof(int)); 144 out->io_ranges.ranges = malloc(res_count * sizeof(io_range_t)); 145 out->mem_ranges.ranges = malloc(res_count * sizeof(mem_range_t)); 165 out->irqs.irqs = calloc(res_count, sizeof(int)); 166 out->dma_channels.channels = calloc(res_count, sizeof(int)); 167 out->io_ranges.ranges = calloc(res_count, sizeof(io_range_t)); 168 out->mem_ranges.ranges = calloc(res_count, sizeof(mem_range_t)); 169 if (!out->irqs.irqs || !out->dma_channels.channels || 170 !out->io_ranges.ranges || !out->mem_ranges.ranges) { 171 hw_res_list_parsed_clean(out); 172 return ENOMEM; 173 } 146 174 147 175 for (size_t i = 0; i < res_count; ++i) { 148 hw_resource_t *resource = &(hw_resources->resources[i]);149 176 const hw_resource_t *resource = &(hw_resources->resources[i]); 177 150 178 switch (resource->type) { 151 179 case INTERRUPT: … … 158 186 hw_res_parse_add_mem_range(out, resource, flags); 159 187 break; 188 case DMA_CHANNEL_8: 189 case DMA_CHANNEL_16: 190 hw_res_parse_add_dma_channel(out, resource, flags); 191 break; 160 192 default: 193 hw_res_list_parsed_clean(out); 161 194 return EINVAL; 162 195 } 163 196 } 164 197 165 198 return EOK; 166 199 }; -
uspace/lib/c/generic/inet/addr.c
r0ee999d r5856b627 52 52 }; 53 53 54 static const addr48_t inet_addr48_solicited_node = { 55 0x33, 0x33, 0xff, 0, 0, 0 56 }; 57 54 58 static const inet_addr_t inet_addr_any_addr = { 55 59 .family = AF_INET, … … 72 76 } 73 77 78 int addr48_compare(const addr48_t a, const addr48_t b) 79 { 80 return memcmp(a, b, 6); 81 } 82 74 83 int addr128_compare(const addr128_t a, const addr128_t b) 75 84 { 76 85 return memcmp(a, b, 16); 86 } 87 88 /** Compute solicited node MAC multicast address from target IPv6 address 89 * 90 * @param ip Target IPv6 address 91 * @param mac Solicited MAC address to be assigned 92 * 93 */ 94 void addr48_solicited_node(const addr128_t ip, addr48_t mac) 95 { 96 memcpy(mac, inet_addr48_solicited_node, 3); 97 memcpy(mac + 3, ip + 13, 3); 77 98 } 78 99 -
uspace/lib/c/include/async.h
r0ee999d r5856b627 399 399 extern int async_data_read_start(async_exch_t *, void *, size_t); 400 400 extern bool async_data_read_receive(ipc_callid_t *, size_t *); 401 extern bool async_data_read_receive_call(ipc_callid_t *, ipc_call_t *, size_t *); 401 402 extern int async_data_read_finalize(ipc_callid_t, const void *, size_t); 402 403 … … 437 438 extern int async_data_write_start(async_exch_t *, const void *, size_t); 438 439 extern bool async_data_write_receive(ipc_callid_t *, size_t *); 440 extern bool async_data_write_receive_call(ipc_callid_t *, ipc_call_t *, size_t *); 439 441 extern int async_data_write_finalize(ipc_callid_t, void *, size_t); 440 442 -
uspace/lib/c/include/device/hw_res.h
r0ee999d r5856b627 53 53 HW_RES_ENABLE_INTERRUPT, 54 54 HW_RES_DMA_CHANNEL_SETUP, 55 HW_RES_DMA_CHANNEL_REMAIN, 55 56 } hw_res_method_t; 56 57 … … 115 116 116 117 extern int hw_res_dma_channel_setup(async_sess_t *, unsigned int, uint32_t, 117 uint16_t, uint8_t); 118 uint32_t, uint8_t); 119 extern int hw_res_dma_channel_remain(async_sess_t *, unsigned); 118 120 119 121 #endif -
uspace/lib/c/include/device/hw_res_parsed.h
r0ee999d r5856b627 139 139 } 140 140 141 extern int hw_res_list_parse(hw_resource_list_t *, hw_res_list_parsed_t *, int); 141 extern int hw_res_list_parse( 142 const hw_resource_list_t *, hw_res_list_parsed_t *, int); 142 143 extern int hw_res_get_list_parsed(async_sess_t *, hw_res_list_parsed_t *, int); 143 144 -
uspace/lib/c/include/inet/addr.h
r0ee999d r5856b627 73 73 extern void addr128(const addr128_t, addr128_t); 74 74 75 extern int addr48_compare(const addr48_t, const addr48_t); 75 76 extern int addr128_compare(const addr128_t, const addr128_t); 77 78 extern void addr48_solicited_node(const addr128_t, addr48_t); 76 79 77 80 extern void host2addr128_t_be(const addr128_t, addr128_t); -
uspace/lib/c/include/ipc/dev_iface.h
r0ee999d r5856b627 36 36 typedef enum { 37 37 HW_RES_DEV_IFACE = 0, 38 39 /** Audio device mixer interface */ 40 AUDIO_MIXER_IFACE, 41 /** Audio device pcm buffer interface */ 42 AUDIO_PCM_BUFFER_IFACE, 43 38 44 /** Character device interface */ 39 45 CHAR_DEV_IFACE, -
uspace/lib/drv/Makefile
r0ee999d r5856b627 29 29 30 30 USPACE_PREFIX = ../.. 31 EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include 31 EXTRA_CFLAGS = -Iinclude -I$(LIBUSB_PREFIX)/include -I$(LIBPCM_PREFIX)/include 32 32 LIBRARY = libdrv 33 33 … … 38 38 generic/log.c \ 39 39 generic/logbuf.c \ 40 generic/remote_audio_mixer.c \ 41 generic/remote_audio_pcm.c \ 40 42 generic/remote_hw_res.c \ 41 43 generic/remote_char_dev.c \ -
uspace/lib/drv/generic/dev_iface.c
r0ee999d r5856b627 49 49 #include "remote_usbhid.h" 50 50 #include "remote_pci.h" 51 #include "remote_audio_mixer.h" 52 #include "remote_audio_pcm.h" 51 53 #include "remote_ahci.h" 52 54 53 static iface_dipatch_table_t remote_ifaces = {55 static const iface_dipatch_table_t remote_ifaces = { 54 56 .ifaces = { 55 &remote_hw_res_iface, 56 &remote_char_dev_iface, 57 &remote_graph_dev_iface, 58 &remote_nic_iface, 59 &remote_pci_iface, 60 &remote_usb_iface, 61 &remote_usbhc_iface, 62 &remote_usbhid_iface, 63 &remote_clock_dev_iface, 64 &remote_battery_dev_iface, 65 &remote_ahci_iface 57 [AUDIO_MIXER_IFACE] = &remote_audio_mixer_iface, 58 [AUDIO_PCM_BUFFER_IFACE] = &remote_audio_pcm_iface, 59 [HW_RES_DEV_IFACE] = &remote_hw_res_iface, 60 [CHAR_DEV_IFACE] = &remote_char_dev_iface, 61 [GRAPH_DEV_IFACE] = &remote_graph_dev_iface, 62 [NIC_DEV_IFACE] = &remote_nic_iface, 63 [PCI_DEV_IFACE] = &remote_pci_iface, 64 [USB_DEV_IFACE] = &remote_usb_iface, 65 [USBHC_DEV_IFACE] = &remote_usbhc_iface, 66 [USBHID_DEV_IFACE] = &remote_usbhid_iface, 67 [CLOCK_DEV_IFACE] = &remote_clock_dev_iface, 68 [BATTERY_DEV_IFACE] = &remote_battery_dev_iface, 69 [AHCI_DEV_IFACE] = &remote_ahci_iface, 66 70 } 67 71 }; -
uspace/lib/drv/generic/remote_hw_res.c
r0ee999d r5856b627 1 1 /* 2 2 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2011 Jan Vesely 3 4 * All rights reserved. 4 5 * … … 43 44 static void remote_hw_res_enable_interrupt(ddf_fun_t *, void *, ipc_callid_t, 44 45 ipc_call_t *); 46 static void remote_hw_res_dma_channel_setup(ddf_fun_t *, void *, ipc_callid_t, 47 ipc_call_t *); 48 static void remote_hw_res_dma_channel_remain(ddf_fun_t *, void *, ipc_callid_t, 49 ipc_call_t *); 45 50 46 51 static remote_iface_func_ptr_t remote_hw_res_iface_ops [] = { 47 &remote_hw_res_get_resource_list, 48 &remote_hw_res_enable_interrupt 52 [HW_RES_GET_RESOURCE_LIST] = &remote_hw_res_get_resource_list, 53 [HW_RES_ENABLE_INTERRUPT] = &remote_hw_res_enable_interrupt, 54 [HW_RES_DMA_CHANNEL_SETUP] = &remote_hw_res_dma_channel_setup, 55 [HW_RES_DMA_CHANNEL_REMAIN] = &remote_hw_res_dma_channel_remain, 49 56 }; 50 57 … … 94 101 } 95 102 103 static void remote_hw_res_dma_channel_setup(ddf_fun_t *fun, void *ops, 104 ipc_callid_t callid, ipc_call_t *call) 105 { 106 hw_res_ops_t *hw_res_ops = ops; 107 108 if (hw_res_ops->dma_channel_setup == NULL) { 109 async_answer_0(callid, ENOTSUP); 110 return; 111 } 112 const unsigned channel = DEV_IPC_GET_ARG1(*call) & 0xffff; 113 const uint8_t mode = DEV_IPC_GET_ARG1(*call) >> 16; 114 const uint32_t address = DEV_IPC_GET_ARG2(*call); 115 const uint32_t size = DEV_IPC_GET_ARG3(*call); 116 117 const int ret = hw_res_ops->dma_channel_setup( 118 fun, channel, address, size, mode); 119 async_answer_0(callid, ret); 120 } 121 122 static void remote_hw_res_dma_channel_remain(ddf_fun_t *fun, void *ops, 123 ipc_callid_t callid, ipc_call_t *call) 124 { 125 hw_res_ops_t *hw_res_ops = ops; 126 127 if (hw_res_ops->dma_channel_setup == NULL) { 128 async_answer_0(callid, ENOTSUP); 129 return; 130 } 131 const unsigned channel = DEV_IPC_GET_ARG1(*call); 132 size_t remain = 0; 133 const int ret = hw_res_ops->dma_channel_remain(fun, channel, &remain); 134 async_answer_1(callid, ret, remain); 135 } 96 136 /** 97 137 * @} -
uspace/lib/drv/include/ops/hw_res.h
r0ee999d r5856b627 44 44 hw_resource_list_t *(*get_resource_list)(ddf_fun_t *); 45 45 bool (*enable_interrupt)(ddf_fun_t *); 46 int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint16_t, uint8_t); 46 int (*dma_channel_setup)(ddf_fun_t *, unsigned, uint32_t, uint32_t, uint8_t); 47 int (*dma_channel_remain)(ddf_fun_t *, unsigned, size_t *); 47 48 } hw_res_ops_t; 48 49 -
uspace/lib/posix/include/posix/stdio.h
r0ee999d r5856b627 65 65 66 66 #define BUFSIZ 4096 67 #define SEEK_SET 068 #define SEEK_CUR 169 #define SEEK_END 270 67 71 68 typedef struct _IO_FILE FILE; -
uspace/lib/posix/include/posix/stdlib.h
r0ee999d r5856b627 46 46 #define NULL ((void *) 0) 47 47 #endif 48 49 #define RAND_MAX 714025 48 50 49 51 /* Process Termination */ … … 122 124 extern int __POSIX_DEF__(mkstemp)(char *tmpl); 123 125 126 /* Pseudo-random number generator */ 127 extern int __POSIX_DEF__(rand)(void); 128 extern void __POSIX_DEF__(srand)(unsigned int seed); 129 124 130 /* Legacy Declarations */ 125 131 extern char *__POSIX_DEF__(mktemp)(char *tmpl); -
uspace/lib/posix/include/posix/time.h
r0ee999d r5856b627 87 87 extern void __POSIX_DEF__(tzset)(void); 88 88 89 /* Time */ 90 extern time_t __POSIX_DEF__(time)(time_t *t); 91 89 92 /* Broken-down Time */ 90 93 extern struct tm *__POSIX_DEF__(gmtime_r)(const time_t *restrict timer, -
uspace/lib/posix/include/posix/unistd.h
r0ee999d r5856b627 44 44 #include "stddef.h" 45 45 46 #define SEEK_SET 0 47 #define SEEK_CUR 1 48 #define SEEK_END 2 49 46 50 /* Process Termination */ 47 51 #define _exit exit … … 77 81 extern ssize_t __POSIX_DEF__(read)(int fildes, void *buf, size_t nbyte); 78 82 extern ssize_t __POSIX_DEF__(write)(int fildes, const void *buf, size_t nbyte); 83 extern __POSIX_DEF__(off_t) __POSIX_DEF__(lseek)(int fildes, 84 __POSIX_DEF__(off_t) offset, int whence); 79 85 extern int __POSIX_DEF__(fsync)(int fildes); 80 86 extern int __POSIX_DEF__(ftruncate)(int fildes, __POSIX_DEF__(off_t) length); -
uspace/lib/posix/source/stdlib.c
r0ee999d r5856b627 394 394 395 395 /** 396 * Generate a pseudo random integer in the range 0 to RAND_MAX inclusive. 397 * 398 * @return The pseudo random integer. 399 */ 400 int posix_rand(void) 401 { 402 return (int) random(); 403 } 404 405 /** 406 * Initialize a new sequence of pseudo-random integers. 407 * 408 * @param seed The seed of the new sequence. 409 */ 410 void posix_srand(unsigned int seed) 411 { 412 srandom(seed); 413 } 414 415 /** 396 416 * Creates and opens an unique temporary file from template. 397 417 * -
uspace/lib/posix/source/time.c
r0ee999d r5856b627 74 74 posix_daylight = 0; 75 75 posix_timezone = 0; 76 } 77 78 /** 79 * Get the time in seconds 80 * 81 * @param t If t is non-NULL, the return value is also stored in the memory 82 * pointed to by t. 83 * @return On success, the value of time in seconds since the Epoch 84 * is returned. On error, (time_t)-1 is returned. 85 */ 86 time_t posix_time(time_t *t) 87 { 88 return time(t); 76 89 } 77 90 -
uspace/lib/posix/source/unistd.c
r0ee999d r5856b627 221 221 { 222 222 return errnify(write, fildes, buf, nbyte); 223 } 224 225 /** 226 * Reposition read/write file offset 227 * 228 * @param fildes File descriptor of the opened file. 229 * @param offset New offset in the file. 230 * @param whence The position from which the offset argument is specified. 231 * @return Upon successful completion, returns the resulting offset 232 * as measured in bytes from the beginning of the file, -1 otherwise. 233 */ 234 posix_off_t posix_lseek(int fildes, posix_off_t offset, int whence) 235 { 236 return errnify(lseek, fildes, offset, whence); 223 237 } 224 238 -
uspace/lib/softfloat/softfloat.c
r0ee999d r5856b627 1265 1265 } 1266 1266 1267 1268 float __aeabi_i2f(int i) 1269 { 1270 return __floatsisf(i); 1271 } 1272 1273 float __aeabi_ui2f(int i) 1274 { 1275 return __floatunsisf(i); 1276 } 1277 1267 1278 double __aeabi_i2d(int i) 1268 1279 { … … 1280 1291 } 1281 1292 1293 int __aeabi_f2uiz(float a) 1294 { 1295 return __fixunssfsi(a); 1296 } 1297 1282 1298 int __aeabi_d2iz(double a) 1283 1299 { … … 1288 1304 { 1289 1305 return __fixunsdfsi(a); 1306 } 1307 1308 int __aeabi_fcmpge(float a, float b) 1309 { 1310 return __gesf2(a, b); 1311 } 1312 1313 int __aeabi_fcmpgt(float a, float b) 1314 { 1315 return __gtsf2(a, b); 1316 } 1317 1318 int __aeabi_fcmplt(float a, float b) 1319 { 1320 return __ltsf2(a, b); 1321 } 1322 1323 int __aeabi_fcmpeq(float a, float b) 1324 { 1325 return __eqsf2(a, b); 1290 1326 } 1291 1327 -
uspace/lib/softfloat/softfloat.h
r0ee999d r5856b627 204 204 205 205 /* ARM EABI */ 206 extern float __aeabi_i2f(int); 207 extern float __aeabi_ui2f(int); 206 208 extern double __aeabi_i2d(int); 207 209 extern double __aeabi_ui2d(unsigned int); … … 209 211 210 212 extern int __aeabi_f2iz(float); 213 extern int __aeabi_f2uiz(float); 211 214 extern int __aeabi_d2iz(double); 215 216 extern int __aeabi_fcmpge(float, float); 217 extern int __aeabi_fcmpgt(float, float); 218 extern int __aeabi_fcmplt(float, float); 219 extern int __aeabi_fcmpeq(float, float); 212 220 213 221 extern int __aeabi_dcmpge(double, double);
Note:
See TracChangeset
for help on using the changeset viewer.
