X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/55e303ae13a4cf49d70f2294092726f2fffb9ef2..6601e61aa18bf4f09af135ff61fc7f4771d23b06:/osfmk/vm/task_working_set.h diff --git a/osfmk/vm/task_working_set.h b/osfmk/vm/task_working_set.h index 90af7ef03..366c5ffce 100644 --- a/osfmk/vm/task_working_set.h +++ b/osfmk/vm/task_working_set.h @@ -1,24 +1,21 @@ /* - * Copyright (c) 2000 Apple Computer, Inc. All rights reserved. + * Copyright (c) 2000-2004 Apple Computer, Inc. All rights reserved. * * @APPLE_LICENSE_HEADER_START@ * - * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. + * The contents of this file constitute Original Code as defined in and + * are subject to the Apple Public Source License Version 1.1 (the + * "License"). You may not use this file except in compliance with the + * License. Please obtain a copy of the License at + * http://www.apple.com/publicsource and read it before using this file. * - * This file contains Original Code and/or Modifications of Original Code - * as defined in and that are subject to the Apple Public Source License - * Version 2.0 (the 'License'). You may not use this file except in - * compliance with the License. Please obtain a copy of the License at - * http://www.opensource.apple.com/apsl/ and read it before using this - * file. - * - * The Original Code and all software distributed under the License are - * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER + * This Original Code and all software distributed under the License are + * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. - * Please see the License for the specific language governing rights and - * limitations under the License. + * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the + * License for the specific language governing rights and limitations + * under the License. * * @APPLE_LICENSE_HEADER_END@ */ @@ -37,6 +34,12 @@ #ifndef _VM_TASK_WORKING_SET_H_ #define _VM_TASK_WORKING_SET_H_ +#include + +#ifdef KERNEL_PRIVATE + +#ifdef MACH_KERNEL_PRIVATE + #include #include @@ -131,9 +134,9 @@ struct tws_hash_ele { }; typedef struct tws_hash_ele *tws_hash_ele_t; -#define TWS_HASH_OFF_MASK ((vm_object_offset_t)0xFFFFFFFFFFFE0000) +#define TWS_HASH_OFF_MASK ((vm_object_offset_t)0xFFFFFFFFFFFE0000ULL) #define TWS_ADDR_OFF_MASK ((vm_offset_t)0xFFFE0000) -#define TWS_INDEX_MASK ((vm_object_offset_t)0x000000000001F000) +#define TWS_INDEX_MASK ((vm_object_offset_t)0x000000000001F000ULL) struct tws_hash_ptr { tws_hash_ele_t element; @@ -142,7 +145,7 @@ struct tws_hash_ptr { typedef struct tws_hash_ptr *tws_hash_ptr_t; struct tws_hash_line { - int ele_count; + unsigned int ele_count; struct tws_hash_ele list[TWS_ARRAY_SIZE]; }; typedef struct tws_hash_line *tws_hash_line_t; @@ -153,7 +156,7 @@ typedef struct tws_hash_line *tws_hash_line_t; #define TWS_ADDR_HASH 1 -#define TWS_HASH_EXPANSION_MAX 5 +#define TWS_HASH_EXPANSION_MAX 10 #define TWS_MAX_REHASH 3 @@ -161,17 +164,17 @@ struct tws_hash { decl_mutex_data(,lock) /* tws_hash's lock */ int style; - int current_line; + unsigned int current_line; unsigned int pageout_count; - int line_count; + unsigned int line_count; - int number_of_lines; - int number_of_elements; - int expansion_count; + unsigned int number_of_lines; + unsigned int number_of_elements; + unsigned int expansion_count; unsigned int time_of_creation; - int lookup_count; - int insert_count; + unsigned int lookup_count; + unsigned int insert_count; tws_startup_t startup_cache; char *startup_name; @@ -192,13 +195,6 @@ struct tws_hash { typedef struct tws_hash *tws_hash_t; -extern tws_hash_t tws_hash_create(); - -extern void tws_hash_line_clear( - tws_hash_t tws, - tws_hash_line_t hash_line, - boolean_t live); - extern kern_return_t tws_lookup( tws_hash_t tws, vm_object_offset_t offset, @@ -219,52 +215,41 @@ extern void tws_build_cluster( vm_object_offset_t *end, vm_size_t max_length); -extern tws_line_signal( - tws_hash_t tws, - vm_map_t map, - tws_hash_line_t hash_line, - vm_offset_t target_page); +extern void tws_line_signal( + tws_hash_t tws, + vm_map_t map, + tws_hash_line_t hash_line, + vm_offset_t target_page); extern void tws_hash_destroy( - tws_hash_t tws); - -extern void tws_hash_clear( - tws_hash_t tws); - -kern_return_t task_working_set_create( - task_t task, - unsigned int lines, - unsigned int rows, - unsigned int style); - -kern_return_t tws_expand_working_set( - vm_offset_t old_tws, - int line_count, - boolean_t dump_data); - -kern_return_t tws_handle_startup_file( - task_t task, - unsigned int uid, - char *app_name, - vm_offset_t app_vp, - boolean_t *new_info); - -kern_return_t tws_write_startup_file( - task_t task, - int fid, - int mod, - char *name, - unsigned int string_length); - -kern_return_t tws_read_startup_file( - task_t task, - tws_startup_t startup, - vm_offset_t cache_size); - -void -tws_hash_ws_flush( - tws_hash_t tws); + tws_hash_t tws); + +extern void tws_hash_ws_flush( + tws_hash_t tws); + +extern kern_return_t tws_expand_working_set( + tws_hash_t old_tws, + unsigned int line_count, + boolean_t dump_data); + +extern kern_return_t task_working_set_create( + task_t task, + unsigned int lines, + unsigned int rows, + unsigned int style); + +#endif /* MACH_KERNEL_PRIVATE */ + +extern kern_return_t tws_handle_startup_file( + task_t task, + unsigned int uid, + char *app_name, + void *app_vp, + boolean_t *new_info); +extern kern_return_t tws_send_startup_info( + task_t task); +#endif /* KERNEL_PRIVATE */ #endif /* _VM_TASK_WORKING_SET_H_ */