Changeset 31e15be in mainline
- Timestamp:
- 2021-08-04T15:18:08Z (3 years ago)
- Branches:
- master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- 98a935e
- Parents:
- de38873
- git-author:
- Dmitry Selyutin <ghostmansd@…> (2020-12-23 21:59:08)
- git-committer:
- jxsvoboda <5887334+jxsvoboda@…> (2021-08-04 15:18:08)
- Location:
- kernel
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/arch/sparc64/include/arch/sun4v/cpu.h
rde38873 r31e15be 54 54 uint64_t cpuids[MAX_CORE_STRANDS]; 55 55 struct cpu *cpus[MAX_CORE_STRANDS]; 56 atomic_ t nrdy;56 atomic_size_t nrdy; 57 57 SPINLOCK_DECLARE(proposed_nrdy_lock); 58 58 } exec_unit_t; -
kernel/generic/include/atomic.h
rde38873 r31e15be 40 40 #include <stdatomic.h> 41 41 42 // TODO: Remove.43 // Before <stdatomic.h> was available, there was only one atomic type44 // equivalent to atomic_size_t. This means that in some places, atomic_t can45 // be replaced with a more appropriate type (e.g. atomic_bool for flags or46 // a signed type for potentially signed values).47 // So atomic_t should be replaced with the most appropriate type on a case by48 // case basis, and after there are no more uses, remove this type.49 typedef atomic_size_t atomic_t;50 51 42 #define atomic_predec(val) \ 52 43 (atomic_fetch_sub((val), 1) - 1) -
kernel/generic/include/cap/cap.h
rde38873 r31e15be 80 80 typedef struct kobject { 81 81 kobject_type_t type; 82 atomic_ t refcnt;82 atomic_size_t refcnt; 83 83 84 84 /** Mutex protecting caps_list */ -
kernel/generic/include/cpu.h
rde38873 r31e15be 58 58 context_t saved_context; 59 59 60 atomic_ t nrdy;60 atomic_size_t nrdy; 61 61 runq_t rq[RQ_COUNT]; 62 62 volatile size_t needs_relink; -
kernel/generic/include/halt.h
rde38873 r31e15be 38 38 #include <atomic.h> 39 39 40 extern atomic_ thaltstate;40 extern atomic_bool haltstate; 41 41 42 42 extern void halt(void) __attribute__((noreturn)); -
kernel/generic/include/ipc/ipc.h
rde38873 r31e15be 71 71 struct call *hangup_call; 72 72 ipc_phone_state_t state; 73 atomic_ t active_calls;73 atomic_size_t active_calls; 74 74 /** User-defined label */ 75 75 sysarg_t label; … … 90 90 * Number of answers the answerbox is expecting to eventually arrive. 91 91 */ 92 atomic_ t active_calls;92 atomic_size_t active_calls; 93 93 94 94 /** Phones connected to this answerbox. */ -
kernel/generic/include/mm/slab.h
rde38873 r31e15be 99 99 100 100 /* 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; 104 104 /** How many magazines in magazines list */ 105 atomic_ t magazine_counter;105 atomic_size_t magazine_counter; 106 106 107 107 /* Slabs */ -
kernel/generic/include/proc/scheduler.h
rde38873 r31e15be 52 52 } runq_t; 53 53 54 extern atomic_ t nrdy;54 extern atomic_size_t nrdy; 55 55 extern void scheduler_init(void); 56 56 -
kernel/generic/include/proc/task.h
rde38873 r31e15be 87 87 88 88 /** Number of references (i.e. threads). */ 89 atomic_ t refcount;89 atomic_size_t refcount; 90 90 /** Number of threads that haven't exited yet. */ 91 atomic_ t lifecount;91 atomic_size_t lifecount; 92 92 93 93 /** Task permissions. */ -
kernel/generic/src/lib/halt.c
rde38873 r31e15be 36 36 */ 37 37 38 #include <stdbool.h> 38 39 #include <halt.h> 39 40 #include <log.h> … … 44 45 45 46 /** Halt flag */ 46 atomic_ t haltstate = 0;47 atomic_bool haltstate = false; 47 48 48 49 /** Halt wrapper … … 57 58 58 59 if (!atomic_load(&haltstate)) { 59 atomic_store(&haltstate, 1);60 atomic_store(&haltstate, true); 60 61 rundebugger = true; 61 62 } 62 63 #else 63 atomic_store(&haltstate, 1);64 atomic_store(&haltstate, true); 64 65 #endif 65 66 -
kernel/generic/src/proc/scheduler.c
rde38873 r31e15be 68 68 static void scheduler_separated_stack(void); 69 69 70 atomic_ t nrdy; /**< Number of ready threads in the system. */70 atomic_size_t nrdy; /**< Number of ready threads in the system. */ 71 71 72 72 /** Carry out actions before new task runs. */ -
kernel/test/atomic/atomic1.c
rde38873 r31e15be 32 32 const char *test_atomic1(void) 33 33 { 34 atomic_ t a;34 atomic_int a; 35 35 36 36 atomic_store(&a, 10); -
kernel/test/mm/falloc2.c
rde38873 r31e15be 43 43 #define THREADS 8 44 44 45 static atomic_ t thread_cnt;46 static atomic_ t thread_fail;45 static atomic_size_t thread_cnt; 46 static atomic_size_t thread_fail; 47 47 48 48 static void falloc(void *arg) -
kernel/test/synch/semaphore1.c
rde38873 r31e15be 41 41 42 42 static waitq_t can_start; 43 static atomic_ t items_produced;44 static atomic_ t items_consumed;43 static atomic_size_t items_produced; 44 static atomic_size_t items_consumed; 45 45 46 46 static void producer(void *arg) -
kernel/test/thread/thread1.c
rde38873 r31e15be 30 30 #include <test.h> 31 31 #include <atomic.h> 32 #include <stdbool.h> 32 33 #include <proc/thread.h> 33 34 … … 36 37 #define THREADS 5 37 38 38 static atomic_ tfinish;39 static atomic_ t threads_finished;39 static atomic_bool finish; 40 static atomic_size_t threads_finished; 40 41 41 42 static void threadtest(void *data) … … 55 56 size_t total = 0; 56 57 57 atomic_store(&finish, 1);58 atomic_store(&finish, true); 58 59 atomic_store(&threads_finished, 0); 59 60 … … 72 73 thread_sleep(10); 73 74 74 atomic_store(&finish, 0);75 atomic_store(&finish, false); 75 76 while (atomic_load(&threads_finished) < total) { 76 77 TPRINTF("Threads left: %zu\n", total - atomic_load(&threads_finished));
Note:
See TracChangeset
for help on using the changeset viewer.