Changeset 0389b30 in rtems-libbsd


Ignore:
Timestamp:
01/15/19 14:35:11 (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
9e7f3b7
Parents:
5aa6ee5
git-author:
Sebastian Huber <sebastian.huber@…> (01/15/19 14:35:11)
git-committer:
Sebastian Huber <sebastian.huber@…> (01/22/19 12:14:33)
Message:

Fix INVARIANTS support

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sys/dev/e1000/e1000_osdep.h

    r5aa6ee5 r0389b30  
    254254
    255255
    256 #if defined(INVARIANTS)
     256#if defined(INVARIANTS) && !defined(__rtems__)
    257257#include <sys/proc.h>
    258258
  • freebsd/sys/sys/sx.h

    r5aa6ee5 r0389b30  
    236236#endif  /* LOCK_DEBUG > 0 || SX_NOINLINE */
    237237#if     (LOCK_DEBUG > 0)
     238#ifndef __rtems__
    238239#define sx_slock_(sx, file, line)                                       \
    239240        (void)_sx_slock((sx), 0, (file), (line))
     241#else /* __rtems__ */
     242#define sx_slock_(sx, file, line)                                       \
     243        (void)_sx_xlock((sx), 0, (file), (line))
     244#endif /* __rtems__ */
    240245#define sx_slock_sig_(sx, file, line)                                   \
    241246        _sx_slock((sx), SX_INTERRUPTIBLE, (file) , (line))
  • freebsd/sys/vm/uma_core.c

    r5aa6ee5 r0389b30  
    339339    "Memory allocation debugging");
    340340
     341#ifndef __rtems__
    341342static u_int dbg_divisor = 1;
    342343SYSCTL_UINT(_vm_debug, OID_AUTO, divisor,
     
    350351SYSCTL_COUNTER_U64(_vm_debug, OID_AUTO, skipped, CTLFLAG_RD,
    351352    &uma_skip_cnt, "memory items skipped, not debugged");
     353#else /* __rtems__ */
     354#define dbg_divisor 1
     355#endif /* __rtems__ */
    352356#endif
    353357
     
    22462250
    22472251#ifdef INVARIANTS
     2252#ifndef __rtems__
    22482253        TUNABLE_INT_FETCH("vm.debug.divisor", &dbg_divisor);
    22492254        uma_dbg_cnt = counter_u64_alloc(M_WAITOK);
    22502255        uma_skip_cnt = counter_u64_alloc(M_WAITOK);
     2256#endif /* __rtems__ */
    22512257#endif
    22522258        callout_init(&uma_callout, 1);
     
    27932799                    "uma_zalloc_domain: zone \"%s\"", zone->uz_name);
    27942800        }
     2801#ifndef __rtems__
    27952802        KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(),
    27962803            ("uma_zalloc_domain: called with spinlock or critical section held"));
     2804#endif /* __rtems__ */
    27972805
    27982806        return (zone_alloc_item(zone, udata, domain, flags));
     
    34753483            zone->uz_name);
    34763484
     3485#ifndef __rtems__
    34773486        KASSERT(curthread->td_critnest == 0 || SCHEDULER_STOPPED(),
    34783487            ("uma_zfree_domain: called with spinlock or critical section held"));
     3488#endif /* __rtems__ */
    34793489
    34803490        /* uma_zfree(..., NULL) does nothing, to match free(9). */
     
    43584368                return (false);
    43594369
     4370#ifndef __rtems__
    43604371        idx = (uintptr_t)mem >> PAGE_SHIFT;
    43614372        if (keg->uk_ipers > 1) {
     
    43694380        }
    43704381        counter_u64_add(uma_dbg_cnt, 1);
     4382#endif /* __rtems__ */
    43714383
    43724384        return (false);
  • rtemsbsd/include/sys/epoch.h

    r5aa6ee5 r0389b30  
    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

    r5aa6ee5 r0389b30  
    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.