2 * This file is part of OMAP DSP driver (DSP Gateway version 3.3.1)
4 * Copyright (C) 2004-2006 Nokia Corporation. All rights reserved.
6 * Contact: Toshihiro Kobayashi <toshihiro.kobayashi@nokia.com>
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * version 2 as published by the Free Software Foundation.
12 * This program is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 #ifndef __PLAT_OMAP_DSP_PROCLIST_H
25 #define __PLAT_OMAP_DSP_PROCLIST_H
28 struct list_head list_head;
33 static inline int proc_list_add(spinlock_t *lock, struct list_head *list,
34 struct task_struct *tsk, struct file *file)
36 struct proc_list *new;
38 new = kmalloc(sizeof(struct proc_list), GFP_KERNEL);
44 list_add_tail(&new->list_head, list);
50 static inline void proc_list_del(spinlock_t *lock, struct list_head *list,
51 struct task_struct *tsk, struct file *file)
56 list_for_each_entry(pl, list, list_head) {
57 if (pl->file == file) {
58 list_del(&pl->list_head);
65 /* correspinding file struct isn't found in the list ??? */
66 printk(KERN_ERR "proc_list_del(): proc_list is inconsistent!\n"
67 "struct file (%p) not found\n", file);
68 printk(KERN_ERR "listing proc_list...\n");
69 list_for_each_entry(pl, list, list_head)
70 printk(KERN_ERR " pid:%d file:%p\n", pl->pid, pl->file);
74 static inline void proc_list_flush(spinlock_t *lock, struct list_head *list)
79 while (!list_empty(list)) {
80 pl = list_entry(list->next, struct proc_list, list_head);
81 list_del(&pl->list_head);
87 #endif /* __PLAT_OMAP_DSP_PROCLIST_H */