xref: /dflybsd-src/sys/dev/drm/include/linux/pid.h (revision ef59fcb643a58be7b46ef39243a79a2d4fcb1056)
1d6aa1cc5SFrançois Tigeot /*
27033be51SFrançois Tigeot  * Copyright (c) 2018-2020 François Tigeot <ftigeot@wolfpond.org>
3d6aa1cc5SFrançois Tigeot  * All rights reserved.
4d6aa1cc5SFrançois Tigeot  *
5d6aa1cc5SFrançois Tigeot  * Redistribution and use in source and binary forms, with or without
6d6aa1cc5SFrançois Tigeot  * modification, are permitted provided that the following conditions
7d6aa1cc5SFrançois Tigeot  * are met:
8d6aa1cc5SFrançois Tigeot  * 1. Redistributions of source code must retain the above copyright
9d6aa1cc5SFrançois Tigeot  *    notice unmodified, this list of conditions, and the following
10d6aa1cc5SFrançois Tigeot  *    disclaimer.
11d6aa1cc5SFrançois Tigeot  * 2. Redistributions in binary form must reproduce the above copyright
12d6aa1cc5SFrançois Tigeot  *    notice, this list of conditions and the following disclaimer in the
13d6aa1cc5SFrançois Tigeot  *    documentation and/or other materials provided with the distribution.
14d6aa1cc5SFrançois Tigeot  *
15d6aa1cc5SFrançois Tigeot  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16d6aa1cc5SFrançois Tigeot  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
17d6aa1cc5SFrançois Tigeot  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
18d6aa1cc5SFrançois Tigeot  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
19d6aa1cc5SFrançois Tigeot  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
20d6aa1cc5SFrançois Tigeot  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21d6aa1cc5SFrançois Tigeot  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22d6aa1cc5SFrançois Tigeot  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23d6aa1cc5SFrançois Tigeot  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
24d6aa1cc5SFrançois Tigeot  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25d6aa1cc5SFrançois Tigeot  */
26d6aa1cc5SFrançois Tigeot 
27d6aa1cc5SFrançois Tigeot #ifndef _LINUX_PID_H_
28d6aa1cc5SFrançois Tigeot #define _LINUX_PID_H_
29d6aa1cc5SFrançois Tigeot 
30d6aa1cc5SFrançois Tigeot #include <linux/rcupdate.h>
31d6aa1cc5SFrançois Tigeot 
32d6aa1cc5SFrançois Tigeot enum pid_type
33d6aa1cc5SFrançois Tigeot {
34d6aa1cc5SFrançois Tigeot 	PIDTYPE_PID,
35d6aa1cc5SFrançois Tigeot };
36d6aa1cc5SFrançois Tigeot 
377033be51SFrançois Tigeot static inline void
put_pid(pid_t pid)387033be51SFrançois Tigeot put_pid(pid_t  pid)
397033be51SFrançois Tigeot {
407033be51SFrançois Tigeot 	/* Linux decrements a reference counter here */
417033be51SFrançois Tigeot }
427033be51SFrançois Tigeot 
43d80af184SFrançois Tigeot static inline pid_t
pid_nr(pid_t pid)44d80af184SFrançois Tigeot pid_nr(pid_t pid)
45d80af184SFrançois Tigeot {
46d80af184SFrançois Tigeot 	return pid;
47d80af184SFrançois Tigeot }
48d80af184SFrançois Tigeot 
49*ef59fcb6SFrançois Tigeot pid_t get_task_pid(struct task_struct *task, enum pid_type type);
50*ef59fcb6SFrançois Tigeot 
51d6aa1cc5SFrançois Tigeot #endif	/* _LINUX_PID_H_ */
52