Changeset 3375bd4 in mainline for uspace/lib/c
- Timestamp:
 - 2011-05-17T07:44:17Z (14 years ago)
 - Branches:
 - lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
 - Children:
 - 04c418d, 2586860, 5e6e50b
 - Parents:
 - 72cd53d (diff), 0d8a304 (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:
 - 
      
- 20 added
 - 51 edited
 - 10 moved
 
- 
          
  Makefile (modified) (4 diffs)
 - 
          
  arch/abs32le/Makefile.inc (modified) (1 diff)
 - 
          
  arch/abs32le/_link.ld.in (modified) (1 diff)
 - 
          
  arch/abs32le/src/entryjmp.c (moved) (moved from uspace/srv/loader/arch/abs32le/abs32le.c ) (1 diff)
 - 
          
  arch/amd64/Makefile.inc (modified) (1 diff)
 - 
          
  arch/amd64/_link.ld.in (modified) (2 diffs)
 - 
          
  arch/amd64/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/amd64/amd64.s ) (1 diff)
 - 
          
  arch/arm32/Makefile.inc (modified) (1 diff)
 - 
          
  arch/arm32/_link.ld.in (modified) (1 diff)
 - 
          
  arch/arm32/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/arm32/arm32.s ) (1 diff)
 - 
          
  arch/ia32/Makefile.common (modified) (1 diff)
 - 
          
  arch/ia32/Makefile.inc (modified) (2 diffs)
 - 
          
  arch/ia32/_link.ld.in (modified) (4 diffs)
 - 
          
  arch/ia32/include/config.h (modified) (1 diff)
 - 
          
  arch/ia32/include/ddi.h (modified) (1 diff)
 - 
          
  arch/ia32/include/faddr.h (modified) (1 diff)
 - 
          
  arch/ia32/include/fibril.h (modified) (2 diffs)
 - 
          
  arch/ia32/include/rtld/dynamic.h (moved) (moved from uspace/srv/loader/include/arch.h ) (1 diff)
 - 
          
  arch/ia32/include/rtld/elf_dyn.h (added)
 - 
          
  arch/ia32/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/ia32/ia32.s ) (1 diff)
 - 
          
  arch/ia32/src/rtld/dynamic.c (added)
 - 
          
  arch/ia32/src/rtld/reloc.c (added)
 - 
          
  arch/ia32/src/stacktrace.c (modified) (1 diff)
 - 
          
  arch/ia32/src/syscall.S (modified) (3 diffs)
 - 
          
  arch/ia32/src/tls.c (modified) (2 diffs)
 - 
          
  arch/ia64/Makefile.inc (modified) (1 diff)
 - 
          
  arch/ia64/_link.ld.in (modified) (2 diffs)
 - 
          
  arch/ia64/src/entry.s (modified) (1 diff)
 - 
          
  arch/ia64/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/ia64/ia64.s ) (1 diff)
 - 
          
  arch/ia64/src/thread_entry.s (modified) (1 diff)
 - 
          
  arch/mips32/Makefile.inc (modified) (1 diff)
 - 
          
  arch/mips32/_link.ld.in (modified) (1 diff)
 - 
          
  arch/mips32/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/mips32/mips32.s ) (1 diff)
 - 
          
  arch/mips32eb/Makefile.inc (modified) (1 diff)
 - 
          
  arch/ppc32/Makefile.inc (modified) (1 diff)
 - 
          
  arch/ppc32/_link.ld.in (modified) (1 diff)
 - 
          
  arch/ppc32/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/ppc32/ppc32.s ) (1 diff)
 - 
          
  arch/sparc64/Makefile.inc (modified) (1 diff)
 - 
          
  arch/sparc64/_link.ld.in (modified) (1 diff)
 - 
          
  arch/sparc64/src/entryjmp.s (moved) (moved from uspace/srv/loader/arch/sparc64/sparc64.s ) (1 diff)
 - 
          
  generic/adt/prodcons.c (added)
 - 
          
  generic/as.c (modified) (3 diffs)
 - 
          
  generic/assert.c (added)
 - 
          
  generic/async.c (modified) (1 diff)
 - 
          
  generic/async_sess.c (modified) (1 diff)
 - 
          
  generic/dlfcn.c (added)
 - 
          
  generic/errno.c (modified) (1 diff)
 - 
          
  generic/event.c (modified) (1 diff)
 - 
          
  generic/fibril_synch.c (modified) (1 diff)
 - 
          
  generic/io/io.c (modified) (1 diff)
 - 
          
  generic/libc.c (modified) (2 diffs)
 - 
          
  generic/malloc.c (modified) (1 diff)
 - 
          
  generic/rtld/dynamic.c (added)
 - 
          
  generic/rtld/elf_load.c (added)
 - 
          
  generic/rtld/module.c (added)
 - 
          
  generic/rtld/rtld.c (added)
 - 
          
  generic/rtld/symbol.c (added)
 - 
          
  generic/stacktrace.c (modified) (1 diff)
 - 
          
  generic/str.c (modified) (2 diffs)
 - 
          
  include/adt/fifo.h (modified) (1 diff)
 - 
          
  include/adt/list.h (modified) (12 diffs)
 - 
          
  include/adt/measured_strings.h (modified) (1 diff)
 - 
          
  include/adt/prodcons.h (added)
 - 
          
  include/as.h (modified) (1 diff)
 - 
          
  include/assert.h (modified) (3 diffs)
 - 
          
  include/dlfcn.h (added)
 - 
          
  include/entry_point.h (moved) (moved from kernel/arch/sparc64/include/mm/cache.h ) (3 diffs)
 - 
          
  include/errno.h (modified) (1 diff)
 - 
          
  include/event.h (modified) (1 diff)
 - 
          
  include/fibril.h (modified) (1 diff)
 - 
          
  include/fibril_synch.h (modified) (2 diffs)
 - 
          
  include/loader/pcb.h (modified) (1 diff)
 - 
          
  include/macros.h (modified) (1 diff)
 - 
          
  include/rtld/dynamic.h (added)
 - 
          
  include/rtld/elf_dyn.h (added)
 - 
          
  include/rtld/module.h (added)
 - 
          
  include/rtld/rtld.h (added)
 - 
          
  include/rtld/rtld_arch.h (added)
 - 
          
  include/rtld/rtld_debug.h (added)
 - 
          
  include/rtld/symbol.h (added)
 - 
          
  include/str.h (modified) (1 diff)
 
 
