2 * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
26 * Mach Operating System
27 * Copyright (c) 1991,1990,1989,1988,1987 Carnegie Mellon University
28 * All Rights Reserved.
30 * Permission to use, copy, modify and distribute this software and its
31 * documentation is hereby granted, provided that both the copyright
32 * notice and this permission notice appear in all copies of the
33 * software, derivative works or modified versions, and any portions
34 * thereof, and that both notices appear in supporting documentation.
36 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
37 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
38 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
40 * Carnegie Mellon requests users of this software to return to
42 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
43 * School of Computer Science
44 * Carnegie Mellon University
45 * Pittsburgh PA 15213-3890
47 * any improvements or extensions that they make and grant Carnegie Mellon
48 * the rights to redistribute these changes.
53 * File: vm/vm_pageout.h
54 * Author: Avadis Tevanian, Jr.
57 * Declarations for the pageout daemon interface.
60 #ifndef _VM_VM_PAGEOUT_H_
61 #define _VM_VM_PAGEOUT_H_
63 #include <mach/boolean.h>
64 #include <mach/machine/vm_types.h>
65 #include <vm/vm_object.h>
66 #include <vm/vm_page.h>
69 * The following ifdef only exists because XMM must (currently)
70 * be given a page at a time. This should be removed
73 #define DATA_WRITE_MAX 16
74 #define POINTER_T(copy) (pointer_t)(copy)
79 extern void vm_pageout(void);
81 extern vm_object_t
vm_pageout_object_allocate(
84 vm_object_offset_t offset
);
86 extern void vm_pageout_object_terminate(
89 extern vm_page_t
vm_pageout_setup(
91 vm_object_t new_object
,
92 vm_object_offset_t new_offset
);
94 extern void vm_pageout_cluster(
97 extern void vm_pageout_initialize_page(
100 extern void vm_pageclean_setup(
103 vm_object_t new_object
,
104 vm_object_offset_t new_offset
);
106 extern void vm_pageclean_copy(
109 vm_object_t new_object
,
110 vm_object_offset_t new_offset
);
112 /* UPL exported routines and structures */
114 #define UPL_COMPOSITE_PAGE_LIST_MAX 16
117 #define upl_lock_init(object) mutex_init(&(object)->Lock, ETAP_VM_OBJ)
118 #define upl_lock(object) mutex_lock(&(object)->Lock)
119 #define upl_unlock(object) mutex_unlock(&(object)->Lock)
122 /* universal page list structure */
125 decl_mutex_data(, Lock
) /* Synchronization */
128 vm_object_t src_object
; /* object derived from */
129 vm_object_offset_t offset
;
130 vm_size_t size
; /* size in bytes of the address space */
131 vm_offset_t kaddr
; /* secondary mapping in kernel */
132 vm_object_t map_object
;
134 unsigned int ubc_alias1
;
135 unsigned int ubc_alias2
;
136 queue_chain_t uplq
; /* List of outstanding upls on an obj */
137 #endif /* UBC_DEBUG */
143 /* upl struct flags */
144 #define UPL_PAGE_LIST_MAPPED 0x1
145 #define UPL_KERNEL_MAPPED 0x2
146 #define UPL_CLEAR_DIRTY 0x4
147 #define UPL_COMPOSITE_LIST 0x8
148 #define UPL_INTERNAL 0x10
149 #define UPL_PAGE_SYNC_DONE 0x20
150 #define UPL_DEVICE_MEMORY 0x40
158 #endif /* _VM_VM_PAGEOUT_H_ */