Changeset 3cfe2b8 in mainline


Ignore:
Timestamp:
2018-09-07T16:01:50Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
c53e813
Parents:
5f1d850
Message:

Convert atomic_t to atomic_size_t (6): Replace atomic_count_t with size_t

Location:
kernel
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/include/atomic.h

    r5f1d850 r3cfe2b8  
    4040#include <stdatomic.h>
    4141
    42 typedef size_t atomic_count_t;
    4342typedef atomic_size_t atomic_t;
    4443
  • kernel/generic/src/adt/cht.c

    r5f1d850 r3cfe2b8  
    21222122
    21232123        if ((need_shrink || missed_shrink) && h->b->order > h->min_order) {
    2124                 atomic_count_t resize_reqs = atomic_preinc(&h->resize_reqs);
     2124                size_t resize_reqs = atomic_preinc(&h->resize_reqs);
    21252125                /* The first resize request. Start the resizer. */
    21262126                if (1 == resize_reqs) {
     
    21432143
    21442144        if ((need_grow || missed_grow) && h->b->order < CHT_MAX_ORDER) {
    2145                 atomic_count_t resize_reqs = atomic_preinc(&h->resize_reqs);
     2145                size_t resize_reqs = atomic_preinc(&h->resize_reqs);
    21462146                /* The first resize request. Start the resizer. */
    21472147                if (1 == resize_reqs) {
     
    21782178                } else {
    21792179                        /* Table is just the right size. */
    2180                         atomic_count_t reqs = atomic_predec(&h->resize_reqs);
     2180                        size_t reqs = atomic_predec(&h->resize_reqs);
    21812181                        done = (reqs == 0);
    21822182                }
  • kernel/generic/src/mm/slab.c

    r5f1d850 r3cfe2b8  
    690690         * endless loop
    691691         */
    692         atomic_count_t magcount = atomic_load(&cache->magazine_counter);
     692        size_t magcount = atomic_load(&cache->magazine_counter);
    693693
    694694        slab_magazine_t *mag;
  • kernel/generic/src/proc/scheduler.c

    r5f1d850 r3cfe2b8  
    566566void kcpulb(void *arg)
    567567{
    568         atomic_count_t average;
    569         atomic_count_t rdy;
     568        size_t average;
     569        size_t rdy;
    570570
    571571        /*
     
    593593                goto satisfied;
    594594
    595         atomic_count_t count = average - rdy;
     595        size_t count = average - rdy;
    596596
    597597        /*
  • kernel/generic/src/sysinfo/stats.c

    r5f1d850 r3cfe2b8  
    764764 *
    765765 */
    766 static inline load_t load_calc(load_t load, load_t exp, atomic_count_t ready)
     766static inline load_t load_calc(load_t load, load_t exp, size_t ready)
    767767{
    768768        load *= exp;
     
    784784
    785785        while (true) {
    786                 atomic_count_t ready = atomic_load(&nrdy);
     786                size_t ready = atomic_load(&nrdy);
    787787
    788788                /* Mutually exclude with get_stats_load() */
  • kernel/test/synch/rcu1.c

    r5f1d850 r3cfe2b8  
    361361typedef struct {
    362362        rcu_item_t rcu;
    363         atomic_count_t start_time;
     363        size_t start_time;
    364364} seq_item_t;
    365365
     
    368368
    369369static atomic_t cur_time = { 1 };
    370 static atomic_count_t max_upd_done_time = { 0 };
     370static size_t max_upd_done_time = { 0 };
    371371
    372372static void seq_cb(rcu_item_t *rcu_item)
     
    399399                for (size_t i = 0; i < work->read_cnt; ++i) {
    400400                        rcu_read_lock();
    401                         atomic_count_t start_time = atomic_postinc(&cur_time);
     401                        size_t start_time = atomic_postinc(&cur_time);
    402402
    403403                        for (volatile size_t d = 0; d < 10 * i; ++d) {
  • kernel/test/synch/semaphore1.c

    r5f1d850 r3cfe2b8  
    7373{
    7474        int i, j, k;
    75         atomic_count_t consumers;
    76         atomic_count_t producers;
     75        size_t consumers;
     76        size_t producers;
    7777
    7878        waitq_initialize(&can_start);
  • kernel/test/thread/thread1.c

    r5f1d850 r3cfe2b8  
    5656{
    5757        unsigned int i;
    58         atomic_count_t total = 0;
     58        size_t total = 0;
    5959
    6060        atomic_store(&finish, 1);
Note: See TracChangeset for help on using the changeset viewer.