Changeset 09ab0a9a in mainline for uspace/lib/c/generic
- Timestamp:
- 2018-09-13T12:05:53Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- cc74cb5
- Parents:
- b2aaaa0
- git-author:
- Jiri Svoboda <jiri@…> (2018-09-13 07:09:46)
- git-committer:
- Jiri Svoboda <jiri@…> (2018-09-13 12:05:53)
- Location:
- uspace/lib/c/generic
- Files:
-
- 32 edited
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/generic/adt/hash_table.c
rb2aaaa0 r09ab0a9a 60 60 #define HT_MAX_LOAD 2 61 61 62 63 62 static size_t round_up_size(size_t); 64 63 static bool alloc_table(size_t, list_t **); … … 73 72 /* no-op */ 74 73 } 75 76 74 77 75 /** Create chained hash table. … … 205 203 } 206 204 207 208 205 /** Insert item into a hash table if not already present. 209 206 * … … 413 410 } 414 411 415 416 412 /** Shrinks the table if the table is only sparely populated. */ 417 413 static inline void shrink_if_needed(hash_table_t *h) … … 473 469 } 474 470 475 476 471 /** @} 477 472 */ -
uspace/lib/c/generic/adt/odict.c
rb2aaaa0 r09ab0a9a 265 265 } 266 266 } 267 268 267 269 268 odlink->color = odc_red; -
uspace/lib/c/generic/crt/entry.c
rb2aaaa0 r09ab0a9a 66 66 __libc_main(pcb); 67 67 } 68 -
uspace/lib/c/generic/ddi.c
rb2aaaa0 r09ab0a9a 48 48 #include <libarch/config.h> 49 49 #include "private/libc.h" 50 51 50 52 51 /** Map a piece of physical memory to task. -
uspace/lib/c/generic/device/clock_dev.c
rb2aaaa0 r09ab0a9a 103 103 /** @} 104 104 */ 105 -
uspace/lib/c/generic/device/pio_window.c
rb2aaaa0 r09ab0a9a 60 60 /** @} 61 61 */ 62 -
uspace/lib/c/generic/double_to_str.c
rb2aaaa0 r09ab0a9a 52 52 static const int gamma = -32; 53 53 54 55 54 /** Returns true if the most-significant bit of num.significand is set. */ 56 55 static bool is_normalized(fp_num_t num) … … 80 79 return num; 81 80 } 82 83 81 84 82 /** Returns x * y with an error of less than 0.5 ulp. */ … … 130 128 } 131 129 132 133 130 /** Returns a - b. Both must have the same exponent. */ 134 131 static fp_num_t subtract(fp_num_t a, fp_num_t b) … … 144 141 return result; 145 142 } 146 147 143 148 144 /** Returns the interval [low, high] of numbers that convert to binary val. */ … … 248 244 *scaled_upper_bound = upper_scaled; 249 245 } 250 251 246 252 247 /** Rounds the last digit of buf so that it is closest to the converted number.*/ … … 299 294 } 300 295 301 302 296 /** Generates the shortest accurate decimal string representation. 303 297 * … … 478 472 } 479 473 480 481 474 /** Converts a non-special double into its shortest accurate string 482 475 * representation. … … 698 691 } 699 692 } 700 701 693 702 694 /** Converts a non-special double into its string representation. … … 792 784 return len; 793 785 } 794 -
uspace/lib/c/generic/elf/elf.c
rb2aaaa0 r09ab0a9a 111 111 /** @} 112 112 */ 113 -
uspace/lib/c/generic/getopt.c
rb2aaaa0 r09ab0a9a 53 53 char *optarg; /* argument associated with option */ 54 54 55 56 55 #define IGNORE_FIRST (*options == '-' || *options == '+') 57 56 #define PRINT_ERROR ((opterr) && ((*options != ':') \ … … 95 94 static const char illoptchar[] = "unknown option -- %c\n"; 96 95 static const char illoptstring[] = "unknown option -- %s\n"; 97 98 96 99 97 /* … … 461 459 #undef IDENTICAL_INTERPRETATION 462 460 } 463 -
uspace/lib/c/generic/ieee_double.c
rb2aaaa0 r09ab0a9a 113 113 return ret; 114 114 } 115 -
uspace/lib/c/generic/inet/host.c
rb2aaaa0 r09ab0a9a 75 75 goto have_host; 76 76 } 77 78 77 79 78 /* Try <hostname> */ -
uspace/lib/c/generic/io/io.c
rb2aaaa0 r09ab0a9a 421 421 } 422 422 423 424 423 static int _fclose_nofree(FILE *stream) 425 424 { … … 651 650 return (total_read / size); 652 651 } 653 654 652 655 653 /** Write to a stream. -
uspace/lib/c/generic/io/printf_core.c
rb2aaaa0 r09ab0a9a 49 49 #include <wchar.h> 50 50 51 52 51 /** show prefixes 0x or 0 */ 53 52 #define __PRINTF_FLAG_PREFIX 0x00000001 … … 79 78 /** don't print trailing zeros in the fractional part */ 80 79 #define __PRINTF_FLAG_NOFRACZEROS 0x00000200 81 82 80 83 81 /** … … 125 123 static const char invalch = U_SPECIAL; 126 124 127 128 129 125 /** Unformatted double number string representation. */ 130 126 typedef struct { … … 139 135 } double_str_t; 140 136 141 142 143 137 /** Returns the sign character or 0 if no sign should be printed. */ 144 138 static int get_sign_char(bool negative, uint32_t flags) … … 166 160 return count; 167 161 } 168 169 162 170 163 /** Print one or more characters without adding newline. … … 634 627 counter += ret; 635 628 636 637 629 /* Trailing padding. */ 638 630 if (flags & __PRINTF_FLAG_LEFTALIGNED) { … … 698 690 } 699 691 700 701 692 /** Format and print the double string repressentation according 702 693 * to the %f specifier. … … 825 816 return counter; 826 817 } 827 828 818 829 819 /** Convert, format and print a double according to the %f specifier. … … 934 924 } 935 925 936 937 926 /** Format and print the double string repressentation according 938 927 * to the %e specifier. … … 1038 1027 return counter; 1039 1028 } 1040 1041 1029 1042 1030 /** Convert, format and print a double according to the %e specifier. … … 1113 1101 } 1114 1102 1115 1116 1103 /** Convert, format and print a double according to the %g specifier. 1117 1104 * … … 1193 1180 } 1194 1181 } 1195 1196 1182 1197 1183 /** Convert, format and print a double according to the specifier. -
uspace/lib/c/generic/loader.c
rb2aaaa0 r09ab0a9a 207 207 } 208 208 209 210 209 /** Set command-line arguments for the program. 211 210 * -
uspace/lib/c/generic/loc.c
rb2aaaa0 r09ab0a9a 86 86 } 87 87 88 89 88 static void clone_session(fibril_mutex_t *mtx, async_sess_t *src, 90 89 async_sess_t **dst) … … 546 545 return retval; 547 546 } 548 549 547 550 548 loc_object_type_t loc_id_probe(service_id_t handle) -
uspace/lib/c/generic/ns.c
rb2aaaa0 r09ab0a9a 155 155 } 156 156 157 158 157 errno_t ns_ping(void) 159 158 { -
uspace/lib/c/generic/pio_trace.c
rb2aaaa0 r09ab0a9a 40 40 #include <ddi.h> 41 41 #include <str.h> 42 43 42 44 43 typedef struct { … … 90 89 } 91 90 92 93 91 void pio_trace_log(const volatile void *r, uint64_t val, bool write) 94 92 { -
uspace/lib/c/generic/power_of_ten.c
rb2aaaa0 r09ab0a9a 143 143 }; 144 144 145 146 145 /** 147 146 * Returns the smallest precomputed power of 10 such that … … 185 184 assert(false); 186 185 } 187 -
uspace/lib/c/generic/private/fibril.h
rb2aaaa0 r09ab0a9a 131 131 extern void fibril_rmutex_unlock(fibril_rmutex_t *); 132 132 133 134 133 #endif -
uspace/lib/c/generic/rtld/module.c
rb2aaaa0 r09ab0a9a 204 204 str_cpy(name_buf + 5, NAME_BUF_SIZE - 5, name); 205 205 206 207 206 DPRINTF("filename:'%s'\n", name_buf); 208 207 -
uspace/lib/c/generic/rtld/symbol.c
rb2aaaa0 r09ab0a9a 182 182 return sym; /* Symbol found */ 183 183 } 184 185 184 186 185 /** Find the definition of a symbol. -
uspace/lib/c/generic/stdio.c
rb2aaaa0 r09ab0a9a 172 172 } 173 173 174 175 174 /** @} 176 175 */ -
uspace/lib/c/generic/str.c
rb2aaaa0 r09ab0a9a 1016 1016 } 1017 1017 1018 1019 1018 /** Convert wide string to new string. 1020 1019 * … … 1064 1063 return str; 1065 1064 } 1066 1067 1065 1068 1066 /** Convert string to wide string. … … 1293 1291 return true; 1294 1292 } 1295 1296 1293 1297 1294 /** Duplicate string. -
uspace/lib/c/generic/thread/fibril.c
rb2aaaa0 r09ab0a9a 283 283 */ 284 284 285 286 285 if (!locked) 287 286 futex_lock(&fibril_futex); … … 330 329 331 330 futex_lock(&ipc_lists_futex); 332 333 331 334 332 _ipc_waiter_t *w = list_pop(&ipc_waiter_list, _ipc_waiter_t, link); -
uspace/lib/c/generic/thread/fibril_synch.c
rb2aaaa0 r09ab0a9a 126 126 } 127 127 } 128 129 128 130 129 static void check_fibril_for_deadlock(fibril_owner_info_t *oi, fibril_t *fib) -
uspace/lib/c/generic/thread/mpsc.c
rb2aaaa0 r09ab0a9a 181 181 _mpsc_push(q, q->close_node); 182 182 } 183 -
uspace/lib/c/generic/thread/rcu.c
rb2aaaa0 r09ab0a9a 81 81 #include "../private/fibril.h" 82 82 83 84 83 /** RCU sleeps for RCU_SLEEP_MS before polling an active RCU reader again. */ 85 84 #define RCU_SLEEP_MS 10 … … 90 89 #define RCU_GROUP_A (size_t)(0 | RCU_NESTING_INC) 91 90 #define RCU_GROUP_B (size_t)(1 | RCU_NESTING_INC) 92 93 91 94 92 /** Fibril local RCU data. */ … … 118 116 } blocked_fibril_t; 119 117 120 121 118 /** Fibril local RCU data. */ 122 119 static fibril_local fibril_rcu_data_t fibril_rcu = { … … 142 139 }; 143 140 144 145 141 static void wait_for_readers(size_t reader_group); 146 142 static void force_mb_in_all_threads(void); … … 154 150 static bool is_in_reader_section(size_t nesting_cnt); 155 151 static size_t get_other_group(size_t group); 156 157 152 158 153 /** Registers a fibril so it may start using RCU read sections. … … 409 404 } 410 405 411 412 406 static bool is_preexisting_reader(const fibril_rcu_data_t *fib, size_t group) 413 407 { … … 435 429 } 436 430 437 438 439 431 /** @} 440 432 */ -
uspace/lib/c/generic/time.c
rb2aaaa0 r09ab0a9a 380 380 } 381 381 382 383 382 /** Which day the week-based year starts on. 384 383 * -
uspace/lib/c/generic/ubsan.c
rb2aaaa0 r09ab0a9a 228 228 ubsan_panic(); 229 229 } 230 -
uspace/lib/c/generic/uuid.c
rb2aaaa0 r09ab0a9a 181 181 } 182 182 183 184 183 /** @} 185 184 */ -
uspace/lib/c/generic/vbd.c
rb2aaaa0 r09ab0a9a 358 358 } 359 359 360 361 360 /** @} 362 361 */ -
uspace/lib/c/generic/vfs/vfs.c
rb2aaaa0 r09ab0a9a 397 397 } 398 398 399 400 399 /** Return a list of currently available file system types 401 400 * … … 746 745 } 747 746 748 749 747 /** Open a file handle for I/O 750 748 *
Note:
See TracChangeset
for help on using the changeset viewer.