developer | 02e6591 | 2023-08-17 16:33:10 +0800 | [diff] [blame] | 1 | /* adapter_getpid.c |
| 2 | * |
| 3 | * Linux kernel specific Adapter module |
| 4 | * responsible for adapter-wide pid management. |
| 5 | */ |
| 6 | |
| 7 | /***************************************************************************** |
| 8 | * Copyright (c) 2015-2020 by Rambus, Inc. and/or its subsidiaries. |
| 9 | * |
| 10 | * This program is free software: you can redistribute it and/or modify |
| 11 | * it under the terms of the GNU General Public License as published by |
| 12 | * the Free Software Foundation, either version 2 of the License, or |
| 13 | * any later version. |
| 14 | * |
| 15 | * This program is distributed in the hope that it will be useful, |
| 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 18 | * GNU General Public License for more details. |
| 19 | * |
| 20 | * You should have received a copy of the GNU General Public License |
| 21 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
| 22 | *****************************************************************************/ |
| 23 | |
| 24 | // Adapter GetPid API |
| 25 | #include "adapter_getpid.h" |
| 26 | |
| 27 | // Linux Kernel API |
| 28 | #include <asm/current.h> // process information |
| 29 | #include <linux/sched.h> // for "struct task_struct" |
| 30 | |
| 31 | |
| 32 | /*---------------------------------------------------------------------------- |
| 33 | * Adapter_GetPid |
| 34 | */ |
| 35 | int |
| 36 | Adapter_GetPid(void) |
| 37 | { |
| 38 | return (int)current->pid; |
| 39 | } |
| 40 | |
| 41 | |
| 42 | /* end of file adapter_getpid.c */ |