Changeset ab936440 in mainline for kernel/generic/include
- Timestamp:
- 2019-02-12T20:42:42Z (7 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f31ca47
- Parents:
- 7f7817a9 (diff), 4805495 (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. - git-author:
- Matthieu Riolo <matthieu.riolo@…> (2019-02-12 20:26:18)
- git-committer:
- Matthieu Riolo <matthieu.riolo@…> (2019-02-12 20:42:42)
- Location:
- kernel/generic/include
- Files:
-
- 1 deleted
- 11 edited
-
adt/btree.h (deleted)
-
adt/list.h (modified) (10 diffs)
-
adt/odict.h (modified) (1 diff)
-
bitops.h (modified) (2 diffs)
-
context.h (modified) (1 diff)
-
lib/refcount.h (modified) (1 diff)
-
macros.h (modified) (2 diffs)
-
mm/as.h (modified) (5 diffs)
-
str.h (modified) (5 diffs)
-
synch/spinlock.h (modified) (2 diffs)
-
trace.h (modified) (1 diff)
-
types/adt/odict.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/adt/list.h
r7f7817a9 rab936440 150 150 * 151 151 */ 152 NO_TRACE static inline void link_initialize(link_t *link)152 _NO_TRACE static inline void link_initialize(link_t *link) 153 153 { 154 154 link->prev = NULL; … … 163 163 * 164 164 */ 165 NO_TRACE static inline void list_initialize(list_t *list)165 _NO_TRACE static inline void list_initialize(list_t *list) 166 166 { 167 167 list->head.prev = &list->head; … … 199 199 * 200 200 */ 201 NO_TRACE static inline void list_prepend(link_t *link, list_t *list)201 _NO_TRACE static inline void list_prepend(link_t *link, list_t *list) 202 202 { 203 203 list_insert_after(link, &list->head); … … 212 212 * 213 213 */ 214 NO_TRACE static inline void list_append(link_t *link, list_t *list)214 _NO_TRACE static inline void list_append(link_t *link, list_t *list) 215 215 { 216 216 list_insert_before(link, &list->head); … … 225 225 * 226 226 */ 227 NO_TRACE static inline void list_remove(link_t *link)227 _NO_TRACE static inline void list_remove(link_t *link) 228 228 { 229 229 if ((link->prev != NULL) && (link->next != NULL)) { … … 242 242 * 243 243 */ 244 NO_TRACE static inline bool list_empty(const list_t *list)244 _NO_TRACE static inline bool list_empty(const list_t *list) 245 245 { 246 246 return (list->head.next == &list->head); … … 310 310 * 311 311 */ 312 NO_TRACE static inline void headless_list_split_or_concat(link_t *part1, link_t *part2)312 _NO_TRACE static inline void headless_list_split_or_concat(link_t *part1, link_t *part2) 313 313 { 314 314 part1->prev->next = part2; … … 331 331 * 332 332 */ 333 NO_TRACE static inline void headless_list_split(link_t *part1, link_t *part2)333 _NO_TRACE static inline void headless_list_split(link_t *part1, link_t *part2) 334 334 { 335 335 headless_list_split_or_concat(part1, part2); … … 346 346 * 347 347 */ 348 NO_TRACE static inline void headless_list_concat(link_t *part1, link_t *part2)348 _NO_TRACE static inline void headless_list_concat(link_t *part1, link_t *part2) 349 349 { 350 350 headless_list_split_or_concat(part1, part2); … … 361 361 * 362 362 */ 363 NO_TRACE static inline void list_concat(list_t *list1, list_t *list2)363 _NO_TRACE static inline void list_concat(list_t *list1, list_t *list2) 364 364 { 365 365 list_splice(list2, list1->head.prev); -
kernel/generic/include/adt/odict.h
r7f7817a9 rab936440 33 33 */ 34 34 35 #ifndef LIBC_ODICT_H_36 #define LIBC_ODICT_H_35 #ifndef _LIBC_ODICT_H_ 36 #define _LIBC_ODICT_H_ 37 37 38 38 #include <errno.h> -
kernel/generic/include/bitops.h
r7f7817a9 rab936440 52 52 * 53 53 */ 54 NO_TRACE static inline uint8_t fnzb32(uint32_t arg)54 _NO_TRACE static inline uint8_t fnzb32(uint32_t arg) 55 55 { 56 56 uint8_t n = 0; … … 87 87 * 88 88 */ 89 NO_TRACE static inline uint8_t fnzb64(uint64_t arg)89 _NO_TRACE static inline uint8_t fnzb64(uint64_t arg) 90 90 { 91 91 uint8_t n = 0; -
kernel/generic/include/context.h
r7f7817a9 rab936440 91 91 * 92 92 */ 93 NO_TRACE static inline void context_restore(context_t *ctx)93 _NO_TRACE static inline void context_restore(context_t *ctx) 94 94 { 95 95 context_restore_arch(ctx); -
kernel/generic/include/lib/refcount.h
r7f7817a9 rab936440 37 37 */ 38 38 39 #ifndef LIBC_REFCOUNT_H_40 #define LIBC_REFCOUNT_H_39 #ifndef _LIBC_REFCOUNT_H_ 40 #define _LIBC_REFCOUNT_H_ 41 41 42 42 #include <assert.h> -
kernel/generic/include/macros.h
r7f7817a9 rab936440 49 49 * 50 50 */ 51 NO_TRACE static inline int overlaps(uint64_t s1, uint64_t sz1, uint64_t s2,51 _NO_TRACE static inline int overlaps(uint64_t s1, uint64_t sz1, uint64_t s2, 52 52 uint64_t sz2) 53 53 { … … 78 78 * 79 79 */ 80 NO_TRACE static inline int iswithin(uint64_t s1, uint64_t sz1, uint64_t s2,80 _NO_TRACE static inline int iswithin(uint64_t s1, uint64_t sz1, uint64_t s2, 81 81 uint64_t sz2) 82 82 { -
kernel/generic/include/mm/as.h
r7f7817a9 rab936440 45 45 #include <synch/mutex.h> 46 46 #include <adt/list.h> 47 #include <adt/btree.h>48 47 #include <adt/odict.h> 49 48 #include <lib/elf.h> … … 137 136 } as_operations_t; 138 137 138 /** Single anonymous page mapping. */ 139 typedef struct { 140 /** Containing pagemap structure */ 141 struct as_pagemap *pagemap; 142 /** Link to @c shinfo->pagemap ordered dictionary */ 143 odlink_t lpagemap; 144 /** Virtual address */ 145 uintptr_t vaddr; 146 /** Physical frame address */ 147 uintptr_t frame; 148 } as_page_mapping_t; 149 150 /** Map of anonymous pages in a shared area. */ 151 typedef struct as_pagemap { 152 /** 153 * Dictionary ordered by virtual address. Members are of type 154 * as_page_mapping_t 155 */ 156 odict_t map; 157 } as_pagemap_t; 158 159 /** Used space interval */ 160 typedef struct { 161 /** Containing used_space structure */ 162 struct used_space *used_space; 163 /** Link to @c used_space->ivals */ 164 odlink_t lused_space; 165 /** First page address */ 166 uintptr_t page; 167 /** Count of pages */ 168 size_t count; 169 } used_space_ival_t; 170 171 /** Map of used space in an address space area */ 172 typedef struct used_space { 173 /** 174 * Dictionary of intervals by start address. 175 * Members are of type @c used_space_ival_t. 176 */ 177 odict_t ivals; 178 /** Total number of used pages. */ 179 size_t pages; 180 } used_space_t; 181 139 182 /** 140 183 * This structure contains information associated with the shared address space … … 150 193 bool shared; 151 194 152 /** 153 * B+tree containing complete map of anonymous pages of the shared area. 154 */ 155 btree_t pagemap; 195 /** Complete map of anonymous pages of the shared area. */ 196 as_pagemap_t pagemap; 156 197 157 198 /** Address space area backend. */ … … 221 262 size_t pages; 222 263 223 /** Number of resident pages in the area. */224 size_t resident;225 226 264 /** Base address of this area. */ 227 265 uintptr_t base; 228 266 229 267 /** Map of used space. */ 230 btree_t used_space;268 used_space_t used_space; 231 269 232 270 /** … … 283 321 extern as_area_t *as_area_next(as_area_t *); 284 322 323 extern void as_pagemap_initialize(as_pagemap_t *); 324 extern void as_pagemap_finalize(as_pagemap_t *); 325 extern as_page_mapping_t *as_pagemap_first(as_pagemap_t *); 326 extern as_page_mapping_t *as_pagemap_next(as_page_mapping_t *); 327 extern errno_t as_pagemap_find(as_pagemap_t *, uintptr_t, uintptr_t *); 328 extern void as_pagemap_insert(as_pagemap_t *, uintptr_t, uintptr_t); 329 extern void as_pagemap_remove(as_page_mapping_t *); 330 285 331 extern unsigned int as_area_get_flags(as_area_t *); 286 332 extern bool as_area_check_access(as_area_t *, pf_access_t); 287 333 extern size_t as_area_get_size(uintptr_t); 288 extern bool used_space_insert(as_area_t *, uintptr_t, size_t); 289 extern bool used_space_remove(as_area_t *, uintptr_t, size_t); 334 extern used_space_ival_t *used_space_first(used_space_t *); 335 extern used_space_ival_t *used_space_next(used_space_ival_t *); 336 extern used_space_ival_t *used_space_find_gteq(used_space_t *, uintptr_t); 337 extern bool used_space_insert(used_space_t *, uintptr_t, size_t); 290 338 291 339 /* Interface to be implemented by architectures. */ -
kernel/generic/include/str.h
r7f7817a9 rab936440 1 1 /* 2 2 * Copyright (c) 2001-2004 Jakub Jermar 3 * Copyright (c) 2005 Martin Decky 4 * Copyright (c) 2011 Oleg Romanenko 3 5 * All rights reserved. 4 6 * … … 36 38 #define KERN_STR_H_ 37 39 40 #include <errno.h> 38 41 #include <stdbool.h> 39 42 #include <stddef.h> 40 43 #include <stdint.h> 41 #include <errno.h>42 44 43 /* *<Common Unicode characters */45 /* Common Unicode characters */ 44 46 #define U_SPECIAL '?' 45 47 … … 61 63 #define U_CURSOR 0x2588 62 64 63 /** <No size limit constant */65 /** No size limit constant */ 64 66 #define STR_NO_LIMIT ((size_t) -1) 65 67 66 /** < Maximum size of a string containing cntcharacters */67 #define STR_BOUNDS( cnt) ((cnt) << 2)68 /** Maximum size of a string containing @c length characters */ 69 #define STR_BOUNDS(length) ((length) << 2) 68 70 69 71 extern wchar_t str_decode(const char *str, size_t *offset, size_t sz); … … 92 94 extern void wstr_to_str(char *dest, size_t size, const wchar_t *src); 93 95 94 extern char *str_dup(const char *src);95 extern char *str_ndup(const char *src, size_t n);96 97 96 extern char *str_chr(const char *str, wchar_t ch); 98 97 … … 100 99 extern bool wstr_remove(wchar_t *str, size_t pos); 101 100 102 extern errno_t str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *); 101 extern char *str_dup(const char *src); 102 extern char *str_ndup(const char *src, size_t n); 103 104 extern errno_t str_uint64_t(const char *, char **, unsigned int, bool, 105 uint64_t *); 103 106 104 107 extern void order_suffix(const uint64_t, uint64_t *, char *); -
kernel/generic/include/synch/spinlock.h
r7f7817a9 rab936440 103 103 * @param lock Pointer to spinlock_t structure. 104 104 */ 105 NO_TRACE static inline void spinlock_lock(spinlock_t *lock)105 _NO_TRACE static inline void spinlock_lock(spinlock_t *lock) 106 106 { 107 107 preemption_disable(); … … 115 115 * @param lock Pointer to spinlock_t structure. 116 116 */ 117 NO_TRACE static inline void spinlock_unlock(spinlock_t *lock)117 _NO_TRACE static inline void spinlock_unlock(spinlock_t *lock) 118 118 { 119 119 atomic_flag_clear_explicit(&lock->flag, memory_order_release); -
kernel/generic/include/trace.h
r7f7817a9 rab936440 36 36 #define KERN_TRACE_H_ 37 37 38 #define NO_TRACE __attribute__((no_instrument_function))38 #define _NO_TRACE __attribute__((no_instrument_function)) 39 39 40 40 #endif -
kernel/generic/include/types/adt/odict.h
r7f7817a9 rab936440 33 33 */ 34 34 35 #ifndef LIBC_TYPES_ODICT_H_36 #define LIBC_TYPES_ODICT_H_35 #ifndef _LIBC_TYPES_ODICT_H_ 36 #define _LIBC_TYPES_ODICT_H_ 37 37 38 38 #include <adt/list.h>
Note:
See TracChangeset
for help on using the changeset viewer.
