Changeset ab936440 in mainline for kernel/generic/include


Ignore:
Timestamp:
2019-02-12T20:42:42Z (7 years ago)
Author:
Matthieu Riolo <matthieu.riolo@…>
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)
Message:

Merge branch 'master' into bdsh_alias

Conflicts:

uspace/app/bdsh/Makefile
uspace/app/bdsh/cmds/modules/modules.h

Ccheck correction and removing header which includes itself

Location:
kernel/generic/include
Files:
1 deleted
11 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/adt/list.h

    r7f7817a9 rab936440  
    150150 *
    151151 */
    152 NO_TRACE static inline void link_initialize(link_t *link)
     152_NO_TRACE static inline void link_initialize(link_t *link)
    153153{
    154154        link->prev = NULL;
     
    163163 *
    164164 */
    165 NO_TRACE static inline void list_initialize(list_t *list)
     165_NO_TRACE static inline void list_initialize(list_t *list)
    166166{
    167167        list->head.prev = &list->head;
     
    199199 *
    200200 */
    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)
    202202{
    203203        list_insert_after(link, &list->head);
     
    212212 *
    213213 */
    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)
    215215{
    216216        list_insert_before(link, &list->head);
     
    225225 *
    226226 */
    227 NO_TRACE static inline void list_remove(link_t *link)
     227_NO_TRACE static inline void list_remove(link_t *link)
    228228{
    229229        if ((link->prev != NULL) && (link->next != NULL)) {
     
    242242 *
    243243 */
    244 NO_TRACE static inline bool list_empty(const list_t *list)
     244_NO_TRACE static inline bool list_empty(const list_t *list)
    245245{
    246246        return (list->head.next == &list->head);
     
    310310 *
    311311 */
    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)
    313313{
    314314        part1->prev->next = part2;
     
    331331 *
    332332 */
    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)
    334334{
    335335        headless_list_split_or_concat(part1, part2);
     
    346346 *
    347347 */
    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)
    349349{
    350350        headless_list_split_or_concat(part1, part2);
     
    361361 *
    362362 */
    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)
    364364{
    365365        list_splice(list2, list1->head.prev);
  • kernel/generic/include/adt/odict.h

    r7f7817a9 rab936440  
    3333 */
    3434
    35 #ifndef LIBC_ODICT_H_
    36 #define LIBC_ODICT_H_
     35#ifndef _LIBC_ODICT_H_
     36#define _LIBC_ODICT_H_
    3737
    3838#include <errno.h>
  • kernel/generic/include/bitops.h

    r7f7817a9 rab936440  
    5252 *
    5353 */
    54 NO_TRACE static inline uint8_t fnzb32(uint32_t arg)
     54_NO_TRACE static inline uint8_t fnzb32(uint32_t arg)
    5555{
    5656        uint8_t n = 0;
     
    8787 *
    8888 */
    89 NO_TRACE static inline uint8_t fnzb64(uint64_t arg)
     89_NO_TRACE static inline uint8_t fnzb64(uint64_t arg)
    9090{
    9191        uint8_t n = 0;
  • kernel/generic/include/context.h

    r7f7817a9 rab936440  
    9191 *
    9292 */
    93 NO_TRACE static inline void context_restore(context_t *ctx)
     93_NO_TRACE static inline void context_restore(context_t *ctx)
    9494{
    9595        context_restore_arch(ctx);
  • kernel/generic/include/lib/refcount.h

    r7f7817a9 rab936440  
    3737 */
    3838
    39 #ifndef LIBC_REFCOUNT_H_
    40 #define LIBC_REFCOUNT_H_
     39#ifndef _LIBC_REFCOUNT_H_
     40#define _LIBC_REFCOUNT_H_
    4141
    4242#include <assert.h>
  • kernel/generic/include/macros.h

    r7f7817a9 rab936440  
    4949 *
    5050 */
    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,
    5252    uint64_t sz2)
    5353{
     
    7878 *
    7979 */
    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,
    8181    uint64_t sz2)
    8282{
  • kernel/generic/include/mm/as.h

    r7f7817a9 rab936440  
    4545#include <synch/mutex.h>
    4646#include <adt/list.h>
    47 #include <adt/btree.h>
    4847#include <adt/odict.h>
    4948#include <lib/elf.h>
     
    137136} as_operations_t;
    138137
     138/** Single anonymous page mapping. */
     139typedef 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. */
     151typedef 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 */
     160typedef 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 */
     172typedef 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
    139182/**
    140183 * This structure contains information associated with the shared address space
     
    150193        bool shared;
    151194
    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;
    156197
    157198        /** Address space area backend. */
     
    221262        size_t pages;
    222263
    223         /** Number of resident pages in the area. */
    224         size_t resident;
    225 
    226264        /** Base address of this area. */
    227265        uintptr_t base;
    228266
    229267        /** Map of used space. */
    230         btree_t used_space;
     268        used_space_t used_space;
    231269
    232270        /**
     
    283321extern as_area_t *as_area_next(as_area_t *);
    284322
     323extern void as_pagemap_initialize(as_pagemap_t *);
     324extern void as_pagemap_finalize(as_pagemap_t *);
     325extern as_page_mapping_t *as_pagemap_first(as_pagemap_t *);
     326extern as_page_mapping_t *as_pagemap_next(as_page_mapping_t *);
     327extern errno_t as_pagemap_find(as_pagemap_t *, uintptr_t, uintptr_t *);
     328extern void as_pagemap_insert(as_pagemap_t *, uintptr_t, uintptr_t);
     329extern void as_pagemap_remove(as_page_mapping_t *);
     330
    285331extern unsigned int as_area_get_flags(as_area_t *);
    286332extern bool as_area_check_access(as_area_t *, pf_access_t);
    287333extern 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);
     334extern used_space_ival_t *used_space_first(used_space_t *);
     335extern used_space_ival_t *used_space_next(used_space_ival_t *);
     336extern used_space_ival_t *used_space_find_gteq(used_space_t *, uintptr_t);
     337extern bool used_space_insert(used_space_t *, uintptr_t, size_t);
    290338
    291339/* Interface to be implemented by architectures. */
  • kernel/generic/include/str.h

    r7f7817a9 rab936440  
    11/*
    22 * Copyright (c) 2001-2004 Jakub Jermar
     3 * Copyright (c) 2005 Martin Decky
     4 * Copyright (c) 2011 Oleg Romanenko
    35 * All rights reserved.
    46 *
     
    3638#define KERN_STR_H_
    3739
     40#include <errno.h>
    3841#include <stdbool.h>
    3942#include <stddef.h>
    4043#include <stdint.h>
    41 #include <errno.h>
    4244
    43 /**< Common Unicode characters */
     45/* Common Unicode characters */
    4446#define U_SPECIAL      '?'
    4547
     
    6163#define U_CURSOR       0x2588
    6264
    63 /**< No size limit constant */
     65/** No size limit constant */
    6466#define STR_NO_LIMIT  ((size_t) -1)
    6567
    66 /**< Maximum size of a string containing cnt characters */
    67 #define STR_BOUNDS(cnt)  ((cnt) << 2)
     68/** Maximum size of a string containing @c length characters */
     69#define STR_BOUNDS(length)  ((length) << 2)
    6870
    6971extern wchar_t str_decode(const char *str, size_t *offset, size_t sz);
     
    9294extern void wstr_to_str(char *dest, size_t size, const wchar_t *src);
    9395
    94 extern char *str_dup(const char *src);
    95 extern char *str_ndup(const char *src, size_t n);
    96 
    9796extern char *str_chr(const char *str, wchar_t ch);
    9897
     
    10099extern bool wstr_remove(wchar_t *str, size_t pos);
    101100
    102 extern errno_t str_uint64_t(const char *, char **, unsigned int, bool, uint64_t *);
     101extern char *str_dup(const char *src);
     102extern char *str_ndup(const char *src, size_t n);
     103
     104extern errno_t str_uint64_t(const char *, char **, unsigned int, bool,
     105    uint64_t *);
    103106
    104107extern void order_suffix(const uint64_t, uint64_t *, char *);
  • kernel/generic/include/synch/spinlock.h

    r7f7817a9 rab936440  
    103103 * @param lock  Pointer to spinlock_t structure.
    104104 */
    105 NO_TRACE static inline void spinlock_lock(spinlock_t *lock)
     105_NO_TRACE static inline void spinlock_lock(spinlock_t *lock)
    106106{
    107107        preemption_disable();
     
    115115 * @param lock  Pointer to spinlock_t structure.
    116116 */
    117 NO_TRACE static inline void spinlock_unlock(spinlock_t *lock)
     117_NO_TRACE static inline void spinlock_unlock(spinlock_t *lock)
    118118{
    119119        atomic_flag_clear_explicit(&lock->flag, memory_order_release);
  • kernel/generic/include/trace.h

    r7f7817a9 rab936440  
    3636#define KERN_TRACE_H_
    3737
    38 #define NO_TRACE  __attribute__((no_instrument_function))
     38#define _NO_TRACE  __attribute__((no_instrument_function))
    3939
    4040#endif
  • kernel/generic/include/types/adt/odict.h

    r7f7817a9 rab936440  
    3333 */
    3434
    35 #ifndef LIBC_TYPES_ODICT_H_
    36 #define LIBC_TYPES_ODICT_H_
     35#ifndef _LIBC_TYPES_ODICT_H_
     36#define _LIBC_TYPES_ODICT_H_
    3737
    3838#include <adt/list.h>
Note: See TracChangeset for help on using the changeset viewer.