| 1 | /* $Id: task.c,v 1.1.1.1 2003/07/02 13:57:04 eleph Exp $ */
|
|---|
| 2 | /*
|
|---|
| 3 | * OS/2 implementation of Linux task kernel services
|
|---|
| 4 | *
|
|---|
| 5 | * (C) 2000-2002 InnoTek Systemberatung GmbH
|
|---|
| 6 | * (C) 2000-2001 Sander van Leeuwen (sandervl@xs4all.nl)
|
|---|
| 7 | *
|
|---|
| 8 | * This program is free software; you can redistribute it and/or
|
|---|
| 9 | * modify it under the terms of the GNU General Public License as
|
|---|
| 10 | * published by the Free Software Foundation; either version 2 of
|
|---|
| 11 | * the License, or (at your option) any later version.
|
|---|
| 12 | *
|
|---|
| 13 | * This program is distributed in the hope that it will be useful,
|
|---|
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|---|
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|---|
| 16 | * GNU General Public License for more details.
|
|---|
| 17 | *
|
|---|
| 18 | * You should have received a copy of the GNU General Public
|
|---|
| 19 | * License along with this program; if not, write to the Free
|
|---|
| 20 | * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139,
|
|---|
| 21 | * USA.
|
|---|
| 22 | *
|
|---|
| 23 | */
|
|---|
| 24 |
|
|---|
| 25 | #include <linux/version.h>
|
|---|
| 26 | #include <linux/kernel.h>
|
|---|
| 27 | #include <linux/fs.h>
|
|---|
| 28 | #include <linux/tqueue.h>
|
|---|
| 29 | #include <linux/interrupt.h>
|
|---|
| 30 | #define LINUX
|
|---|
| 31 | #include <ossdefos2.h>
|
|---|
| 32 |
|
|---|
| 33 | struct task_struct current_task = {0};
|
|---|
| 34 | struct task_struct *current = ¤t_task;
|
|---|
| 35 |
|
|---|
| 36 | void tasklet_hi_schedule(struct tasklet_struct *t)
|
|---|
| 37 | {
|
|---|
| 38 | if(t && t->func) {
|
|---|
| 39 | t->func(t->data);
|
|---|
| 40 | }
|
|---|
| 41 | }
|
|---|
| 42 |
|
|---|
| 43 | void tasklet_init(struct tasklet_struct *t,
|
|---|
| 44 | void (*func)(unsigned long), unsigned long data)
|
|---|
| 45 | {
|
|---|
| 46 | t->next = NULL;
|
|---|
| 47 | t->state = 0;
|
|---|
| 48 | t->func = func;
|
|---|
| 49 | t->data = data;
|
|---|
| 50 | }
|
|---|
| 51 |
|
|---|
| 52 | //Not pretty, but sblive driver compares pointers
|
|---|
| 53 | ULONG OSS32_SetFileId(ULONG fileid)
|
|---|
| 54 | {
|
|---|
| 55 | ULONG oldfileid = (ULONG)current_task.files;
|
|---|
| 56 |
|
|---|
| 57 | current_task.files = (struct files_struct *)fileid;
|
|---|
| 58 | return oldfileid;
|
|---|
| 59 | }
|
|---|