Fixed ZDE build - missing header file
[ZeXOS.git] / kernel / include / proc.h
blobc736ada37874704243dc80f33aec84fc4575e05f
1 /*
2 * ZeX/OS
3 * Copyright (C) 2007 Tomas 'ZeXx86' Jedrzejek (zexx86@zexos.org)
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 #ifndef _PROC_H
21 #define _PROC_H
23 #include <tty.h>
25 #define PROC_USER_PRIORITY 128
27 #define PROC_FLAG_DAEMON 0x1
29 /* Process id */
30 typedef unsigned pid_t;
32 /* Process structure */
33 typedef struct proc_context {
34 struct proc_context *next, *prev;
36 task_t *task;
37 pid_t pid;
38 tty_t *tty;
39 char name[12];
41 unsigned argc;
42 char **argv;
44 unsigned short flags;
46 unsigned start;
47 unsigned code;
48 unsigned data;
49 unsigned data_off;
50 unsigned bss;
51 unsigned end;
52 unsigned heap;
53 } proc_t;
55 /* externs */
56 extern proc_t proc_kernel;
58 extern void proc_display ();
59 extern proc_t *proc_find (task_t *task);
60 extern proc_t *proc_findbypid (pid_t pid);
61 extern proc_t *proc_create (tty_t *tty, char *name, unsigned entry);
62 extern bool proc_done (proc_t *proc);
63 extern bool proc_signal (proc_t *proc, unsigned signal);
64 extern bool proc_arg_set (proc_t *proc, char *arg, unsigned argl);
65 extern bool proc_arg_free (proc_t *proc);
66 extern bool proc_arg_get (proc_t *proc, unsigned *argc, char **argv);
67 extern unsigned proc_page_fault ();
68 extern unsigned proc_vmem_map (proc_t *proc);
69 extern unsigned proc_vmem_unmap (proc_t *proc);
70 extern unsigned proc_thread_create (void *entry, void *arg);
71 extern unsigned proc_thread_destroy (proc_t *proc, task_t *task);
72 extern unsigned int init_proc (void);
74 #endif