Legend:
- Unmodified
 - Added
 - Removed
 
- 
      
uspace/lib/c/Makefile
r72cd53d r3375bd4 41 41 CONFIG_MAKEFILE = $(ROOT_PATH)/Makefile.config 42 42 43 LINKER_SCRIPTS = \ 44 $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld \ 45 $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld \ 46 $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld \ 47 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld 48 43 49 PRE_DEPEND = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) 44 EXTRA_OUTPUT = $(LINKER_SCRIPT )45 EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPT )50 EXTRA_OUTPUT = $(LINKER_SCRIPTS) 51 EXTRA_CLEAN = $(INCLUDE_KERNEL) $(INCLUDE_ARCH) $(INCLUDE_LIBARCH) $(COMMON_HEADER_ARCH) $(LINKER_SCRIPTS) 46 52 LIBRARY = libc 53 SLIBRARY = libc.so.0.0 54 LSONAME = libc.so0 55 47 56 48 57 -include $(COMMON_MAKEFILE) 49 58 -include $(CONFIG_MAKEFILE) 50 59 -include arch/$(UARCH)/Makefile.inc 60 61 EXTRA_CFLAGS += -I../../srv/loader/include 51 62 52 63 GENERIC_SOURCES = \ … … 98 109 generic/adt/measured_strings.c \ 99 110 generic/adt/char_map.c \ 111 generic/adt/prodcons.c \ 100 112 generic/time.c \ 101 113 generic/stdlib.c \ … … 114 126 generic/arg_parse.c \ 115 127 generic/sort.c \ 116 generic/stats.c 128 generic/stats.c \ 129 generic/assert.c 130 131 ifeq ($(CONFIG_RTLD), y) 132 GENERIC_SOURCES += \ 133 generic/dlfcn.c \ 134 generic/rtld/rtld.c \ 135 generic/rtld/elf_load.c \ 136 generic/rtld/dynamic.c \ 137 generic/rtld/module.c \ 138 generic/rtld/symbol.c 139 endif 117 140 118 141 SOURCES = \ … … 133 156 ln -sfn ../$< $@ 134 157 135 $(LI NKER_SCRIPT): $(LINKER_SCRIPT).in158 $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 136 159 $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -E -x c $< | grep -v "^\#" > $@ 160 161 $(LIBC_PREFIX)/arch/$(UARCH)/_link-loader.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 162 $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DLOADER -E -x c $< | grep -v "^\#" > $@ 163 164 $(LIBC_PREFIX)/arch/$(UARCH)/_link-shlib.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 165 $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DSHLIB -E -x c $< | grep -v "^\#" > $@ 166 167 $(LIBC_PREFIX)/arch/$(UARCH)/_link-dlexe.ld: $(LIBC_PREFIX)/arch/$(UARCH)/_link.ld.in 168 $(GCC) $(DEFS) $(CFLAGS) -DLIBC_PATH=$(CURDIR) -DDLEXE -E -x c $< | grep -v "^\#" > $@ 137 169 138 170 $(COMMON_HEADER_ARCH): $(COMMON_HEADER)  - 
      
uspace/lib/c/arch/abs32le/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.c \ 31 arch/$(UARCH)/src/entryjmp.c \ 31 32 arch/$(UARCH)/src/thread_entry.c \ 32 33 arch/$(UARCH)/src/fibril.c \  - 
      
uspace/lib/c/arch/abs32le/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 7 text PT_LOAD FILEHDR PHDRS FLAGS(5); 8 #else 5 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 } 8 13 9 14 SECTIONS { 15 #ifdef LOADER 16 .interp : { 17 *(.interp); 18 } :interp 19 20 . = 0x70001000 + SIZEOF_HEADERS; 21 #else 10 22 . = 0x1000 + SIZEOF_HEADERS; 11 23 #endif 12 24 .text : { 13 25 *(.text .text.*);  - 
      
uspace/lib/c/arch/abs32le/src/entryjmp.c
r72cd53d r3375bd4 31 31 32 32 #include <bool.h> 33 #include "arch.h"33 #include <entry_point.h> 34 34 35 void program_run(void *entry_point, void *pcb) 35 /** Jump to program entry point. */ 36 void entry_point_jmp(void *entry_point, void *pcb) 36 37 { 37 38 while (true);  - 
      
uspace/lib/c/arch/amd64/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/syscall.S \  - 
      
uspace/lib/c/arch/amd64/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 7 text PT_LOAD FILEHDR PHDRS FLAGS(5); 8 #else 5 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 debug PT_NOTE; … … 9 14 10 15 SECTIONS { 16 #ifdef LOADER 17 .interp : { 18 *(.interp); 19 } :interp 20 21 . = 0x70001000 + SIZEOF_HEADERS; 22 #else 11 23 . = 0x1000 + SIZEOF_HEADERS; 12 24 #endif 13 25 .init : { 14 26 *(.init);  - 
      
uspace/lib/c/arch/amd64/src/entryjmp.s
r72cd53d r3375bd4 27 27 # 28 28 29 .globl program_run29 .globl entry_point_jmp 30 30 31 ## void program_run(void *entry_point, void *pcb);31 ## void entry_point_jmp(void *entry_point, void *pcb); 32 32 # 33 33 # %rdi contains entry_point 34 34 # %rsi contains pcb 35 35 # 36 # Jump to aprogram entry point37 program_run:36 # Jump to program entry point 37 entry_point_jmp: 38 38 # pcb must be passed in %rdi, use %rdx as a scratch register 39 39 mov %rdi, %rdx  - 
      
