1 |
/* Task - container for address space, ipc space and threads. |
/* Task - container for address space, ipc space and threads. |
2 |
Copyright 1999, 2000, 2001 Johan Rydberg, jrydberg@opencores.org. |
Copyright 1999, 2000, 2001, 2002 Johan Rydberg, jrydberg@opencores.org. |
3 |
|
|
4 |
This program is free software; you can redistribute it and/or modify |
This program is free software; you can redistribute it and/or modify |
5 |
it under the terms of the GNU General Public License as published by |
it under the terms of the GNU General Public License as published by |
42 |
|
|
43 |
/* Kernel IPC port for the task. The kernel have receive rights for |
/* Kernel IPC port for the task. The kernel have receive rights for |
44 |
this port and threads uses it to control the task. */ |
this port and threads uses it to control the task. */ |
|
|
|
45 |
struct ipc_port *task_port; |
struct ipc_port *task_port; |
46 |
|
|
47 |
/* Cache for initialize send right name in tasks IPC object. */ |
/* Cache for initialize send right name in tasks IPC object. */ |
|
|
|
48 |
rtmk_port_t task_right_name; |
rtmk_port_t task_right_name; |
49 |
|
|
50 |
|
/* Special ports for this task. ??? should hold TASK_PORT. */ |
51 |
|
struct ipc_port *special_ports [8]; |
52 |
}; |
}; |
53 |
|
|
54 |
/* Return pointer to kernel task. */ |
/* Return pointer to kernel task. */ |
60 |
|
|
61 |
/* Create a new task. Inherit memory from PARENT_TASK if INHERIT_MEMORY_P |
/* Create a new task. Inherit memory from PARENT_TASK if INHERIT_MEMORY_P |
62 |
is true. New task is returned in CHILD_TASKP. */ |
is true. New task is returned in CHILD_TASKP. */ |
|
|
|
63 |
extern kern_return_t task_create (struct task *parent_task, |
extern kern_return_t task_create (struct task *parent_task, |
64 |
bool inherit_memory_p, |
bool inherit_memory_p, |
65 |
struct task **child_taskp); |
struct task **child_taskp); |
66 |
|
|
67 |
|
/* Terminate TASK and release all resources held by it. */ |
68 |
|
extern kern_return_t task_terminate (struct task *task); |
69 |
|
|
70 |
|
/* Set special port in TASK to PORT at SLOT in special port array. */ |
71 |
|
extern kern_return_t task_special_port_set (struct task *task, int slot, |
72 |
|
struct ipc_port *port); |
73 |
|
|
74 |
|
/* Get send rights to port SLOT in TASK's special port set. |
75 |
|
Right is returned in PORTP. */ |
76 |
|
extern kern_return_t task_special_port_get (struct task *task, int slot, |
77 |
|
struct ipc_port **portp); |
78 |
|
|
79 |
#endif /* task.h */ |
#endif /* task.h */ |