/[rtmk]/rtmk/vm-syscall.c
ViewVC logotype

Diff of /rtmk/vm-syscall.c

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

revision 1.1.1.1 by jrydberg, Fri Dec 7 02:05:49 2001 UTC revision 1.2 by jrydberg, Fri Jan 4 00:17:45 2002 UTC
# Line 22  Foundation, Inc., 59 Temple Place - Suit Line 22  Foundation, Inc., 59 Temple Place - Suit
22  #include "tm.h"  #include "tm.h"
23  #include "task.h"  #include "task.h"
24    
25    #include "vm-object.h"
26    
27  /* Map OBJECT at into the address space of TASK.  If ANYWHERE_P is  /* Map OBJECT at into the address space of TASK.  If ANYWHERE_P is
28     false we try to map the object at *OFFSETP, otherwise the kernel     false we try to map the object at *OFFSETP, otherwise the kernel
# Line 38  vm_map (struct task *task, struct vm_obj Line 39  vm_map (struct task *task, struct vm_obj
39                          protection, inherit, anywhere_p);                          protection, inherit, anywhere_p);
40    return kr;    return kr;
41  }  }
42    
43    
44    /* Allocate SIZE bytes in the address space of TASK.  If ANYWHERE_P is
45       false, enter new object at *OFFSETP, otherwise use suitable location.  */
46    
47    kern_return_t
48    vm_allocate (struct task *task, vm_size_t size, vm_offset_t *offsetp,
49                 bool anywhere_p)
50    {
51      struct vm_object *object;
52      kern_return_t kr;
53    
54      object = vm_object_allocate (size);
55      if (object == 0)
56        return KERN_RESOURCE_SHORTAGE;
57    
58      kr = vm_map_allocate (task->map, offsetp, size, object, VM_PROT_ALL,
59                            VM_PROT_ALL, VM_INHERIT_COPY, anywhere_p);
60      if (kr)
61        {
62          /* vm_object_deallocate (object); ??? */
63          return kr;
64        }
65      return KERN_SUCCESS;
66    }

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

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