Changeset 86ffa27f in mainline for uspace/lib/c
- Timestamp:
- 2011-08-07T11:21:44Z (14 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc574511
- Parents:
- 15f3c3f (diff), e8067c0 (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
- Files:
-
- 35 added
- 1 deleted
- 25 edited
- 3 moved
-
Makefile (modified) (3 diffs)
-
arch/abs32le/include/elf_linux.h (moved) (moved from uspace/drv/bus/usb/usbmast/scsi.h ) (2 diffs)
-
arch/amd64/include/elf_linux.h (added)
-
arch/arm32/include/elf_linux.h (added)
-
arch/ia32/include/elf_linux.h (added)
-
arch/ia64/include/elf_linux.h (added)
-
arch/mips32/Makefile.common (modified) (1 diff)
-
arch/mips32/include/atomic.h (modified) (1 diff)
-
arch/mips32/include/elf_linux.h (added)
-
arch/mips32/include/fibril.h (modified) (1 diff)
-
arch/mips32/include/thread.h (modified) (1 diff)
-
arch/mips32/include/tls.h (modified) (1 diff)
-
arch/mips32/include/types.h (modified) (1 diff)
-
arch/mips32/src/syscall.c (modified) (2 diffs)
-
arch/mips32/src/tls.c (modified) (1 diff)
-
arch/mips32eb/Makefile.common (modified) (1 diff)
-
arch/mips32eb/include/elf_linux.h (added)
-
arch/mips64/Makefile.common (added)
-
arch/mips64/Makefile.inc (added)
-
arch/mips64/_link.ld.in (added)
-
arch/mips64/include/atomic.h (added)
-
arch/mips64/include/config.h (added)
-
arch/mips64/include/ddi.h (added)
-
arch/mips64/include/elf_linux.h (added)
-
arch/mips64/include/faddr.h (added)
-
arch/mips64/include/fibril.h (added)
-
arch/mips64/include/inttypes.h (added)
-
arch/mips64/include/istate.h (added)
-
arch/mips64/include/syscall.h (added)
-
arch/mips64/include/thread.h (added)
-
arch/mips64/include/tls.h (added)
-
arch/mips64/include/types.h (added)
-
arch/mips64/src/entry.s (added)
-
arch/mips64/src/entryjmp.s (added)
-
arch/mips64/src/fibril.S (added)
-
arch/mips64/src/stacktrace.c (added)
-
arch/mips64/src/stacktrace_asm.S (added)
-
arch/mips64/src/syscall.c (added)
-
arch/mips64/src/thread_entry.s (added)
-
arch/mips64/src/tls.c (added)
-
arch/ppc32/include/elf_linux.h (added)
-
arch/sparc64/include/elf_linux.h (added)
-
generic/elf/elf_load.c (moved) (moved from uspace/srv/loader/elf_load.c ) (9 diffs)
-
generic/io/console.c (modified) (1 diff)
-
generic/io/io.c (modified) (3 diffs)
-
generic/rtld/elf_load.c (deleted)
-
generic/rtld/module.c (modified) (7 diffs)
-
generic/rtld/rtld.c (modified) (1 diff)
-
generic/rtld/symbol.c (modified) (6 diffs)
-
generic/str.c (modified) (1 diff)
-
generic/vfs/vfs.c (modified) (1 diff)
-
include/bitops.h (modified) (1 diff)
-
include/elf/elf.h (added)
-
include/elf/elf_linux.h (added)
-
include/elf/elf_load.h (moved) (moved from uspace/srv/loader/include/elf_load.h ) (3 diffs)
-
include/fourcc.h (added)
-
include/ipc/console.h (modified) (1 diff)
-
include/ipc/services.h (modified) (1 diff)
-
include/rtld/elf_dyn.h (modified) (1 diff)
-
include/rtld/rtld.h (modified) (1 diff)
-
include/rtld/symbol.h (modified) (1 diff)
-
include/str.h (modified) (2 diffs)
-
include/typedefs.h (added)
-
include/unistd.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/Makefile
r15f3c3f r86ffa27f 59 59 -include arch/$(UARCH)/Makefile.inc 60 60 61 EXTRA_CFLAGS += -I../../srv/loader/include62 63 61 GENERIC_SOURCES = \ 64 62 generic/libc.c \ … … 70 68 generic/device/hw_res.c \ 71 69 generic/device/char_dev.c \ 70 generic/elf/elf_load.c \ 72 71 generic/event.c \ 73 72 generic/errno.c \ … … 134 133 generic/dlfcn.c \ 135 134 generic/rtld/rtld.c \ 136 generic/rtld/elf_load.c \137 135 generic/rtld/dynamic.c \ 138 136 generic/rtld/module.c \ -
uspace/lib/c/arch/abs32le/include/elf_linux.h
r15f3c3f r86ffa27f 1 1 /* 2 * Copyright (c) 2011 Vojtech Horky2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup drvusbmast29 /** @addtogroup libcabs32le 30 30 * @{ 31 31 */ 32 32 /** @file 33 * SCSI related structures.34 33 */ 35 34 36 #ifndef USB_USBMAST_SCSI_H_37 #define USB_USBMAST_SCSI_H_35 #ifndef LIBC_abs32le_ELF_LINUX_H_ 36 #define LBIC_abs32le_ELF_LINUX_H_ 38 37 38 #include <libarch/istate.h> 39 39 #include <sys/types.h> 40 #include <usb/usb.h>41 40 42 41 typedef struct { 43 uint8_t op_code;44 uint8_t lun_evpd; 45 uint8_t page_code; 46 uint16_t alloc_length; 47 uint8_t ctrl;48 } __attribute__((packed)) scsi_cmd_inquiry_t;42 } elf_regs_t; 43 44 static inline void istate_to_elf_regs(istate_t *istate, elf_regs_t *elf_regs) 45 { 46 (void) istate; (void) elf_regs; 47 } 49 48 50 49 #endif 51 50 52 /** 53 * @} 51 /** @} 54 52 */ -
uspace/lib/c/arch/mips32/Makefile.common
r15f3c3f r86ffa27f 27 27 # 28 28 29 GCC_CFLAGS += -mips3 29 GCC_CFLAGS += -mips3 -mabi=32 30 30 31 31 ENDIANESS = LE -
uspace/lib/c/arch/mips32/include/atomic.h
r15f3c3f r86ffa27f 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 -
uspace/lib/c/arch/mips32/include/fibril.h
r15f3c3f r86ffa27f 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 -
uspace/lib/c/arch/mips32/include/thread.h
r15f3c3f r86ffa27f 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 -
uspace/lib/c/arch/mips32/include/tls.h
r15f3c3f r86ffa27f 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 -
uspace/lib/c/arch/mips32/include/types.h
r15f3c3f r86ffa27f 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 -
uspace/lib/c/arch/mips32/src/syscall.c
r15f3c3f r86ffa27f 27 27 */ 28 28 29 /** @addtogroup libcmips3229 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 … … 64 64 } 65 65 66 /** @}66 /** @} 67 67 */ 68 -
uspace/lib/c/arch/mips32/src/tls.c
r15f3c3f r86ffa27f 27 27 */ 28 28 29 /** @addtogroup libcmips32 29 /** @addtogroup libcmips32 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @ingroup libcmips32 eb33 * @ingroup libcmips32 34 34 */ 35 35 -
uspace/lib/c/arch/mips32eb/Makefile.common
r15f3c3f r86ffa27f 27 27 # 28 28 29 GCC_CFLAGS += -mips3 29 GCC_CFLAGS += -mips3 -mabi=32 30 30 31 31 ENDIANESS = BE -
uspace/lib/c/generic/elf/elf_load.c
r15f3c3f r86ffa27f 29 29 */ 30 30 31 /** @addtogroup generic 31 /** @addtogroup generic 32 32 * @{ 33 33 */ … … 49 49 #include <assert.h> 50 50 #include <as.h> 51 #include <elf/elf.h> 51 52 #include <unistd.h> 52 53 #include <fcntl.h> … … 55 56 #include <entry_point.h> 56 57 57 #include "elf.h" 58 #include "elf_load.h" 58 #include <elf/elf_load.h> 59 59 60 60 #define DPRINTF(...) … … 74 74 static int load_segment(elf_ld_t *elf, elf_segment_header_t *entry); 75 75 76 /** Read until the buffer is read in its entirety. */77 static int my_read(int fd, void *buf, size_t len)78 {79 int cnt = 0;80 do {81 buf += cnt;82 len -= cnt;83 cnt = read(fd, buf, len);84 } while ((cnt > 0) && ((len - cnt) > 0));85 86 return cnt;87 }88 89 76 /** Load ELF binary from a file. 90 77 * … … 160 147 int i, rc; 161 148 162 rc = my_read(elf->fd, header, sizeof(elf_header_t));163 if (rc < 0) {149 rc = read_all(elf->fd, header, sizeof(elf_header_t)); 150 if (rc != sizeof(elf_header_t)) { 164 151 DPRINTF("Read error.\n"); 165 152 return EE_INVALID; … … 222 209 + i * sizeof(elf_segment_header_t), SEEK_SET); 223 210 224 rc = my_read(elf->fd, &segment_hdr,211 rc = read_all(elf->fd, &segment_hdr, 225 212 sizeof(elf_segment_header_t)); 226 if (rc < 0) {213 if (rc != sizeof(elf_segment_header_t)) { 227 214 DPRINTF("Read error.\n"); 228 215 return EE_INVALID; … … 244 231 + i * sizeof(elf_section_header_t), SEEK_SET); 245 232 246 rc = my_read(elf->fd, §ion_hdr,233 rc = read_all(elf->fd, §ion_hdr, 247 234 sizeof(elf_section_header_t)); 248 if (rc < 0) {235 if (rc != sizeof(elf_section_header_t)) { 249 236 DPRINTF("Read error.\n"); 250 237 return EE_INVALID; … … 334 321 uintptr_t seg_addr; 335 322 size_t mem_sz; 336 int rc;323 ssize_t rc; 337 324 338 325 bias = elf->bias; … … 412 399 if (now > left) now = left; 413 400 414 rc = my_read(elf->fd, dp, now);415 416 if (rc < 0) {401 rc = read_all(elf->fd, dp, now); 402 403 if (rc != (ssize_t) now) { 417 404 DPRINTF("Read error.\n"); 418 405 return EE_INVALID; -
uspace/lib/c/generic/io/console.c
r15f3c3f r86ffa27f 76 76 bool console_kcon(void) 77 77 { 78 #if 079 78 return __SYSCALL0(SYS_DEBUG_ACTIVATE_CONSOLE); 80 #endif81 82 return false;83 79 } 84 80 -
uspace/lib/c/generic/io/io.c
r15f3c3f r86ffa27f 594 594 } 595 595 596 buf+= now;596 data += now; 597 597 stream->buf_head += now; 598 598 buf_free -= now; 599 599 bytes_left -= now; 600 600 total_written += now; 601 stream->buf_state = _bs_write; 601 602 602 603 if (buf_free == 0) { … … 606 607 } 607 608 } 608 609 if (total_written > 0)610 stream->buf_state = _bs_write;611 609 612 610 if (need_flush) … … 714 712 off64_t ftell(FILE *stream) 715 713 { 714 _fflushbuf(stream); 716 715 return lseek(stream->fd, 0, SEEK_CUR); 717 716 } -
uspace/lib/c/generic/rtld/module.c
r15f3c3f r86ffa27f 35 35 */ 36 36 37 #include <adt/list.h> 38 #include <elf/elf_load.h> 39 #include <fcntl.h> 40 #include <loader/pcb.h> 37 41 #include <stdio.h> 38 42 #include <stdlib.h> 39 43 #include <unistd.h> 40 #include <fcntl.h>41 #include <adt/list.h>42 #include <loader/pcb.h>43 44 44 45 #include <rtld/rtld.h> … … 47 48 #include <rtld/rtld_arch.h> 48 49 #include <rtld/module.h> 49 #include <elf_load.h>50 50 51 51 /** (Eagerly) process all relocation tables in a module. … … 93 93 module_t *module_find(const char *name) 94 94 { 95 link_t *head = &runtime_env->modules_head;96 97 link_t *cur;98 95 module_t *m; 99 96 const char *p, *soname; … … 110 107 111 108 /* Traverse list of all modules. Not extremely fast, but simple */ 112 DPRINTF("head = %p\n", head); 113 for (cur = head->next; cur != head; cur = cur->next) { 109 list_foreach(runtime_env->modules, cur) { 114 110 DPRINTF("cur = %p\n", cur); 115 111 m = list_get_instance(cur, module_t, modules_link); … … 177 173 178 174 /* Insert into the list of loaded modules */ 179 list_append(&m->modules_link, &runtime_env->modules _head);175 list_append(&m->modules_link, &runtime_env->modules); 180 176 181 177 return m; … … 249 245 void modules_process_relocs(module_t *start) 250 246 { 251 link_t *head = &runtime_env->modules_head; 252 253 link_t *cur; 254 module_t *m; 255 256 for (cur = head->next; cur != head; cur = cur->next) { 247 module_t *m; 248 249 list_foreach(runtime_env->modules, cur) { 257 250 m = list_get_instance(cur, module_t, modules_link); 258 251 … … 268 261 void modules_untag(void) 269 262 { 270 link_t *head = &runtime_env->modules_head; 271 272 link_t *cur; 273 module_t *m; 274 275 for (cur = head->next; cur != head; cur = cur->next) { 263 module_t *m; 264 265 list_foreach(runtime_env->modules, cur) { 276 266 m = list_get_instance(cur, module_t, modules_link); 277 267 m->bfs_tag = false; -
uspace/lib/c/generic/rtld/rtld.c
r15f3c3f r86ffa27f 44 44 { 45 45 runtime_env = &rt_env_static; 46 list_initialize(&runtime_env->modules _head);46 list_initialize(&runtime_env->modules); 47 47 runtime_env->next_bias = 0x2000000; 48 48 runtime_env->program = NULL; -
uspace/lib/c/generic/rtld/symbol.c
r15f3c3f r86ffa27f 38 38 #include <stdlib.h> 39 39 40 #include <elf/elf.h> 40 41 #include <rtld/rtld.h> 41 42 #include <rtld/rtld_debug.h> 42 43 #include <rtld/symbol.h> 43 #include <elf.h>44 44 45 45 /* … … 118 118 module_t *m, *dm; 119 119 elf_symbol_t *sym, *s; 120 li nk_t queue_head;120 list_t queue; 121 121 size_t i; 122 122 … … 132 132 133 133 /* Insert root (the program) into the queue and tag it */ 134 list_initialize(&queue _head);134 list_initialize(&queue); 135 135 start->bfs_tag = true; 136 list_append(&start->queue_link, &queue _head);136 list_append(&start->queue_link, &queue); 137 137 138 138 /* If the symbol is found, it will be stored in 'sym' */ … … 140 140 141 141 /* While queue is not empty */ 142 while (!list_empty(&queue _head)) {142 while (!list_empty(&queue)) { 143 143 /* Pop first element from the queue */ 144 m = list_get_instance( queue_head.next, module_t, queue_link);144 m = list_get_instance(list_first(&queue), module_t, queue_link); 145 145 list_remove(&m->queue_link); 146 146 … … 162 162 if (dm->bfs_tag == false) { 163 163 dm->bfs_tag = true; 164 list_append(&dm->queue_link, &queue _head);164 list_append(&dm->queue_link, &queue); 165 165 } 166 166 } … … 168 168 169 169 /* Empty the queue so that we leave it in a clean state */ 170 while (!list_empty(&queue _head))171 list_remove( queue_head.next);170 while (!list_empty(&queue)) 171 list_remove(list_first(&queue)); 172 172 173 173 if (!sym) { -
uspace/lib/c/generic/str.c
r15f3c3f r86ffa27f 544 544 545 545 str_cpy(dest + dstr_size, size - dstr_size, src); 546 } 547 548 /** Convert space-padded ASCII to string. 549 * 550 * Common legacy text encoding in hardware is 7-bit ASCII fitted into 551 * a fixed-with byte buffer (bit 7 always zero), right-padded with spaces 552 * (ASCII 0x20). Convert space-padded ascii to string representation. 553 * 554 * If the text does not fit into the destination buffer, the function converts 555 * as many characters as possible and returns EOVERFLOW. 556 * 557 * If the text contains non-ASCII bytes (with bit 7 set), the whole string is 558 * converted anyway and invalid characters are replaced with question marks 559 * (U_SPECIAL) and the function returns EIO. 560 * 561 * Regardless of return value upon return @a dest will always be well-formed. 562 * 563 * @param dest Destination buffer 564 * @param size Size of destination buffer 565 * @param src Space-padded ASCII. 566 * @param n Size of the source buffer in bytes. 567 * 568 * @return EOK on success, EOVERFLOW if the text does not fit 569 * destination buffer, EIO if the text contains 570 * non-ASCII bytes. 571 */ 572 int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n) 573 { 574 size_t sidx; 575 size_t didx; 576 size_t dlast; 577 uint8_t byte; 578 int rc; 579 int result; 580 581 /* There must be space for a null terminator in the buffer. */ 582 assert(size > 0); 583 result = EOK; 584 585 didx = 0; 586 dlast = 0; 587 for (sidx = 0; sidx < n; ++sidx) { 588 byte = src[sidx]; 589 if (!ascii_check(byte)) { 590 byte = U_SPECIAL; 591 result = EIO; 592 } 593 594 rc = chr_encode(byte, dest, &didx, size - 1); 595 if (rc != EOK) { 596 assert(rc == EOVERFLOW); 597 dest[didx] = '\0'; 598 return rc; 599 } 600 601 /* Remember dest index after last non-empty character */ 602 if (byte != 0x20) 603 dlast = didx; 604 } 605 606 /* Terminate string after last non-empty character */ 607 dest[dlast] = '\0'; 608 return result; 546 609 } 547 610 -
uspace/lib/c/generic/vfs/vfs.c
r15f3c3f r86ffa27f 417 417 } 418 418 419 /** Read entire buffer. 420 * 421 * In face of short reads this function continues reading until either 422 * the entire buffer is read or no more data is available (at end of file). 423 * 424 * @param fildes File descriptor 425 * @param buf Buffer, @a nbytes bytes long 426 * @param nbytes Number of bytes to read 427 * 428 * @return On success, positive number of bytes read. 429 * On failure, negative error code from read(). 430 */ 431 ssize_t read_all(int fildes, void *buf, size_t nbyte) 432 { 433 ssize_t cnt = 0; 434 size_t nread = 0; 435 uint8_t *bp = (uint8_t *) buf; 436 437 do { 438 bp += cnt; 439 nread += cnt; 440 cnt = read(fildes, bp, nbyte - nread); 441 } while (cnt > 0 && (nbyte - nread - cnt) > 0); 442 443 if (cnt < 0) 444 return cnt; 445 446 return nread + cnt; 447 } 448 449 /** Write entire buffer. 450 * 451 * This function fails if it cannot write exactly @a len bytes to the file. 452 * 453 * @param fildes File descriptor 454 * @param buf Data, @a nbytes bytes long 455 * @param nbytes Number of bytes to write 456 * 457 * @return EOK on error, return value from write() if writing 458 * failed. 459 */ 460 ssize_t write_all(int fildes, const void *buf, size_t nbyte) 461 { 462 ssize_t cnt = 0; 463 ssize_t nwritten = 0; 464 const uint8_t *bp = (uint8_t *) buf; 465 466 do { 467 bp += cnt; 468 nwritten += cnt; 469 cnt = write(fildes, bp, nbyte - nwritten); 470 } while (cnt > 0 && ((ssize_t )nbyte - nwritten - cnt) > 0); 471 472 if (cnt < 0) 473 return cnt; 474 475 if ((ssize_t)nbyte - nwritten - cnt > 0) 476 return EIO; 477 478 return nbyte; 479 } 480 419 481 int fsync(int fildes) 420 482 { -
uspace/lib/c/include/bitops.h
r15f3c3f r86ffa27f 38 38 #include <sys/types.h> 39 39 40 /** Mask with bit @a n set. */ 41 #define BIT_V(type, n) \ 42 ((type)1 << ((n) - 1)) 43 44 /** Mask with rightmost @a n bits set. */ 45 #define BIT_RRANGE(type, n) \ 46 (BIT_V(type, (n) + 1) - 1) 47 48 /** Mask with bits @a hi .. @a lo set. @a hi >= @a lo. */ 49 #define BIT_RANGE(type, hi, lo) \ 50 (BIT_RRANGE(type, (hi) - (lo) + 1) << (lo)) 51 52 /** Extract range of bits @a hi .. @a lo from @a value. */ 53 #define BIT_RANGE_EXTRACT(type, hi, lo, value) \ 54 (((value) >> (lo)) & BIT_RRANGE(type, (hi) - (lo) + 1)) 40 55 41 56 /** Return position of first non-zero bit from left (i.e. [log_2(arg)]). -
uspace/lib/c/include/elf/elf_load.h
r15f3c3f r86ffa27f 1 1 /* 2 * Copyright (c) 2006 Sergey Bondari 2 3 * Copyright (c) 2008 Jiri Svoboda 3 4 * All rights reserved. … … 38 39 39 40 #include <arch/elf.h> 41 #include <elf/elf.h> 40 42 #include <sys/types.h> 41 43 #include <loader/pcb.h> 42 44 43 #include "elf.h" 45 /** 46 * ELF error return codes 47 */ 48 #define EE_OK 0 /* No error */ 49 #define EE_INVALID 1 /* Invalid ELF image */ 50 #define EE_MEMORY 2 /* Cannot allocate address space */ 51 #define EE_INCOMPATIBLE 3 /* ELF image is not compatible with current architecture */ 52 #define EE_UNSUPPORTED 4 /* Non-supported ELF (e.g. dynamic ELFs) */ 53 #define EE_LOADER 5 /* The image is actually a program loader. */ 54 #define EE_IRRECOVERABLE 6 44 55 45 56 typedef enum { … … 82 93 } elf_ld_t; 83 94 84 int elf_load_file(const char *file_name, size_t so_bias, eld_flags_t flags, 85 elf_info_t *info);86 void elf_create_pcb(elf_info_t *info, pcb_t *pcb);95 extern const char *elf_error(unsigned int); 96 extern int elf_load_file(const char *, size_t, eld_flags_t, elf_info_t *); 97 extern void elf_create_pcb(elf_info_t *, pcb_t *); 87 98 88 99 #endif -
uspace/lib/c/include/ipc/console.h
r15f3c3f r86ffa27f 48 48 CONSOLE_SET_COLOR, 49 49 CONSOLE_SET_RGB_COLOR, 50 CONSOLE_CURSOR_VISIBILITY, 51 CONSOLE_KCON_ENABLE 50 CONSOLE_CURSOR_VISIBILITY 52 51 } console_request_t; 53 52 -
uspace/lib/c/include/ipc/services.h
r15f3c3f r86ffa27f 38 38 #define LIBC_SERVICES_H_ 39 39 40 #include <fourcc.h> 41 40 42 typedef enum { 41 SERVICE_NONE = 0,42 SERVICE_LOAD ,43 SERVICE_VIDEO ,44 SERVICE_VFS ,45 SERVICE_LOC ,46 SERVICE_DEVMAN ,47 SERVICE_IRC ,48 SERVICE_CLIPBOARD ,49 SERVICE_NETWORKING ,50 SERVICE_LO ,51 SERVICE_NE2000 ,52 SERVICE_ETHERNET ,53 SERVICE_NILDUMMY ,54 SERVICE_IP ,55 SERVICE_ARP ,56 SERVICE_ICMP ,57 SERVICE_UDP ,58 SERVICE_TCP 43 SERVICE_NONE = 0, 44 SERVICE_LOAD = FOURCC('l', 'o', 'a', 'd'), 45 SERVICE_VIDEO = FOURCC('v', 'i', 'd', ' '), 46 SERVICE_VFS = FOURCC('v', 'f', 's', ' '), 47 SERVICE_LOC = FOURCC('l', 'o', 'c', ' '), 48 SERVICE_DEVMAN = FOURCC('d', 'e', 'v', 'n'), 49 SERVICE_IRC = FOURCC('i', 'r', 'c', ' '), 50 SERVICE_CLIPBOARD = FOURCC('c', 'l', 'i', 'p'), 51 SERVICE_NETWORKING = FOURCC('n', 'e', 't', ' '), 52 SERVICE_LO = FOURCC('l', 'o', ' ', ' '), 53 SERVICE_NE2000 = FOURCC('n', 'e', '2', 'k'), 54 SERVICE_ETHERNET = FOURCC('e', 't', 'h', ' '), 55 SERVICE_NILDUMMY = FOURCC('n', 'i', 'l', 'd'), 56 SERVICE_IP = FOURCC('i', 'p', 'v', '4'), 57 SERVICE_ARP = FOURCC('a', 'r', 'p', ' '), 58 SERVICE_ICMP = FOURCC('i', 'c', 'm', 'p'), 59 SERVICE_UDP = FOURCC('u', 'd', 'p', ' '), 60 SERVICE_TCP = FOURCC('t', 'c', 'p', ' ') 59 61 } services_t; 60 62 -
uspace/lib/c/include/rtld/elf_dyn.h
r15f3c3f r86ffa27f 39 39 #include <sys/types.h> 40 40 41 #include <elf .h>41 #include <elf/elf.h> 42 42 #include <libarch/rtld/elf_dyn.h> 43 43 -
uspace/lib/c/include/rtld/rtld.h
r15f3c3f r86ffa27f 49 49 50 50 /** List of all loaded modules including rtld and the program */ 51 li nk_t modules_head;51 list_t modules; 52 52 53 53 /** Temporary hack to place each module at different address. */ -
uspace/lib/c/include/rtld/symbol.h
r15f3c3f r86ffa27f 36 36 #define LIBC_RTLD_SYMBOL_H_ 37 37 38 #include <elf/elf.h> 38 39 #include <rtld/rtld.h> 39 #include <elf.h>40 40 41 41 elf_symbol_t *symbol_bfs_find(const char *name, module_t *start, module_t **mod); -
uspace/lib/c/include/str.h
r15f3c3f r86ffa27f 48 48 #define STR_BOUNDS(length) ((length) << 2) 49 49 50 /** 51 * Maximum size of a buffer needed to a string converted from space-padded 52 * ASCII of size @a spa_size using spascii_to_str(). 53 */ 54 #define SPASCII_STR_BUFSIZE(spa_size) ((spa_size) + 1) 55 50 56 extern wchar_t str_decode(const char *str, size_t *offset, size_t sz); 51 57 extern int chr_encode(const wchar_t ch, char *str, size_t *offset, size_t sz); … … 73 79 extern void str_append(char *dest, size_t size, const char *src); 74 80 81 extern int spascii_to_str(char *dest, size_t size, const uint8_t *src, size_t n); 75 82 extern void wstr_to_str(char *dest, size_t size, const wchar_t *src); 76 83 extern char *wstr_to_astr(const wchar_t *src); -
uspace/lib/c/include/unistd.h
r15f3c3f r86ffa27f 63 63 extern ssize_t read(int, void *, size_t); 64 64 65 extern ssize_t read_all(int, void *, size_t); 66 extern ssize_t write_all(int, const void *, size_t); 67 65 68 extern off64_t lseek(int, off64_t, int); 66 69 extern int ftruncate(int, aoff64_t);
Note:
See TracChangeset
for help on using the changeset viewer.