uspace/lib/c/arch/arm32/Makefile.inc
r72cd53d r3375bd4 30 30 ARCH_SOURCES = \ 31 31 arch/$(UARCH)/src/entry.s \ 32 arch/$(UARCH)/src/entryjmp.s \ 32 33 arch/$(UARCH)/src/thread_entry.s \ 33 34 arch/$(UARCH)/src/syscall.c \  - 
      
uspace/lib/c/arch/arm32/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 7 text PT_LOAD FILEHDR PHDRS FLAGS(5); 8 #else 5 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 } 8 13 9 14 SECTIONS { 15 #ifdef LOADER 16 .interp : { 17 *(.interp); 18 } :interp 19 20 . = 0x70001000 + SIZEOF_HEADERS; 21 #else 10 22 . = 0x1000 + SIZEOF_HEADERS; 11 23 #endif 12 24 .init : { 13 25 *(.init);  - 
      
uspace/lib/c/arch/arm32/src/entryjmp.s
r72cd53d r3375bd4 27 27 # 28 28 29 .globl program_run29 .globl entry_point_jmp 30 30 31 ## void program_run(void *entry_point, void *pcb);31 ## void entry_point_jmp(void *entry_point, void *pcb); 32 32 # 33 33 # r0 contains entry_point 34 34 # r1 contains pcb 35 35 # 36 # Jump to aprogram entry point37 program_run:36 # Jump to program entry point 37 entry_point_jmp: 38 38 # load ras_page address to r2 39 39 ldr r2, =ras_page  - 
      
uspace/lib/c/arch/ia32/Makefile.common
r72cd53d r3375bd4 28 28 29 29 CLANG_ARCH = i386 30 GCC_CFLAGS += -march=pentium 30 GCC_CFLAGS += -march=pentium -fno-omit-frame-pointer 31 31 32 32 ENDIANESS = LE  - 
      
uspace/lib/c/arch/ia32/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/syscall.S \ … … 35 36 arch/$(UARCH)/src/setjmp.S \ 36 37 arch/$(UARCH)/src/stacktrace.c \ 37 arch/$(UARCH)/src/stacktrace_asm.S 38 arch/$(UARCH)/src/stacktrace_asm.S \ 39 arch/$(UARCH)/src/rtld/dynamic.c \ 40 arch/$(UARCH)/src/rtld/reloc.c 38 41 39 42 .PRECIOUS: arch/$(UARCH)/src/entry.o  - 
      
uspace/lib/c/arch/ia32/_link.ld.in
r72cd53d r3375bd4 1 #ifndef SHLIB 1 2 STARTUP(LIBC_PATH/arch/UARCH/src/entry.o) 2 3 ENTRY(__entry) 4 #endif 3 5 4 6 PHDRS { 7 #if defined(LOADER) || defined(DLEXE) 8 interp PT_INTERP; 9 text PT_LOAD FILEHDR PHDRS FLAGS(5); 10 #else 5 11 text PT_LOAD FLAGS(5); 12 #endif 6 13 data PT_LOAD FLAGS(6); 14 #if defined(SHLIB) || defined(DLEXE) 15 dynamic PT_DYNAMIC; 16 #endif 7 17 debug PT_NOTE; 8 18 } 9 19 10 20 SECTIONS { 21 #if defined(LOADER) || defined(DLEXE) 22 .interp : { 23 *(.interp); 24 } :interp 25 #endif 26 #ifdef LOADER 27 . = 0x70001000 + SIZEOF_HEADERS; 28 #else 11 29 . = 0x1000 + SIZEOF_HEADERS; 12 30 #endif 13 31 .init : { 14 32 *(.init); … … 19 37 *(.rodata .rodata.*); 20 38 } :text 39 40 #if defined(SHLIB) || defined(DLEXE) 41 .rel.plt : { 42 *(.rel.plt); 43 } 44 /* 45 *.rel.dyn MUST FOLLOW IMMEDIATELY after .rel.plt 46 * without alignment gap or DT_REL will be broken 47 */ 48 .rel.dyn : { 49 *(.rel.*); 50 } :text 21 51 52 .plt : { 53 *(.plt); 54 } :text 55 56 .dynsym : { 57 *(.dynsym); 58 } :text 59 60 .dynstr : { 61 *(.dynstr); 62 } :text 63 64 .hash : { 65 *(.hash); 66 } :text 67 #endif 22 68 . = . + 0x1000; 69 70 #if defined(SHLIB) || defined(DLEXE) 71 .dynamic : { 72 *(.dynamic); 73 } :data :dynamic 74 #endif 23 75 24 76 .data : { … … 26 78 } :data 27 79 80 #if defined(SHLIB) || defined(DLEXE) 81 .data.rel : { 82 *(.data.rel .data.rel.*); 83 } :data 84 85 .got : { 86 *(.got); 87 } :data 88 .got.plt : { 89 *(.got.plt); 90 } :data 91 #endif 92 93 #ifndef DLEXE 28 94 .tdata : { 29 95 _tdata_start = .; … … 37 103 38 104 _tls_alignment = ALIGNOF(.tdata); 105 #endif 39 106 40 107 .bss : { 108 *(.dynbss); 41 109 *(COMMON); 42 110 *(.bss);  - 
      
uspace/lib/c/arch/ia32/include/config.h
r72cd53d r3375bd4 36 36 #define LIBC_ia32_CONFIG_H_ 37 37 38 #define PAGE_WIDTH 12 39 #define PAGE_SIZE (1 << PAGE_WIDTH) 38 #define PAGE_WIDTH 12 39 #define PAGE_SIZE (1 << PAGE_WIDTH) 40 41 #define USER_ADDRESS_SPACE_START_ARCH UINT32_C(0x00000000) 42 #define USER_ADDRESS_SPACE_END_ARCH UINT32_C(0x7fffffff) 40 43 41 44 #endif  - 
      
uspace/lib/c/arch/ia32/include/ddi.h
r72cd53d r3375bd4 37 37 #include <libarch/types.h> 38 38 39 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024))39 #define IO_SPACE_BOUNDARY ((void *) (64 * 1024)) 40 40 41 41 static inline uint8_t pio_read_8(ioport8_t *port)  - 
      
