root / Whitix / branches / network / include / task.h
| Revision 237, 1.8 kB (checked in by mwhitworth, 9 months ago) |
|---|
| Line | |
|---|---|
| 1 | /* This file is part of Whitix. |
| 2 | * |
| 3 | * Whitix is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License as published by |
| 5 | * the Free Software Foundation; either version 2 of the License, or |
| 6 | * (at your option) any later version. |
| 7 | * |
| 8 | * Whitix is distributed in the hope that it will be useful, |
| 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | * GNU General Public License for more details. |
| 12 | * |
| 13 | * You should have received a copy of the GNU General Public License |
| 14 | * along with Whitix; if not, write to the Free Software |
| 15 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 16 | * |
| 17 | */ |
| 18 | |
| 19 | #ifndef TASK_H |
| 20 | #define TASK_H |
| 21 | |
| 22 | #include <llist.h> |
| 23 | #include <typedefs.h> |
| 24 | #include <i386/virtual.h> |
| 25 | #include <i386/i386.h> |
| 26 | #include <wait.h> |
| 27 | |
| 28 | struct Process; |
| 29 | |
| 30 | #define THR_USED_MATH 1 |
| 31 | |
| 32 | struct Thread |
| 33 | { |
| 34 | volatile DWORD currStack; |
| 35 | struct Process* parent; |
| 36 | DWORD state,entry,esp3; |
| 37 | struct ListHead list; |
| 38 | int quantums,flags,priority, id; |
| 39 | int refs; /* Used by waitqueues and ThrFreeProcess really, otherwise WakeUp ends up waking a thread that doesn't exist */ |
| 40 | struct FpuSave fpuData; |
| 41 | struct Context* currContext; |
| 42 | }; |
| 43 | |
| 44 | extern struct Thread* idleTask; |
| 45 | |
| 46 | /* Thread defines go here */ |
| 47 | |
| 48 | #define THR_RUNNING 1 |
| 49 | #define THR_PAUSED 2 |
| 50 | #define THR_DYING 4 |
| 51 | |
| 52 | struct Process |
| 53 | { |
| 54 | struct ListHead next,sibling,children; |
| 55 | int exitCode,refs,state; |
| 56 | struct File* files; /* Dynamically allocated */ |
| 57 | int numFds; |
| 58 | struct VNode *cwd,*root,*exec; |
| 59 | char* name; |
| 60 | WaitQueue waitQueue; |
| 61 | char* sCwd; /* Allocated dynamically, size is PATH_MAX */ |
| 62 | DWORD pid; |
| 63 | int cId; |
| 64 | struct ListHead areaList; |
| 65 | struct MemManager* memManager; |
| 66 | struct Process* parent; |
| 67 | }; |
| 68 | |
| 69 | #endif |
Note: See TracBrowser
for help on using the browser.