Changeset a336c46 in rtems-libbsd


Ignore:
Timestamp:
Mar 14, 2016, 8:25:04 AM (4 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
c1e05b9ea378b2971e3d7704779112b4bc4296da, freebsd-9.3, 4a77611a223ea883fb548679b516d326a020d447
Children:
652b024
Parents:
96bf77b
git-author:
Sebastian Huber <sebastian.huber@…> (03/14/16 08:25:04)
git-committer:
Sebastian Huber <sebastian.huber@…> (03/14/16 08:25:51)
Message:

Update due to Watchdog Handler changes

Files:
3 edited

Legend:

Unmodified
Added
Removed
  • freebsd/sys/kern/subr_sleepqueue.c

    r96bf77b ra336c46  
    8989#ifdef __rtems__
    9090#include <machine/rtems-bsd-thread.h>
     91#undef ticks
    9192#include <rtems/score/threadimpl.h>
    9293#include <rtems/score/watchdogimpl.h>
     
    177178static void     sleepq_timeout(void *arg);
    178179#else /* __rtems__ */
    179 static void     sleepq_timeout(Objects_Id id, void *arg);
     180static void     sleepq_timeout(Watchdog_Control *watchdog);
    180181#endif /* __rtems__ */
    181182
     
    418419        callout_reset_curcpu(&td->td_slpcallout, timo, sleepq_timeout, td);
    419420#else /* __rtems__ */
     421        Per_CPU_Control *cpu_self;
    420422        Thread_Control *executing;
    421423
    422         _Thread_Disable_dispatch();
    423         executing = _Thread_Executing;
    424         BSD_ASSERT(executing->Timer.state == WATCHDOG_INACTIVE);
    425         _Watchdog_Initialize(&executing->Timer, sleepq_timeout,
    426             0, executing);
    427         _Watchdog_Insert_ticks(&executing->Timer, (Watchdog_Interval)timo);
    428         _Thread_Enable_dispatch();
     424        cpu_self = _Thread_Dispatch_disable();
     425        executing = _Per_CPU_Get_executing(cpu_self);
     426        BSD_ASSERT(_Watchdog_Get_state(&executing->Timer.Watchdog) ==
     427            WATCHDOG_INACTIVE);
     428        _Thread_Timer_insert_relative(executing, cpu_self, sleepq_timeout,
     429            (Watchdog_Interval)timo);
     430        _Thread_Dispatch_enable(cpu_self);
    429431#endif /* __rtems__ */
    430432}
     
    667669
    668670                if (unblock) {
    669                         _Watchdog_Remove_ticks(&executing->Timer);
     671                        _Thread_Timer_remove(executing);
    670672                        _Thread_Clear_state(executing, STATES_WAITING_FOR_BSD_WAKEUP);
    671673                }
     
    951953        }
    952954#else /* __rtems__ */
    953         unblock = _Watchdog_Is_active(&thread->Timer);
     955        unblock = _Watchdog_Is_scheduled(&thread->Timer.Watchdog);
    954956        switch (td->td_sq_state) {
    955957        case TD_SQ_SLEEPING:
     
    972974                _Thread_Lock_release_default(thread, &lock_context);
    973975
    974                 _Watchdog_Remove_ticks(&thread->Timer);
     976                _Thread_Timer_remove(thread);
    975977                _Thread_Clear_state(thread, STATES_WAITING_FOR_BSD_WAKEUP);
    976978
     
    11671169#else /* __rtems__ */
    11681170static void
    1169 sleepq_timeout(Objects_Id id, void *arg)
     1171sleepq_timeout(Watchdog_Control *watchdog)
    11701172{
    11711173        Thread_Control *thread;
     
    11741176        bool unblock;
    11751177
    1176         thread = arg;
     1178        thread = RTEMS_CONTAINER_OF(watchdog, Thread_Control, Timer.Watchdog);
    11771179        td = rtems_bsd_get_thread(thread);
    11781180        BSD_ASSERT(td != NULL);
  • freebsd/sys/kern/sys_generic.c

    r96bf77b ra336c46  
    18991899#include <machine/rtems-bsd-thread.h>
    19001900
     1901#undef ticks
     1902
    19011903#include <rtems/score/objectimpl.h>
    19021904#include <rtems/score/threadimpl.h>
  • rtemsbsd/rtems/rtems-bsd-thread.c

    r96bf77b ra336c46  
    5353
    5454#include <rtems/bsd/bsd.h>
     55
     56#undef ticks
    5557
    5658#include <rtems/score/objectimpl.h>
Note: See TracChangeset for help on using the changeset viewer.