Changeset 40abf56 in mainline for uspace/lib/c/generic/libc.c
- Timestamp:
- 2018-07-18T19:42:28Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 9bde0d5
- Parents:
- 0b05082
- git-author:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-18 19:05:08)
- git-committer:
- Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-18 19:42:28)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/libc.c
r0b05082 r40abf56 63 63 progsymbols_t __progsymbols; 64 64 65 static bool env_setup = false; 65 static bool env_setup; 66 static fibril_t main_fibril; 66 67 67 68 void __libc_main(void *pcb_ptr) 68 69 { 70 assert(!__tcb_is_set()); 71 72 __pcb = (pcb_t *) pcb_ptr; 73 74 if (__pcb) { 75 main_fibril.tcb = __pcb->tcb; 76 } else { 77 /* 78 * Loaded by kernel, not the loader. 79 * Kernel only supports loading fully static binaries, 80 * so we can do basic initialization without worrying about 81 * dynamic libraries. 82 */ 83 84 main_fibril.tcb = tls_make_initial(__progsymbols.elfstart); 85 } 86 87 assert(main_fibril.tcb); 88 89 /* Initialize the fibril. */ 90 main_fibril.tcb->fibril_data = &main_fibril; 91 __tcb_set(main_fibril.tcb); 92 fibril_setup(&main_fibril); 93 69 94 /* Initialize user task run-time environment */ 70 95 __malloc_init(); 71 72 /* Save the PCB pointer */73 __pcb = (pcb_t *) pcb_ptr;74 96 75 97 #ifdef CONFIG_RTLD … … 81 103 } 82 104 #endif 83 84 fibril_t *fibril = fibril_setup();85 if (fibril == NULL)86 abort();87 88 __tcb_set(fibril->tcb);89 105 90 106 __async_server_init(); … … 151 167 __stdio_done(); 152 168 task_retval(status); 153 fibril_teardown(__tcb_get()->fibril_data, false);154 169 } 155 170
Note:
See TracChangeset
for help on using the changeset viewer.