akaros/user/pthread/profalarm.c
<<
>>
Prefs
   1/* Copyright (c) 2014 The Regents of the University of California
   2 * Kevin Klues <klueska@cs.berkeley.edu>
   3 * See LICENSE for details. */
   4
   5#include <pthread.h>
   6#include <parlib/pvcalarm.h>
   7
   8void pvcalarm_callback(void)
   9{
  10        if (current_uthread)
  11                pthread_kill((pthread_t)current_uthread, SIGPROF);
  12}
  13
  14void enable_profalarm(uint64_t usecs)
  15{
  16        enable_pvcalarms(PVCALARM_PROF, usecs, pvcalarm_callback);
  17}
  18
  19void disable_profalarm(void)
  20{
  21        disable_pvcalarms();
  22}
  23