Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 8b8e028 in mainline


Ignore:
Timestamp:
2021-01-06T19:04:30Z (13 days ago)
Author:
GitHub <noreply@…>
Parents:
d70dc1c4 (diff), c95daa5 (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:
Dmitry Selyutin <ghostmansd@…> (2021-01-06 19:04:30)
git-committer:
GitHub <noreply@…> (2021-01-06 19:04:30)
Message:

Merge c95daa5680d47baf9d07b783ffe4c9891de4ce35 into d70dc1c40835f7e957ea1b4fa52c29db4d21ced4

Location:
kernel
Files:
15 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/include/arch/sun4v/cpu.h

    rd70dc1c4 r8b8e028  
    5454        uint64_t cpuids[MAX_CORE_STRANDS];
    5555        struct cpu *cpus[MAX_CORE_STRANDS];
    56         atomic_t nrdy;
     56        atomic_size_t nrdy;
    5757        SPINLOCK_DECLARE(proposed_nrdy_lock);
    5858} exec_unit_t;
  • kernel/generic/include/atomic.h

    rd70dc1c4 r8b8e028  
    4040#include <stdatomic.h>
    4141
    42 // TODO: Remove.
    43 // Before <stdatomic.h> was available, there was only one atomic type
    44 // equivalent to atomic_size_t. This means that in some places, atomic_t can
    45 // be replaced with a more appropriate type (e.g. atomic_bool for flags or
    46 // a signed type for potentially signed values).
    47 // So atomic_t should be replaced with the most appropriate type on a case by
    48 // case basis, and after there are no more uses, remove this type.
    49 typedef atomic_size_t atomic_t;
    50 
    5142#define atomic_predec(val) \
    5243        (atomic_fetch_sub((val), 1) - 1)
  • kernel/generic/include/cap/cap.h

    rd70dc1c4 r8b8e028  
    8080typedef struct kobject {
    8181        kobject_type_t type;
    82         atomic_t refcnt;
     82        atomic_size_t refcnt;
    8383
    8484        /** Mutex protecting caps_list */
  • kernel/generic/include/cpu.h

    rd70dc1c4 r8b8e028  
    5858        context_t saved_context;
    5959
    60         atomic_t nrdy;
     60        atomic_size_t nrdy;
    6161        runq_t rq[RQ_COUNT];
    6262        volatile size_t needs_relink;
  • kernel/generic/include/halt.h

    rd70dc1c4 r8b8e028  
    3838#include <atomic.h>
    3939
    40 extern atomic_t haltstate;
     40extern atomic_bool haltstate;
    4141
    4242extern void halt(void) __attribute__((noreturn));
  • kernel/generic/include/ipc/ipc.h

    rd70dc1c4 r8b8e028  
    7171        struct call *hangup_call;
    7272        ipc_phone_state_t state;
    73         atomic_t active_calls;
     73        atomic_size_t active_calls;
    7474        /** User-defined label */
    7575        sysarg_t label;
     
    9090         * Number of answers the answerbox is expecting to eventually arrive.
    9191         */
    92         atomic_t active_calls;
     92        atomic_size_t active_calls;
    9393
    9494        /** Phones connected to this answerbox. */
  • kernel/generic/include/mm/slab.h

    rd70dc1c4 r8b8e028  
    9999
    100100        /* Statistics */
    101         atomic_t allocated_slabs;
    102         atomic_t allocated_objs;
    103         atomic_t cached_objs;
     101        atomic_size_t allocated_slabs;
     102        atomic_size_t allocated_objs;
     103        atomic_size_t cached_objs;
    104104        /** How many magazines in magazines list */
    105         atomic_t magazine_counter;
     105        atomic_size_t magazine_counter;
    106106
    107107        /* Slabs */
  • kernel/generic/include/proc/scheduler.h

    rd70dc1c4 r8b8e028  
    5252} runq_t;
    5353
    54 extern atomic_t nrdy;
     54extern atomic_size_t nrdy;
    5555extern void scheduler_init(void);
    5656
  • kernel/generic/include/proc/task.h

    rd70dc1c4 r8b8e028  
    8787
    8888        /** Number of references (i.e. threads). */
    89         atomic_t refcount;
     89        atomic_size_t refcount;
    9090        /** Number of threads that haven't exited yet. */
    91         atomic_t lifecount;
     91        atomic_size_t lifecount;
    9292
    9393        /** Task permissions. */
  • kernel/generic/src/lib/halt.c

    rd70dc1c4 r8b8e028  
    3636 */
    3737
     38#include <stdbool.h>
    3839#include <halt.h>
    3940#include <log.h>
     
    4445
    4546/** Halt flag */
    46 atomic_t haltstate = 0;
     47atomic_bool haltstate = false;
    4748
    4849/** Halt wrapper
     
    5758
    5859        if (!atomic_load(&haltstate)) {
    59                 atomic_store(&haltstate, 1);
     60                atomic_store(&haltstate, true);
    6061                rundebugger = true;
    6162        }
    6263#else
    63         atomic_store(&haltstate, 1);
     64        atomic_store(&haltstate, true);
    6465#endif
    6566
  • kernel/generic/src/proc/scheduler.c

    rd70dc1c4 r8b8e028  
    6868static void scheduler_separated_stack(void);
    6969
    70 atomic_t nrdy;  /**< Number of ready threads in the system. */
     70atomic_size_t nrdy;  /**< Number of ready threads in the system. */
    7171
    7272/** Carry out actions before new task runs. */
  • kernel/test/atomic/atomic1.c

    rd70dc1c4 r8b8e028  
    3232const char *test_atomic1(void)
    3333{
    34         atomic_t a;
     34        atomic_int a;
    3535
    3636        atomic_store(&a, 10);
  • kernel/test/mm/falloc2.c

    rd70dc1c4 r8b8e028  
    4343#define THREADS      8
    4444
    45 static atomic_t thread_cnt;
    46 static atomic_t thread_fail;
     45static atomic_size_t thread_cnt;
     46static atomic_size_t thread_fail;
    4747
    4848static void falloc(void *arg)
  • kernel/test/synch/semaphore1.c

    rd70dc1c4 r8b8e028  
    4141
    4242static waitq_t can_start;
    43 static atomic_t items_produced;
    44 static atomic_t items_consumed;
     43static atomic_size_t items_produced;
     44static atomic_size_t items_consumed;
    4545
    4646static void producer(void *arg)
  • kernel/test/thread/thread1.c

    rd70dc1c4 r8b8e028  
    3030#include <test.h>
    3131#include <atomic.h>
     32#include <stdbool.h>
    3233#include <proc/thread.h>
    3334
     
    3637#define THREADS  5
    3738
    38 static atomic_t finish;
    39 static atomic_t threads_finished;
     39static atomic_bool finish;
     40static atomic_size_t threads_finished;
    4041
    4142static void threadtest(void *data)
     
    5556        size_t total = 0;
    5657
    57         atomic_store(&finish, 1);
     58        atomic_store(&finish, true);
    5859        atomic_store(&threads_finished, 0);
    5960
     
    7273        thread_sleep(10);
    7374
    74         atomic_store(&finish, 0);
     75        atomic_store(&finish, false);
    7576        while (atomic_load(&threads_finished) < total) {
    7677                TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished));
Note: See TracChangeset for help on using the changeset viewer.