request queue */
vm_object_offset_t last_alloc; /* last allocation offset */
+ vm_object_offset_t sequential; /* sequential access size */
vm_size_t cluster_size; /* size of paging cluster */
#if MACH_PAGEMAP
vm_external_map_t existence_map; /* bitmap of pages written to
* backing storage */
#endif /* MACH_PAGEMAP */
- int cow_hint; /* last page present in */
+ vm_offset_t cow_hint; /* last page present in */
/* shadow but not in object */
#if MACH_ASSERT
struct vm_object *paging_object; /* object which pages to be
* put in current object
*/
#endif
+ /* hold object lock when altering */
+ unsigned int /* cache WIMG bits */
+ wimg_bits:8, /* wimg plus some expansion*/
+ not_in_use:24;
#ifdef UBC_DEBUG
queue_head_t uplq; /* List of outstanding upls */
#endif /* UBC_DEBUG */
vm_object_size_t length);
__private_extern__ void vm_object_collapse(
- vm_object_t object);
+ vm_object_t object,
+ vm_object_offset_t offset);
__private_extern__ boolean_t vm_object_copy_quickly(
vm_object_t *_object,
#define VM_OBJECT_EVENT_CACHING 7
#define vm_object_assert_wait(object, event, interruptible) \
- MACRO_BEGIN \
- (object)->all_wanted |= 1 << (event); \
- assert_wait((event_t)((vm_offset_t)(object)+(event)),(interruptible)); \
- MACRO_END
+ (((object)->all_wanted |= 1 << (event)), \
+ assert_wait((event_t)((vm_offset_t)(object)+(event)),(interruptible)))
#define vm_object_wait(object, event, interruptible) \
- MACRO_BEGIN \
- vm_object_assert_wait((object),(event),(interruptible)); \
- vm_object_unlock(object); \
- thread_block((void (*)(void)) 0); \
- MACRO_END
+ (vm_object_assert_wait((object),(event),(interruptible)), \
+ vm_object_unlock(object), \
+ thread_block(THREAD_CONTINUE_NULL)) \
+
+#define thread_sleep_vm_object(object, event, interruptible) \
+ thread_sleep_mutex((event_t)(event), &(object)->Lock, (interruptible))
+
+#define vm_object_sleep(object, event, interruptible) \
+ (((object)->all_wanted |= 1 << (event)), \
+ thread_sleep_vm_object((object), \
+ ((vm_offset_t)(object)+(event)), (interruptible)))
#define vm_object_wakeup(object, event) \
MACRO_BEGIN \
#define vm_object_paging_wait(object, interruptible) \
MACRO_BEGIN \
while ((object)->paging_in_progress != 0) { \
- vm_object_wait( (object), \
+ wait_result_t _wr; \
+ \
+ _wr = vm_object_sleep((object), \
VM_OBJECT_EVENT_PAGING_IN_PROGRESS, \
(interruptible)); \
- vm_object_lock(object); \
\
- /*XXX if ((interruptible) && */ \
- /*XXX (current_thread()->wait_result != THREAD_AWAKENED))*/ \
+ /*XXX if ((interruptible) && (_wr != THREAD_AWAKENED))*/\
/*XXX break; */ \
} \
MACRO_END