View | Details | Raw Unified | Return to bug 242679 | Differences between
and this patch

Collapse All | Expand All

(-)modules/freebsd/vmmemctl/os.c (-6 / +8 lines)
Lines 64-70 Link Here
64
64
65
typedef struct {
65
typedef struct {
66
   /* system structures */
66
   /* system structures */
67
   struct callout_handle callout_handle;
67
   struct callout callout_handle;
68
68
69
   /* termination flag */
69
   /* termination flag */
70
   volatile int stop;
70
   volatile int stop;
Lines 678-684 vmmemctl_poll(void *data) // IN Link Here
678
   if (!t->stop) {
678
   if (!t->stop) {
679
      /* invoke registered handler, rearm timer */
679
      /* invoke registered handler, rearm timer */
680
      Balloon_QueryAndExecute();
680
      Balloon_QueryAndExecute();
681
      t->callout_handle = timeout(vmmemctl_poll, t, BALLOON_POLL_PERIOD * hz);
681
      callout_reset(&t->callout_handle, BALLOON_POLL_PERIOD * hz, vmmemctl_poll,
682
          t);
682
   }
683
   }
683
}
684
}
684
685
Lines 712-726 vmmemctl_init(void) Link Here
712
   }
713
   }
713
714
714
   /* initialize timer state */
715
   /* initialize timer state */
715
   callout_handle_init(&state->timer.callout_handle);
716
   callout_init(&state->timer.callout_handle, 0);
716
717
717
   os_pmap_init(pmap);
718
   os_pmap_init(pmap);
718
   os_balloonobject_create();
719
   os_balloonobject_create();
719
720
720
   /* Set up and start polling */
721
   /* Set up and start polling */
721
   callout_handle_init(&t->callout_handle);
722
   callout_init(&t->callout_handle, 0);
722
   t->stop = FALSE;
723
   t->stop = FALSE;
723
   t->callout_handle = timeout(vmmemctl_poll, t, BALLOON_POLL_PERIOD * hz);
724
   callout_reset(&t->callout_handle, BALLOON_POLL_PERIOD * hz, vmmemctl_poll,
725
       t);
724
726
725
   vmmemctl_init_sysctl();
727
   vmmemctl_init_sysctl();
726
728
Lines 759-765 vmmemctl_cleanup(void) Link Here
759
761
760
   /* Stop polling */
762
   /* Stop polling */
761
   t->stop = TRUE;
763
   t->stop = TRUE;
762
   untimeout(vmmemctl_poll, t, t->callout_handle);
764
   callout_stop(&t->callout_handle);
763
765
764
   os_balloonobject_delete();
766
   os_balloonobject_delete();
765
   os_pmap_free(pmap);
767
   os_pmap_free(pmap);

Return to bug 242679