Changeset 145dcd5


Ignore:
Timestamp:
Jan 14, 2022, 6:55:14 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, forall-pointer-decay, master, pthread-emulation, qualifiedEnum
Children:
c90db2d
Parents:
07a1e7a
Message:

Now using MAX instead of -1u since it's more appropriate.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • libcfa/src/concurrency/kernel/startup.cfa

    r07a1e7a r145dcd5  
    3434#include "kernel_private.hfa"
    3535#include "startup.hfa"          // STARTUP_PRIORITY_XXX
     36#include "limits.hfa"
    3637#include "math.hfa"
    3738
     
    513514        this.rdq.its = 0;
    514515        this.rdq.itr = 0;
    515         this.rdq.id  = -1u;
    516         this.rdq.target = -1u;
    517         this.rdq.last = -1u;
    518         this.rdq.cutoff = 0ull;
     516        this.rdq.id  = MAX;
     517        this.rdq.target = MAX;
     518        this.rdq.last = MAX;
     519        this.rdq.cpu = 0;
     520        // this.rdq.cutoff = 0ull;
    519521        do_terminate = false;
    520522        preemption_alarm = 0p;
     
    684686        uint_fast32_t last_size;
    685687        [this->unique_id, last_size] = ready_mutate_register();
     688
     689                this->rdq.cpu = __kernel_getcpu();
    686690
    687691                this->cltr->procs.total += 1u;
  • tests/device/cpu.cfa

    r07a1e7a r145dcd5  
    1515
    1616
     17#include <device/cpu.hfa>
     18#include <limits.hfa>
    1719#include <fstream.hfa>
    18 #include <device/cpu.hfa>
    1920#include <stdlib.hfa>
    2021
     
    118119
    119120        unsigned found_level = 0;
    120         unsigned found = -1u;
     121        unsigned found = MAX;
    121122        for(i; idxs) {
    122123                unsigned idx = idxs - 1 - i;
     
    136137        }
    137138
    138         /* paranoid */ verify(found != -1u);
     139        /* paranoid */ verify(found != MAX);
    139140        return found;
    140141}
Note: See TracChangeset for help on using the changeset viewer.