Skip to content
Snippets Groups Projects
Select Git revision
  • 5a9fa73072854981a5c05eb7ba18a96d49c2804f
  • drm-misc-templates default
  • wip/final/kci-gitlab-lava-v1
  • wip/vignesh/kci-lava-gitlab-runner
  • kci-gitlab-igt-v8
  • kci-gitlab-igt-v4
  • drm-misc-fixes-2024-10-02
  • drm-misc-next-2024-09-26
  • drm-misc-fixes-2024-09-26
  • drm-misc-next-2024-09-20
  • drm-misc-fixes-2024-09-12
  • drm-misc-fixes-2024-09-05
  • drm-misc-next-fixes-2024-09-05
  • drm-misc-fixes-2024-08-29
  • drm-misc-next-2024-08-29
  • drm-misc-next-2024-08-22
  • drm-misc-fixes-2024-08-22
  • drm-misc-next-2024-08-16
  • drm-misc-fixes-2024-08-15
  • drm-misc-next-2024-08-09
  • drm-misc-fixes-2024-08-08
  • drm-misc-next-2024-08-01
  • drm-misc-fixes-2024-08-01
  • drm-misc-next-fixes-2024-07-25
  • drm-misc-next-fixes-2024-07-19
  • drm-misc-next-fixes-2024-07-11
26 results

posix-timers.c

Blame
  • posix-timers.c 27.79 KiB
    /*
     * linux/kernel/posix-timers.c
     *
     *
     * 2002-10-15  Posix Clocks & timers
     *                           by George Anzinger george@mvista.com
     *
     *			     Copyright (C) 2002 2003 by MontaVista Software.
     *
     * 2004-06-01  Fix CLOCK_REALTIME clock/timer TIMER_ABSTIME bug.
     *			     Copyright (C) 2004 Boris Hu
     *
     * This program is free software; you can redistribute it and/or modify
     * it under the terms of the GNU General Public License as published by
     * the Free Software Foundation; either version 2 of the License, or (at
     * your option) any later version.
     *
     * This program is distributed in the hope that it will be useful, but
     * WITHOUT ANY WARRANTY; without even the implied warranty of
     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
     * General Public License for more details.
    
     * You should have received a copy of the GNU General Public License
     * along with this program; if not, write to the Free Software
     * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
     *
     * MontaVista Software | 1237 East Arques Avenue | Sunnyvale | CA 94085 | USA
     */
    
    /* These are all the functions necessary to implement
     * POSIX clocks & timers
     */
    #include <linux/mm.h>
    #include <linux/interrupt.h>
    #include <linux/slab.h>
    #include <linux/time.h>
    #include <linux/mutex.h>
    
    #include <asm/uaccess.h>
    #include <linux/list.h>
    #include <linux/init.h>
    #include <linux/compiler.h>
    #include <linux/idr.h>
    #include <linux/posix-timers.h>
    #include <linux/syscalls.h>
    #include <linux/wait.h>
    #include <linux/workqueue.h>
    #include <linux/module.h>
    
    /*
     * Management arrays for POSIX timers.	 Timers are kept in slab memory
     * Timer ids are allocated by an external routine that keeps track of the
     * id and the timer.  The external interface is:
     *
     * void *idr_find(struct idr *idp, int id);           to find timer_id <id>
     * int idr_get_new(struct idr *idp, void *ptr);       to get a new id and
     *                                                    related it to <ptr>
     * void idr_remove(struct idr *idp, int id);          to release <id>
     * void idr_init(struct idr *idp);                    to initialize <idp>
     *                                                    which we supply.
     * The idr_get_new *may* call slab for more memory so it must not be
     * called under a spin lock.  Likewise idr_remore may release memory
     * (but it may be ok to do this under a lock...).
     * idr_find is just a memory look up and is quite fast.  A -1 return
     * indicates that the requested id does not exist.
     */
    
    /*
     * Lets keep our timers in a slab cache :-)
     */