uspace/lib/c/arch/ia32/include/faddr.h
r72cd53d r3375bd4 38 38 #include <libarch/types.h> 39 39 40 #define FADDR(fptr) ((uintptr_t) (fptr))40 #define FADDR(fptr) ((uintptr_t) (fptr)) 41 41 42 42 #endif  - 
      
uspace/lib/c/arch/ia32/include/fibril.h
r72cd53d r3375bd4 42 42 * panic sooner or later 43 43 */ 44 #define SP_DELTA (12)44 #define SP_DELTA 12 45 45 46 46 #define context_set(c, _pc, stack, size, ptls) \ … … 51 51 (c)->ebp = 0; \ 52 52 } while (0) 53 54 /* We include only registers that must be preserved 53 54 /* 55 * We include only registers that must be preserved 55 56 * during function call 56 57 */  - 
      
uspace/lib/c/arch/ia32/include/rtld/dynamic.h
r72cd53d r3375bd4 27 27 */ 28 28 29 /** @addtogroup fs29 /** @addtogroup generic 30 30 * @{ 31 31 */ 32 32 /** @file 33 * @brief34 33 */ 35 34 36 #ifndef L OADER_ARCH_H_37 #define L OADER_ARCH_H_35 #ifndef LIBC_ia32_RTLD_DYNAMIC_H_ 36 #define LIBC_ia32_RTLD_DYNAMIC_H_ 38 37 39 extern void program_run(void *entry_point, void *pcb); 38 #include <sys/types.h> 39 40 typedef struct { 41 /* Empty. */ 42 } dyn_info_arch_t; 40 43 41 44 #endif 42 45 43 /** 44 * @} 46 /** @} 45 47 */  - 
      
uspace/lib/c/arch/ia32/src/entryjmp.s
r72cd53d r3375bd4 27 27 # 28 28 29 .globl program_run29 .globl entry_point_jmp 30 30 31 ## void program_run(void *entry_point, void *pcb);31 ## void entry_point_jmp(void *entry_point, void *pcb); 32 32 # 33 # Jump to aprogram entry point34 program_run:33 # Jump to program entry point 34 entry_point_jmp: 35 35 # Use standard ia32 prologue not to confuse anybody 36 36 push %ebp  - 
      
uspace/lib/c/arch/ia32/src/stacktrace.c
r72cd53d r3375bd4 35 35 */ 36 36 37 #include <libarch/config.h> 37 38 #include <sys/types.h> 38 39 #include <bool.h> 39 40 40 #include <stacktrace.h> 41 41 42 #define FRAME_OFFSET_FP_PREV 043 #define FRAME_OFFSET_RA 442 #define FRAME_OFFSET_FP_PREV 0 43 #define FRAME_OFFSET_RA 4 44 44 45 45 bool stacktrace_fp_valid(stacktrace_t *st, uintptr_t fp) 46 46 { 47 47 (void) st; 48 return fp != 0;48 return (fp != 0) && (fp <= USER_ADDRESS_SPACE_END_ARCH); 49 49 } 50 50  - 
      
uspace/lib/c/arch/ia32/src/syscall.S
r72cd53d r3375bd4 32 32 __syscall_fast_func: 33 33 .long __syscall_slow 34 .size __syscall_fast_func, . - __syscall_fast_func 34 35 35 36 .text … … 71 72 */ 72 73 .global __syscall_fast 74 .type __syscall_fast, @function 75 73 76 __syscall_fast: 74 77 pushl %ebx … … 95 98 popl %ebx 96 99 ret 100 101 .size __syscall_fast, . - __syscall_fast  - 
      
uspace/lib/c/arch/ia32/src/tls.c
r72cd53d r3375bd4 37 37 #include <tls.h> 38 38 #include <sys/types.h> 39 #include <align.h> 39 40 40 41 tcb_t * __alloc_tls(void **data, size_t size) … … 48 49 } 49 50 51 /* 52 * Rtld TLS support 53 */ 54 55 typedef struct { 56 unsigned long int ti_module; 57 unsigned long int ti_offset; 58 } tls_index; 59 60 void __attribute__ ((__regparm__ (1))) 61 *___tls_get_addr(tls_index *ti); 62 63 void __attribute__ ((__regparm__ (1))) 64 *___tls_get_addr(tls_index *ti) 65 { 66 size_t tls_size; 67 uint8_t *tls; 68 69 /* Calculate size of TLS block */ 70 tls_size = ALIGN_UP(&_tbss_end - &_tdata_start, &_tls_alignment); 71 72 /* The TLS block is just before TCB */ 73 tls = (uint8_t *)__tcb_get() - tls_size; 74 75 return tls + ti->ti_offset; 76 } 77 50 78 /** @} 51 79 */  - 
      
uspace/lib/c/arch/ia64/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/syscall.S \  - 
      
uspace/lib/c/arch/ia64/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 5 7 text PT_LOAD FLAGS(5); 8 #else 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 } 8 13 9 14 SECTIONS { 15 #ifdef LOADER 16 .interp : { 17 *(.interp); 18 } :interp 19 20 . = 0x800000000 + SIZEOF_HEADERS; 21 #else 10 22 . = 0x4000 + SIZEOF_HEADERS; 11 23 #endif 24 /* 25 * XXX This is just a work around. Problem: .init section does not 26 * have the proper alignment. 27 */ 28 . = ALIGN(., 16); 29 12 30 .init : { 13 31 *(.init); … … 22 40 23 41 .got : { 24 _gp = .; 42 /* Tell the linker where we expect GP to point. */ 43 __gp = .; 25 44 *(.got .got.*); 26 45 } :data  - 
      
uspace/lib/c/arch/ia64/src/entry.s
r72cd53d r3375bd4 39 39 __entry: 40 40 alloc loc0 = ar.pfs, 0, 1, 2, 0 41 movl gp = _ gp41 movl gp = __gp 42 42 43 43 # Pass PCB pointer as the first argument to __main  - 
      
