Changeset 34cb55d in rtems-libbsd


Ignore:
Timestamp:
01/15/19 14:35:11 (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5-freebsd-12, 6-freebsd-12
Children:
6e94aeb
Parents:
1354d9b
git-author:
Sebastian Huber <sebastian.huber@…> (01/15/19 14:35:11)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/22/19 12:24:26)
Message:

Fix INVARIANTS support

Location:
rtemsbsd
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • rtemsbsd/include/sys/epoch.h

    r1354d9b r34cb55d  
    110110            void (*callback) (epoch_context_t));
    111111
    112 int     in_epoch(epoch_t epoch);
    113 int     in_epoch_verbose(epoch_t epoch, int dump_onfail);
     112int     _bsd_in_epoch(epoch_t epoch);
     113#define in_epoch(epoch) _bsd_in_epoch(epoch)
     114#define in_epoch_verbose(epoch, dump_onfail) _bsd_in_epoch(epoch)
    114115
    115116#define EPOCH_GET_RECORD(cpu_self, epoch) PER_CPU_DATA_GET_BY_OFFSET( \
  • rtemsbsd/rtems/rtems-kernel-epoch.c

    r1354d9b r34cb55d  
    3434#include <sys/kernel.h>
    3535#include <sys/epoch.h>
     36#ifdef INVARIANTS
     37#include <sys/systm.h>
     38#endif
    3639
    3740#include <machine/cpu.h>
     
    323326        _Thread_Dispatch_enable(cpu_self);
    324327}
     328
     329#ifdef INVARIANTS
     330int
     331_bsd_in_epoch(epoch_t epoch)
     332{
     333        Per_CPU_Control *cpu_self;
     334        Thread_Control *executing;
     335        struct epoch_record *er;
     336        struct epoch_pcpu *epcpu;
     337        struct epoch_tracker *tdwait;
     338        int in;
     339
     340        in = 0;
     341        cpu_self = _Thread_Dispatch_disable();
     342        executing = _Per_CPU_Get_executing(cpu_self);
     343        epcpu = PER_CPU_DATA_GET(cpu_self, struct epoch_pcpu, epoch);
     344        er = EPOCH_GET_RECORD(cpu_self, epoch);
     345
     346        TAILQ_FOREACH(tdwait, &er->er_tdlist, et_link) {
     347                if (tdwait->et_td == executing) {
     348                        in = 1;
     349                        break;
     350                }
     351        }
     352
     353        _Thread_Dispatch_enable(cpu_self);
     354        return (in);
     355}
     356#endif
Note: See TracChangeset for help on using the changeset viewer.