Changeset 1b20da0 in mainline for uspace/lib/c/include
- Timestamp:
- 2018-02-28T17:52:03Z (8 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 3061bc1
- Parents:
- df6ded8
- git-author:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:26:03)
- git-committer:
- Jiří Zárevúcky <zarevucky.jiri@…> (2018-02-28 17:52:03)
- Location:
- uspace/lib/c/include
- Files:
-
- 15 edited
-
adt/fifo.h (modified) (2 diffs)
-
adt/hash.h (modified) (5 diffs)
-
adt/hash_table.h (modified) (2 diffs)
-
adt/list.h (modified) (3 diffs)
-
device/hw_res_parsed.h (modified) (1 diff)
-
device/pio_window.h (modified) (1 diff)
-
devman.h (modified) (1 diff)
-
double_to_str.h (modified) (3 diffs)
-
fibril.h (modified) (1 diff)
-
fibril_synch.h (modified) (2 diffs)
-
ieee_double.h (modified) (1 diff)
-
offset.h (modified) (1 diff)
-
rcu.h (modified) (5 diffs)
-
vfs/canonify.h (modified) (1 diff)
-
vfs/inbox.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
uspace/lib/c/include/adt/fifo.h
rdf6ded8 r1b20da0 78 78 * 79 79 * FIFO is allocated dynamically. 80 * This macro is suitable for creating larger FIFOs. 80 * This macro is suitable for creating larger FIFOs. 81 81 * 82 82 * @param name Name of FIFO. … … 113 113 */ 114 114 #define fifo_push(name, value) \ 115 name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value) 115 name.fifo[name.tail = (name.tail + 1) < name.items ? (name.tail + 1) : 0] = (value) 116 116 117 117 /** Allocate memory for dynamic FIFO. -
uspace/lib/c/include/adt/hash.h
rdf6ded8 r1b20da0 46 46 * Public domain. 47 47 */ 48 hash = ~hash + (hash << 15); 48 hash = ~hash + (hash << 15); 49 49 hash = hash ^ (hash >> 12); 50 50 hash = hash + (hash << 2); 51 51 hash = hash ^ (hash >> 4); 52 hash = hash * 2057; 52 hash = hash * 2057; 53 53 hash = hash ^ (hash >> 16); 54 return hash; 54 return hash; 55 55 } 56 56 … … 66 66 hash = hash ^ (hash >> 4); 67 67 hash = hash * 0x27d4eb2d; 68 hash = hash ^ (hash >> 15); 69 /* 68 hash = hash ^ (hash >> 15); 69 /* 70 70 * Lower order bits are mixed more thoroughly. Swap them with 71 71 * the higher order bits and make the resulting higher order bits … … 76 76 77 77 /** Produces a uniform hash affecting all output bits from the skewed input. */ 78 static inline size_t hash_mix(size_t hash) 78 static inline size_t hash_mix(size_t hash) 79 79 { 80 80 #ifdef __32_BITS__ … … 88 88 89 89 /** Use to create a hash from multiple values. 90 * 90 * 91 91 * Typical usage: 92 92 * @code … … 102 102 static inline size_t hash_combine(size_t seed, size_t hash) 103 103 { 104 /* 104 /* 105 105 * todo: use Bob Jenkin's proper mixing hash pass: 106 106 * http://burtleburtle.net/bob/c/lookup3.c 107 107 */ 108 seed ^= hash + 0x9e3779b9 108 seed ^= hash + 0x9e3779b9 109 109 + ((seed << 5) | (seed >> (sizeof(size_t) * 8 - 5))); 110 return seed; 110 return seed; 111 111 } 112 112 -
uspace/lib/c/include/adt/hash_table.h
rdf6ded8 r1b20da0 2 2 * Copyright (c) 2006 Jakub Jermar 3 3 * Copyright (c) 2012 Adam Hraska 4 * 4 * 5 5 * All rights reserved. 6 6 * … … 62 62 63 63 /** Hash table item removal callback. 64 * 64 * 65 65 * Must not invoke any mutating functions of the hash table. 66 66 * -
uspace/lib/c/include/adt/list.h
rdf6ded8 r1b20da0 66 66 67 67 /** Initializer for statically allocated list. 68 * 68 * 69 69 * @code 70 70 * struct named_list { 71 71 * const char *name; 72 72 * list_t list; 73 * } var = { 74 * .name = "default name", 75 * .list = LIST_INITIALIZER(name_list.list) 73 * } var = { 74 * .name = "default name", 75 * .list = LIST_INITIALIZER(name_list.list) 76 76 * }; 77 77 * @endcode … … 111 111 * link_t item_link; 112 112 * } item_t; 113 * 113 * 114 114 * //.. 115 * 115 * 116 116 * // Print each list element's value and remove the element from the list. 117 117 * list_foreach_safe(mylist, cur_link, next_link) { … … 121 121 * } 122 122 * @endcode 123 * 123 * 124 124 * @param list List to traverse. 125 125 * @param iterator Iterator to the current element of the list. -
uspace/lib/c/include/device/hw_res_parsed.h
rdf6ded8 r1b20da0 54 54 55 55 typedef struct address64 { 56 /** Aboslute address. */ 56 /** Aboslute address. */ 57 57 uint64_t absolute; 58 58 /** PIO window base relative address. */ 59 uint64_t relative; 59 uint64_t relative; 60 60 } address64_t; 61 61 -
uspace/lib/c/include/device/pio_window.h
rdf6ded8 r1b20da0 1 1 /* 2 * Copyright (c) 2013 Jakub Jermar 2 * Copyright (c) 2013 Jakub Jermar 3 3 * All rights reserved. 4 4 * -
uspace/lib/c/include/devman.h
rdf6ded8 r1b20da0 1 1 /* 2 2 * Copyright (c) 2009 Jiri Svoboda 3 * Copyright (c) 2010 Lenka Trochtova 3 * Copyright (c) 2010 Lenka Trochtova 4 4 * All rights reserved. 5 5 * -
uspace/lib/c/include/double_to_str.h
rdf6ded8 r1b20da0 32 32 #include <stddef.h> 33 33 34 /** Maximum number of digits double_to_*_str conversion functions produce. 34 /** Maximum number of digits double_to_*_str conversion functions produce. 35 35 * 36 36 * Both double_to_short_str and double_to_fixed_str generate digits out 37 * of a 64bit unsigned int number representation. The max number of 37 * of a 64bit unsigned int number representation. The max number of 38 38 * of digits is therefore 20. Add 1 to help users who forget to reserve 39 39 * space for a null terminator. … … 41 41 #define MAX_DOUBLE_STR_LEN (20 + 1) 42 42 43 /** Maximum buffer size needed to store the output of double_to_*_str 44 * functions. 43 /** Maximum buffer size needed to store the output of double_to_*_str 44 * functions. 45 45 */ 46 46 #define MAX_DOUBLE_STR_BUF_SIZE 21 … … 53 53 size_t, int *); 54 54 55 #endif 55 #endif -
uspace/lib/c/include/fibril.h
rdf6ded8 r1b20da0 48 48 } while (0) 49 49 50 #define FIBRIL_WRITER 1 50 #define FIBRIL_WRITER 1 51 51 52 52 struct fibril; -
uspace/lib/c/include/fibril_synch.h
rdf6ded8 r1b20da0 1 1 /* 2 * Copyright (c) 2009 Jakub Jermar 2 * Copyright (c) 2009 Jakub Jermar 3 3 * All rights reserved. 4 4 * … … 63 63 64 64 #define FIBRIL_MUTEX_INITIALIZE(name) \ 65 fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) 65 fibril_mutex_t name = FIBRIL_MUTEX_INITIALIZER(name) 66 66 67 67 typedef struct { -
uspace/lib/c/include/ieee_double.h
rdf6ded8 r1b20da0 53 53 bool is_denormal; 54 54 /** 55 * The predecessor double is closer than the successor. This happens 55 * The predecessor double is closer than the successor. This happens 56 56 * if a normal number is of the form 2^k and it is not the smallest 57 * normal number. 57 * normal number. 58 58 */ 59 59 bool is_accuracy_step; 60 /** 60 /** 61 61 * If !is_special the double's value is: 62 62 * pos_val.significand * 2^pos_val.exponent -
uspace/lib/c/include/offset.h
rdf6ded8 r1b20da0 1 1 /* 2 * Copyright (c) 2017 Jakub Jermar 2 * Copyright (c) 2017 Jakub Jermar 3 3 * All rights reserved. 4 4 * -
uspace/lib/c/include/rcu.h
rdf6ded8 r1b20da0 41 41 #include <stdbool.h> 42 42 43 /** Use to assign a pointer to newly initialized data to a rcu reader 43 /** Use to assign a pointer to newly initialized data to a rcu reader 44 44 * accessible pointer. 45 * 45 * 46 46 * Example: 47 47 * @code … … 50 50 * int grade; 51 51 * } exam_t; 52 * 52 * 53 53 * exam_t *exam_list; 54 54 * // .. 55 * 55 * 56 56 * // Insert at the beginning of the list. 57 57 * exam_t *my_exam = malloc(sizeof(exam_t), 0); … … 59 59 * my_exam->next = exam_list; 60 60 * rcu_assign(exam_list, my_exam); 61 * 61 * 62 62 * // Changes properly propagate. Every reader either sees 63 63 * // the old version of exam_list or the new version with … … 65 65 * rcu_synchronize(); 66 66 * // Now we can be sure every reader sees my_exam. 67 * 67 * 68 68 * @endcode 69 69 */ … … 75 75 76 76 /** Use to access RCU protected data in a reader section. 77 * 77 * 78 78 * Example: 79 79 * @code 80 80 * exam_t *exam_list; 81 81 * // ... 82 * 82 * 83 83 * rcu_read_lock(); 84 84 * exam_t *first_exam = rcu_access(exam_list); 85 * // We can now safely use first_exam, it won't change 85 * // We can now safely use first_exam, it won't change 86 86 * // under us while we're using it. 87 87 * -
uspace/lib/c/include/vfs/canonify.h
rdf6ded8 r1b20da0 1 1 /* 2 * Copyright (c) 2008 Jakub Jermar 2 * Copyright (c) 2008 Jakub Jermar 3 3 * All rights reserved. 4 4 * -
uspace/lib/c/include/vfs/inbox.h
rdf6ded8 r1b20da0 27 27 */ 28 28 29 /** @addtogroup libc 29 /** @addtogroup libc 30 30 * @{ 31 31 */
Note:
See TracChangeset
for help on using the changeset viewer.