uspace/lib/c/arch/ia64/src/entryjmp.s
r72cd53d r3375bd4 28 28 29 29 .text 30 .globl program_run30 .globl entry_point_jmp 31 31 32 ## void program_run(void *entry_point, void *pcb);32 ## void entry_point_jmp(void *entry_point, void *pcb); 33 33 # 34 34 # in0 (r32) contains entry_point 35 35 # in1 (r33) contains pcb 36 36 # 37 # Jump to aprogram entry point38 program_run:37 # Jump to program entry point 38 entry_point_jmp: 39 39 # Pass pcb to the entry point in r2 40 40  - 
      
uspace/lib/c/arch/ia64/src/thread_entry.s
r72cd53d r3375bd4 37 37 alloc loc0 = ar.pfs, 0, 1, 1, 0 38 38 39 movl gp = _ gp39 movl gp = __gp 40 40 41 41 #  - 
      
uspace/lib/c/arch/mips32/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/syscall.c \  - 
      
uspace/lib/c/arch/mips32/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 7 text PT_LOAD FILEHDR PHDRS FLAGS(5); 8 #else 5 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 } 8 13 9 14 SECTIONS { 15 #ifdef LOADER 16 .interp : { 17 *(.interp); 18 } :interp 19 20 . = 0x70004000 + SIZEOF_HEADERS; 21 #else 10 22 . = 0x4000 + SIZEOF_HEADERS; 11 23 #endif 12 24 .init : { 13 25 *(.init);  - 
      
uspace/lib/c/arch/mips32/src/entryjmp.s
r72cd53d r3375bd4 29 29 .text 30 30 .section .text 31 .global program_run31 .global entry_point_jmp 32 32 .set noreorder 33 33 34 ## void program_run(void *entry_point, void *pcb);34 ## void entry_point_jmp(void *entry_point, void *pcb); 35 35 # 36 36 # $a0 (=$4) contains entry_point 37 37 # $a1 (=$5) contains pcb 38 38 # 39 # Jump to aprogram entry point40 .ent program_run41 program_run:39 # Jump to program entry point 40 .ent entry_point_jmp 41 entry_point_jmp: 42 42 # tmp := entry_point 43 43 move $25, $a0  - 
      
uspace/lib/c/arch/mips32eb/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/syscall.c \  - 
      
uspace/lib/c/arch/ppc32/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/syscall.c \  - 
      
uspace/lib/c/arch/ppc32/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 7 text PT_LOAD FILEHDR PHDRS FLAGS(5); 8 #else 5 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 } 8 13 9 14 SECTIONS { 15 #ifdef LOADER 16 .interp : { 17 *(.interp); 18 } :interp 19 20 . = 0x70001000 + SIZEOF_HEADERS; 21 #else 10 22 . = 0x1000 + SIZEOF_HEADERS; 11 23 #endif 12 24 .init : { 13 25 *(.init);  - 
      
uspace/lib/c/arch/ppc32/src/entryjmp.s
r72cd53d r3375bd4 27 27 # 28 28 29 .globl program_run29 .globl entry_point_jmp 30 30 31 ## void program_run(void *entry_point, void *pcb);31 ## void entry_point_jmp(void *entry_point, void *pcb); 32 32 # 33 33 # %r3 contains entry_point 34 34 # %r4 contains pcb 35 35 # 36 # Jump to aprogram entry point37 program_run:36 # Jump to program entry point 37 entry_point_jmp: 38 38 mtctr %r3 39 39 mr %r6, %r4 # Pass pcb to the entry point in %r6  - 
      
uspace/lib/c/arch/sparc64/Makefile.inc
r72cd53d r3375bd4 29 29 ARCH_SOURCES = \ 30 30 arch/$(UARCH)/src/entry.s \ 31 arch/$(UARCH)/src/entryjmp.s \ 31 32 arch/$(UARCH)/src/thread_entry.s \ 32 33 arch/$(UARCH)/src/fibril.S \  - 
      
