/[rtmk]/rtmk/task.c
ViewVC logotype

Diff of /rtmk/task.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.8 by jrydberg, Thu Feb 21 23:43:58 2002 UTC revision 1.9 by jrydberg, Fri Feb 22 22:41:48 2002 UTC
# Line 23  Foundation, Inc., 59 Temple Place - Suit Line 23  Foundation, Inc., 59 Temple Place - Suit
23  #include "tm.h"  #include "tm.h"
24  #include "task.h"  #include "task.h"
25  #include "vm-slab.h"  #include "vm-slab.h"
26    #include "vm-kmem.h"
27  #include "trace.h"  #include "trace.h"
28  #include "ipc-object.h"  #include "ipc-object.h"
29  #include "thread.h"  #include "thread.h"
# Line 36  static struct kmem_cache *task_cache; Line 37  static struct kmem_cache *task_cache;
37    
38  /* 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
39     is true.  New task is returned in CHILD_TASKP.  */     is true.  New task is returned in CHILD_TASKP.  */
   
40  kern_return_t  kern_return_t
41  task_create (struct task *parent_task, bool inherit_memory_p,  task_create (struct task *parent_task, bool inherit_memory_p,
42               struct task **child_taskp)               struct task **child_taskp)
# Line 67  task_create (struct task *parent_task, b Line 67  task_create (struct task *parent_task, b
67        return KERN_RESOURCE_SHORTAGE;        return KERN_RESOURCE_SHORTAGE;
68      }      }
69    
70    /* We inherit send rights to the special ports.  */    if (parent_task)
   for (i = 0; i < 8 && parent_task; i++)  
71      {      {
72        if (parent_task->special_ports [i])        if (parent_task->exception_port)
73          {          {
74            new_task->special_ports [i]            new_task->exception_port
75              = ipc_port_copy_send (parent_task->special_ports [i]);              = ipc_port_copy_send (parent_task->exception_port);
76          }          }
     }  
77    
78          /* We inherit send rights to the special ports.  */
79          for (i = 0; i < 8; i++)
80            {
81              if (parent_task->special_ports [i])
82                {
83                  new_task->special_ports [i]
84                    = ipc_port_copy_send (parent_task->special_ports [i]);
85                }
86            }
87        }
88    
89    queue_init (&new_task->thread_list);    queue_init (&new_task->thread_list);
90    new_task->ipc_object = ipc_object_create ();    new_task->ipc_object = ipc_object_create ();
# Line 205  task_special_port_set (struct task *task Line 213  task_special_port_set (struct task *task
213    switch (slot)    switch (slot)
214      {      {
215      case TASK_SPECIAL_PORT_KERNEL:      case TASK_SPECIAL_PORT_KERNEL:
216        slotp = & task->task_port;        slotp = & task->send_task_port;
217          break;
218        case TASK_SPECIAL_PORT_EXCEPTION:
219          slotp = & task->exception_port;
220        break;        break;
221      default:      default:
222        slotp = & task->special_ports [slot];        slotp = & task->special_ports [slot];
# Line 243  task_special_port_get (struct task *task Line 254  task_special_port_get (struct task *task
254    switch (slot)    switch (slot)
255      {      {
256      case TASK_SPECIAL_PORT_KERNEL:      case TASK_SPECIAL_PORT_KERNEL:
257        slotp = & task->task_port;        slotp = & task->send_task_port;
258          break;
259        case TASK_SPECIAL_PORT_EXCEPTION:
260          slotp = & task->exception_port;
261        break;        break;
262      default:      default:
263        slotp = & task->special_ports [slot];        slotp = & task->special_ports [slot];
# Line 255  task_special_port_get (struct task *task Line 269  task_special_port_get (struct task *task
269    
270    return KERN_SUCCESS;    return KERN_SUCCESS;
271  }  }
272    

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26