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

Diff of /rtmk/host.c

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

revision 1.4 by jrydberg, Thu Feb 21 01:41:45 2002 UTC revision 1.5 by jrydberg, Wed Mar 6 00:55:01 2002 UTC
# Line 44  host_init (void) Line 44  host_init (void)
44  {  {
45    master_host_port = ipc_port_create_kernel ();    master_host_port = ipc_port_create_kernel ();
46    assert (master_host_port);    assert (master_host_port);
47    ipc_port_set_kobject (master_host_port, IPC_KOBJECT_TYPE_HOST, 0);    /* ipc_port_set_kobject (master_host_port, IPC_KOBJECT_TYPE_HOST, 0); */
48    
49      /* "host_init()" is always called by the master processor.  */
50      host_info_processor [CPU_CURRENT ()].master_p = 1;
51      host_info_processor [CPU_CURRENT ()].running_p = 1;
52    
53    /* Initialize some of the fields in host_info_basic.  */    /* Initialize some of the fields in host_info_basic.  */
54    host_info_basic.max_processors = NCPUS;    host_info_basic.max_processors = NCPUS;
# Line 95  host_memory_object_create (struct ipc_po Line 99  host_memory_object_create (struct ipc_po
99                             vm_offset_t offset, vm_size_t size,                             vm_offset_t offset, vm_size_t size,
100                             struct vm_object **objectp)                             struct vm_object **objectp)
101  {  {
102    struct vm_object *object;    return KERN_INVALID_ARGUMENT;
   
   /* We must use the priviledged port this this.  */  
   if (host_port != master_host_port)  
     return KERN_PROTECTION_FAILURE;  
   
   object = vm_object_allocate (vm_round_page (size));  
   if (! object)  
     return KERN_RESOURCE_SHORTAGE;  
   
   host_pager_init_object (object, offset);  
   *objectp = object;  
   return KERN_SUCCESS;  
103  }  }
104    
105  /* ??? */  /* ??? */
# Line 149  host_info (struct ipc_port *host, int fl Line 141  host_info (struct ipc_port *host, int fl
141  {  {
142    int i, size;    int i, size;
143    
144    if (! host || host->kobject.type != IPC_KOBJECT_TYPE_HOST)    if (! host || (host->kobject.type != IPC_KOBJECT_TYPE_HOST
145                     && host != master_host_port))
146      return KERN_INVALID_HOST;      return KERN_INVALID_HOST;
147    
148    switch (flavor)    switch (flavor)
# Line 173  host_info (struct ipc_port *host, int fl Line 166  host_info (struct ipc_port *host, int fl
166            memcpy (buf, &host_info_processor [i],            memcpy (buf, &host_info_processor [i],
167                    HOST_INFO_PROCESSOR_COUNT);                    HOST_INFO_PROCESSOR_COUNT);
168            size = size - HOST_INFO_PROCESSOR_COUNT;            size = size - HOST_INFO_PROCESSOR_COUNT;
169              buf  = buf  + HOST_INFO_PROCESSOR_COUNT;
170            *data_len = *data_len + HOST_INFO_PROCESSOR_COUNT;            *data_len = *data_len + HOST_INFO_PROCESSOR_COUNT;
171          }          }
172        return 0;        return 0;

Legend:
Removed from v.1.4  
changed lines
  Added in v.1.5

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