uspace/lib/c/arch/sparc64/_link.ld.in
r72cd53d r3375bd4 3 3 4 4 PHDRS { 5 #ifdef LOADER 6 interp PT_INTERP; 7 text PT_LOAD FILEHDR PHDRS FLAGS(5); 8 #else 5 9 text PT_LOAD FLAGS(5); 10 #endif 6 11 data PT_LOAD FLAGS(6); 7 12 } 8 13 9 14 SECTIONS { 15 #ifdef LOADER 16 .interp : { 17 *(.interp); 18 } :interp 19 20 . = 0x70004000 + SIZEOF_HEADERS; 21 #else 10 22 . = 0x4000 + SIZEOF_HEADERS; 11 23 #endif 12 24 .init : { 13 25 *(.init);  - 
      
uspace/lib/c/arch/sparc64/src/entryjmp.s
r72cd53d r3375bd4 27 27 # 28 28 29 .globl program_run29 .globl entry_point_jmp 30 30 31 ## void program_run(void *entry_point, void *pcb);31 ## void entry_point_jmp(void *entry_point, void *pcb); 32 32 # 33 33 # %o0 contains entry_point 34 34 # %o1 contains pcb 35 35 # 36 # Jump to aprogram entry point37 program_run:36 # Jump to program entry point 37 entry_point_jmp: 38 38 # Pass pcb pointer to entry point in %o1. As it is already 39 39 # there, no action is needed.  - 
      
uspace/lib/c/generic/as.c
r72cd53d r3375bd4 52 52 * 53 53 */ 54 void *as_area_create(void *address, size_t size, int flags)54 void *as_area_create(void *address, size_t size, unsigned int flags) 55 55 { 56 56 return (void *) __SYSCALL3(SYS_AS_AREA_CREATE, (sysarg_t) address, … … 68 68 * 69 69 */ 70 int as_area_resize(void *address, size_t size, int flags)70 int as_area_resize(void *address, size_t size, unsigned int flags) 71 71 { 72 72 return __SYSCALL3(SYS_AS_AREA_RESIZE, (sysarg_t) address, … … 96 96 * 97 97 */ 98 int as_area_change_flags(void *address, int flags)98 int as_area_change_flags(void *address, unsigned int flags) 99 99 { 100 100 return __SYSCALL2(SYS_AS_AREA_CHANGE_FLAGS, (sysarg_t) address,  - 
      
uspace/lib/c/generic/async.c
r72cd53d r3375bd4 102 102 #include <arch/barrier.h> 103 103 #include <bool.h> 104 #include <stdlib.h> 105 #include <malloc.h> 104 106 #include "private/async.h" 105 107  - 
      
uspace/lib/c/generic/async_sess.c
r72cd53d r3375bd4 105 105 #include <errno.h> 106 106 #include <assert.h> 107 #include <async.h> 107 108 #include "private/async_sess.h" 108 109  - 
      
uspace/lib/c/generic/errno.c
r72cd53d r3375bd4 36 36 #include <fibril.h> 37 37 38 int _errno; 38 static fibril_local int fibril_errno; 39 40 int *__errno(void) 41 { 42 return &fibril_errno; 43 } 39 44 40 45 /** @}  - 
      
uspace/lib/c/generic/event.c
r72cd53d r3375bd4 41 41 #include <kernel/ipc/event_types.h> 42 42 43 /** Subscribe forevent notifications.43 /** Subscribe event notifications. 44 44 * 45 * @param evno Event number.46 * @param method Use thismethod for notifying me.45 * @param evno Event type to subscribe. 46 * @param imethod Use this interface and method for notifying me. 47 47 * 48 48 * @return Value returned by the kernel. 49 * 49 50 */ 50 int event_subscribe(event_type_t e , sysarg_tmethod)51 int event_subscribe(event_type_t evno, sysarg_t imethod) 51 52 { 52 return __SYSCALL2(SYS_EVENT_SUBSCRIBE, (sysarg_t) e, (sysarg_t) method); 53 return __SYSCALL2(SYS_EVENT_SUBSCRIBE, (sysarg_t) evno, 54 (sysarg_t) imethod); 55 } 56 57 /** Unmask event notifications. 58 * 59 * @param evno Event type to unmask. 60 * 61 * @return Value returned by the kernel. 62 * 63 */ 64 int event_unmask(event_type_t evno) 65 { 66 return __SYSCALL1(SYS_EVENT_UNMASK, (sysarg_t) evno); 53 67 } 54 68  - 
      
uspace/lib/c/generic/fibril_synch.c
r72cd53d r3375bd4 43 43 #include <stacktrace.h> 44 44 #include <stdlib.h> 45 #include <stdio.h> 45 46 #include "private/async.h" 46 47  - 
      
uspace/lib/c/generic/io/io.c
r72cd53d r3375bd4 173 173 } 174 174 *flags = (O_APPEND | O_CREAT) | (plus ? O_RDWR : O_WRONLY); 175 break; 175 176 default: 176 177 errno = EINVAL;  - 
      
uspace/lib/c/generic/libc.c
r72cd53d r3375bd4 53 53 #include "private/io.h" 54 54 55 #ifdef CONFIG_RTLD 56 #include <rtld/rtld.h> 57 #endif 58 55 59 static bool env_setup = false; 56 60 … … 77 81 char **argv; 78 82 83 #ifdef __IN_SHARED_LIBC__ 84 if (__pcb != NULL && __pcb->rtld_runtime != NULL) { 85 runtime_env = (runtime_env_t *) __pcb->rtld_runtime; 86 } 87 #endif 79 88 /* 80 89 * Get command line arguments and initialize  - 
      
uspace/lib/c/generic/malloc.c
r72cd53d r3375bd4 44 44 #include <mem.h> 45 45 #include <futex.h> 46 #include <stdlib.h> 46 47 #include <adt/gcdlcm.h> 47 48 #include "private/malloc.h"  - 
      
uspace/lib/c/generic/stacktrace.c
r72cd53d r3375bd4 61 61 stacktrace_prepare(); 62 62 stacktrace_print_fp_pc(stacktrace_fp_get(), stacktrace_pc_get()); 63 63 64 /* 64 65 * Prevent the tail call optimization of the previous call by 65 66 * making it a non-tail call. 66 67 */ 67 (void) stacktrace_fp_get(); 68 69 printf("-- end of stack trace --\n"); 68 70 } 69 71  - 
      
uspace/lib/c/generic/str.c
r72cd53d r3375bd4 1215 1215 void order_suffix(const uint64_t val, uint64_t *rv, char *suffix) 1216 1216 { 1217 if (val > 10000000000000000000ULL) {1218 *rv = val / 1000000000000000000ULL;1217 if (val > UINT64_C(10000000000000000000)) { 1218 *rv = val / UINT64_C(1000000000000000000); 1219 1219 *suffix = 'Z'; 1220 } else if (val > 1000000000000000000ULL) {1221 *rv = val / 1000000000000000ULL;1220 } else if (val > UINT64_C(1000000000000000000)) { 1221 *rv = val / UINT64_C(1000000000000000); 1222 1222 *suffix = 'E'; 1223 } else if (val > 1000000000000000ULL) {1224 *rv = val / 1000000000000ULL;1223 } else if (val > UINT64_C(1000000000000000)) { 1224 *rv = val / UINT64_C(1000000000000); 1225 1225 *suffix = 'T'; 1226 } else if (val > 1000000000000ULL) {1227 *rv = val / 1000000000ULL;1226 } else if (val > UINT64_C(1000000000000)) { 1227 *rv = val / UINT64_C(1000000000); 1228 1228 *suffix = 'G'; 1229 } else if (val > 1000000000ULL) {1230 *rv = val / 1000000ULL;1229 } else if (val > UINT64_C(1000000000)) { 1230 *rv = val / UINT64_C(1000000); 1231 1231 *suffix = 'M'; 1232 } else if (val > 1000000ULL) {1233 *rv = val / 1000ULL;1232 } else if (val > UINT64_C(1000000)) { 1233 *rv = val / UINT64_C(1000); 1234 1234 *suffix = 'k'; 1235 1235 } else { … … 1239 1239 } 1240 1240 1241 void bin_order_suffix(const uint64_t val, uint64_t *rv, const char **suffix, 1242 bool fixed) 1243 { 1244 if (val > UINT64_C(1152921504606846976)) { 1245 *rv = val / UINT64_C(1125899906842624); 1246 *suffix = "EiB"; 1247 } else if (val > UINT64_C(1125899906842624)) { 1248 *rv = val / UINT64_C(1099511627776); 1249 *suffix = "TiB"; 1250 } else if (val > UINT64_C(1099511627776)) { 1251 *rv = val / UINT64_C(1073741824); 1252 *suffix = "GiB"; 1253 } else if (val > UINT64_C(1073741824)) { 1254 *rv = val / UINT64_C(1048576); 1255 *suffix = "MiB"; 1256 } else if (val > UINT64_C(1048576)) { 1257 *rv = val / UINT64_C(1024); 1258 *suffix = "KiB"; 1259 } else { 1260 *rv = val; 1261 if (fixed) 1262 *suffix = "B "; 1263 else 1264 *suffix = "B"; 1265 } 1266 } 1267 1241 1268 /** @} 1242 1269 */  - 
      
uspace/lib/c/include/adt/fifo.h
r72cd53d r3375bd4 51 51 typedef unsigned long fifo_index_t; 52 52 53 #define FIFO_CREATE_STATIC(name, t, itms) \54 struct { \55 t fifo[(itms)]; \56 fifo_count_t items; \57 fifo_index_t head; \58 fifo_index_t tail; \53 #define FIFO_CREATE_STATIC(name, t, itms) \ 54 struct { \ 55 t fifo[(itms)]; \ 56 fifo_count_t items; \ 57 fifo_index_t head; \ 58 fifo_index_t tail; \ 59 59 } name 60 60  - 
      
uspace/lib/c/include/adt/list.h
r72cd53d r3375bd4 47 47 * 48 48 * @param name Name of the new statically allocated list. 49 * 49 50 */ 50 51 #define LIST_INITIALIZE(name) link_t name = { \ … … 58 59 * 59 60 * @param link Pointer to link_t structure to be initialized. 61 * 60 62 */ 61 63 static inline void link_initialize(link_t *link) … … 70 72 * 71 73 * @param head Pointer to link_t structure representing head of the list. 74 * 72 75 */ 73 76 static inline void list_initialize(link_t *head) … … 83 86 * @param link Pointer to link_t structure to be added. 84 87 * @param head Pointer to link_t structure representing head of the list. 88 * 85 89 */ 86 90 static inline void list_prepend(link_t *link, link_t *head) … … 98 102 * @param link Pointer to link_t structure to be added. 99 103 * @param head Pointer to link_t structure representing head of the list. 104 * 100 105 */ 101 106 static inline void list_append(link_t *link, link_t *head) … … 123 128 * Remove item from doubly-linked circular list. 124 129 * 125 * @param link Pointer to link_t structure to be removed from the list it is contained in. 130 * @param link Pointer to link_t structure to be removed from the list 131 * it is contained in. 132 * 126 133 */ 127 134 static inline void list_remove(link_t *link) … … 137 144 * 138 145 * @param head Pointer to link_t structure representing head of the list. 146 * 139 147 */ 140 148 static inline int list_empty(link_t *head) … … 142 150 return ((head->next == head) ? 1 : 0); 143 151 } 144 145 152 146 153 /** Split or concatenate headless doubly-linked circular list … … 151 158 * concatenates splitted lists and splits concatenated lists. 152 159 * 153 * @param part1 Pointer to link_t structure leading the first (half of the headless) list. 154 * @param part2 Pointer to link_t structure leading the second (half of the headless) list. 160 * @param part1 Pointer to link_t structure leading the first 161 * (half of the headless) list. 162 * @param part2 Pointer to link_t structure leading the second 163 * (half of the headless) list. 164 * 155 165 */ 156 166 static inline void headless_list_split_or_concat(link_t *part1, link_t *part2) … … 165 175 } 166 176 167 168 177 /** Split headless doubly-linked circular list 169 178 * 170 179 * Split headless doubly-linked circular list. 171 180 * 172 * @param part1 Pointer to link_t structure leading the first half of the headless list. 173 * @param part2 Pointer to link_t structure leading the second half of the headless list. 181 * @param part1 Pointer to link_t structure leading 182 * the first half of the headless list. 183 * @param part2 Pointer to link_t structure leading 184 * the second half of the headless list. 185 * 174 186 */ 175 187 static inline void headless_list_split(link_t *part1, link_t *part2) … … 182 194 * Concatenate two headless doubly-linked circular lists. 183 195 * 184 * @param part1 Pointer to link_t structure leading the first headless list. 185 * @param part2 Pointer to link_t structure leading the second headless list. 196 * @param part1 Pointer to link_t structure leading 197 * the first headless list. 198 * @param part2 Pointer to link_t structure leading 199 * the second headless list. 200 * 186 201 */ 187 202 static inline void headless_list_concat(link_t *part1, link_t *part2) … … 190 205 } 191 206 192 #define list_get_instance(link, type, member) ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member)))) 193 194 extern int list_member(const link_t *link, const link_t *head); 195 extern void list_concat(link_t *head1, link_t *head2); 196 extern unsigned int list_count(const link_t *link); 207 #define list_get_instance(link, type, member) \ 208 ((type *) (((void *)(link)) - ((void *) &(((type *) NULL)->member)))) 209 210 #define list_foreach(list, iterator) \ 211 for (link_t *iterator = (list).next; \ 212 iterator != &(list); iterator = iterator->next) 213 214 extern int list_member(const link_t *, const link_t *); 215 extern void list_concat(link_t *, link_t *); 216 extern unsigned int list_count(const link_t *); 197 217 198 218 #endif  - 
      
uspace/lib/c/include/adt/measured_strings.h
r72cd53d r3375bd4 61 61 extern measured_string_t *measured_string_create_bulk(const uint8_t *, size_t); 62 62 extern measured_string_t *measured_string_copy(measured_string_t *); 63 63 64 extern int measured_strings_receive(measured_string_t **, uint8_t **, size_t); 64 65 extern int measured_strings_reply(const measured_string_t *, size_t);  - 
      
uspace/lib/c/include/as.h
r72cd53d r3375bd4 54 54 } 55 55 56 extern void *as_area_create(void * address, size_t size, int flags);57 extern int as_area_resize(void * address, size_t size, int flags);58 extern int as_area_change_flags(void * address, int flags);59 extern int as_area_destroy(void * address);60 extern void *set_maxheapsize(size_t mhs);61 extern void * as_get_mappable_page(size_t sz);62 extern int as_get_physical_mapping(void * address, uintptr_t *frame);56 extern void *as_area_create(void *, size_t, unsigned int); 57 extern int as_area_resize(void *, size_t, unsigned int); 58 extern int as_area_change_flags(void *, unsigned int); 59 extern int as_area_destroy(void *); 60 extern void *set_maxheapsize(size_t); 61 extern void * as_get_mappable_page(size_t); 62 extern int as_get_physical_mapping(void *, uintptr_t *); 63 63 64 64 #endif  - 
      
uspace/lib/c/include/assert.h
r72cd53d r3375bd4 40 40 * 41 41 * If NDEBUG is not set, the assert() macro 42 * evaluates expr and if it is false prints 42 * evaluates expr and if it is false prints 43 43 * error message and terminate program. 44 44 * … … 47 47 */ 48 48 49 #include <stdio.h>50 #include <stdlib.h>51 52 49 #ifndef NDEBUG 53 50 54 51 #define assert(expr) \ 55 52 do { \ 56 if (!(expr)) { \ 57 printf("Assertion failed (%s) at file '%s', " \ 58 "line %d.\n", #expr, __FILE__, __LINE__); \ 59 abort(); \ 60 } \ 53 if (!(expr)) \ 54 assert_abort(#expr, __FILE__, __LINE__); \ 61 55 } while (0) 62 56 … … 67 61 #endif /* NDEBUG */ 68 62 63 extern void assert_abort(const char *, const char *, unsigned int) 64 __attribute__((noreturn)); 65 69 66 #endif 70 67  - 
      
uspace/lib/c/include/entry_point.h
r72cd53d r3375bd4 1 1 /* 2 * Copyright (c) 20 06 Jakub Jermar2 * Copyright (c) 2011 Jiri Svoboda 3 3 * All rights reserved. 4 4 * … … 27 27 */ 28 28 29 /** @addtogroup sparc64mm29 /** @addtogroup libc 30 30 * @{ 31 31 */ … … 33 33 */ 34 34 35 #ifndef KERN_sparc64_CACHE_H_36 #define KERN_sparc64_CACHE_H_35 #ifndef LIBC_ENTRY_POINT_H_ 36 #define LIBC_ENTRY_POINT_H_ 37 37 38 #include <mm/page.h> 39 #include <mm/frame.h> 38 /* Defined in arch/ARCH/src/entryjmp.[c|s] */ 39 void entry_point_jmp(void *, void *); 40 40 41 41 #endif  - 
      
uspace/lib/c/include/errno.h
r72cd53d r3375bd4 39 39 #include <fibril.h> 40 40 41 #define errno _errno41 #define errno (*(__errno())) 42 42 43 extern int _errno;43 extern int *__errno(void) __attribute__((const)); 44 44 45 45 #define EMFILE (-18)  - 
      
uspace/lib/c/include/event.h
r72cd53d r3375bd4 39 39 40 40 extern int event_subscribe(event_type_t, sysarg_t); 41 extern int event_unmask(event_type_t); 41 42 42 43 #endif  - 
      
uspace/lib/c/include/fibril.h
r72cd53d r3375bd4 70 70 int (*func)(void *); 71 71 tcb_t *tcb; 72 72 73 73 struct fibril *clean_after_me; 74 74 int retval; 75 75 int flags; 76 76 77 77 fibril_owner_info_t *waits_for; 78 78 } fibril_t;  - 
      
uspace/lib/c/include/fibril_synch.h
r72cd53d r3375bd4 36 36 #define LIBC_FIBRIL_SYNCH_H_ 37 37 38 #include <async.h>39 38 #include <fibril.h> 40 39 #include <adt/list.h> 41 40 #include <libarch/tls.h> 42 41 #include <sys/time.h> 42 #include <bool.h> 43 43 44 44 typedef struct { 45 fibril_owner_info_t oi; /*Keep this the first thing. */45 fibril_owner_info_t oi; /**< Keep this the first thing. */ 46 46 int counter; 47 47 link_t waiters; … … 64 64 65 65 typedef struct { 66 fibril_owner_info_t oi; /*Keep this the first thing. */66 fibril_owner_info_t oi; /**< Keep this the first thing. */ 67 67 unsigned writers; 68 68 unsigned readers;  - 
      
uspace/lib/c/include/loader/pcb.h
r72cd53d r3375bd4 72 72 /** Pointer to ELF dynamic section of the program. */ 73 73 void *dynamic; 74 /** Pointer to dynamic linker state structure (runtime_env_t). */ 75 void *rtld_runtime; 74 76 } pcb_t; 75 77  - 
      
uspace/lib/c/include/macros.h
r72cd53d r3375bd4 39 39 #define max(a, b) ((a) > (b) ? (a) : (b)) 40 40 41 #define SIZE2KB(size) ((size) >> 10) 42 #define SIZE2MB(size) ((size) >> 20) 43 44 #define KB2SIZE(kb) ((kb) << 10) 45 #define MB2SIZE(mb) ((mb) << 20) 41 #define KiB2SIZE(kb) ((kb) << 10) 42 #define MiB2SIZE(mb) ((mb) << 20) 46 43 47 44 #define STRING(arg) STRING_ARG(arg)  - 
      
uspace/lib/c/include/str.h
r72cd53d r3375bd4 89 89 extern int str_size_t(const char *, char **, unsigned int, bool, size_t *); 90 90 91 extern void order_suffix(const uint64_t val, uint64_t *rv, char *suffix); 91 extern void order_suffix(const uint64_t, uint64_t *, char *); 92 extern void bin_order_suffix(const uint64_t, uint64_t *, const char **, bool); 92 93 93 94 /*  
  Note:
 See   TracChangeset
 for help on using the changeset viewer.
  