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>
71 extern unsigned int vm_pageout_scan_event_counter
;
72 extern unsigned int vm_zf_count
;
75 * The following ifdef only exists because XMM must (currently)
76 * be given a page at a time. This should be removed
79 #define DATA_WRITE_MAX 16
80 #define POINTER_T(copy) (pointer_t)(copy)
85 extern void vm_pageout(void);
87 extern vm_object_t
vm_pageout_object_allocate(
90 vm_object_offset_t offset
);
92 extern void vm_pageout_object_terminate(
95 extern vm_page_t
vm_pageout_setup(
97 vm_object_t new_object
,
98 vm_object_offset_t new_offset
);
100 extern void vm_pageout_cluster(
103 extern void vm_pageout_initialize_page(
106 extern void vm_pageclean_setup(
109 vm_object_t new_object
,
110 vm_object_offset_t new_offset
);
112 extern void vm_pageclean_copy(
115 vm_object_t new_object
,
116 vm_object_offset_t new_offset
);
118 /* UPL exported routines and structures */
120 #define UPL_COMPOSITE_PAGE_LIST_MAX 16
123 #define upl_lock_init(object) mutex_init(&(object)->Lock, ETAP_VM_OBJ)
124 #define upl_lock(object) mutex_lock(&(object)->Lock)
125 #define upl_unlock(object) mutex_unlock(&(object)->Lock)
128 /* universal page list structure */
131 decl_mutex_data(, Lock
) /* Synchronization */
134 vm_object_t src_object
; /* object derived from */
135 vm_object_offset_t offset
;
136 vm_size_t size
; /* size in bytes of the address space */
137 vm_offset_t kaddr
; /* secondary mapping in kernel */
138 vm_object_t map_object
;
140 unsigned int ubc_alias1
;
141 unsigned int ubc_alias2
;
142 queue_chain_t uplq
; /* List of outstanding upls on an obj */
143 #endif /* UBC_DEBUG */
149 /* upl struct flags */
150 #define UPL_PAGE_LIST_MAPPED 0x1
151 #define UPL_KERNEL_MAPPED 0x2
152 #define UPL_CLEAR_DIRTY 0x4
153 #define UPL_COMPOSITE_LIST 0x8
154 #define UPL_INTERNAL 0x10
155 #define UPL_PAGE_SYNC_DONE 0x20
156 #define UPL_DEVICE_MEMORY 0x40
157 #define UPL_PAGEOUT 0x80
159 #define UPL_PAGE_TICKET_MASK 0xF00
160 #define UPL_PAGE_TICKET_SHIFT 8
168 #endif /* _VM_VM_PAGEOUT_H_ */