📄 vm_param.h
字号:
/* * Mach Operating System * Copyright (c) 1991,1990,1989,1988 Carnegie Mellon University * All Rights Reserved. * * Permission to use, copy, modify and distribute this software and its * documentation is hereby granted, provided that both the copyright * notice and this permission notice appear in all copies of the * software, derivative works or modified versions, and any portions * thereof, and that both notices appear in supporting documentation. * * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE. * * Carnegie Mellon requests users of this software to return to * * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU * School of Computer Science * Carnegie Mellon University * Pittsburgh PA 15213-3890 * * any improvements or extensions that they make and grant Carnegie Mellon * the rights to redistribute these changes. *//* * File: vm_param.h * Author: Avadis Tevanian, Jr. * Date: 1985 * * I386 machine dependent virtual memory parameters. * Most of the declarations are preceeded by I386_ (or i386_) * which is OK because only I386 specific code will be using * them. */#ifndef _MACH_I386_VM_PARAM_H_#define _MACH_I386_VM_PARAM_H_#include <mach/machine/vm_types.h>#define BYTE_SIZE 8 /* byte size in bits */#define I386_PGBYTES 4096 /* bytes per 80386 page */#define I386_PGSHIFT 12 /* number of bits to shift for pages *//* Virtual page size is the same as real page size - 4K is big enough. */#define PAGE_SHIFT I386_PGSHIFT/* * Convert bytes to pages and convert pages to bytes. * No rounding is used. */#define i386_btop(x) (((unsigned)(x)) >> I386_PGSHIFT)#define i386_ptob(x) (((unsigned)(x)) << I386_PGSHIFT)/* * Round off or truncate to the nearest page. These will work * for either addresses or counts. (i.e. 1 byte rounds to 1 page * bytes.) */#define i386_round_page(x) ((((unsigned)(x)) + I386_PGBYTES - 1) & \ ~(I386_PGBYTES-1))#define i386_trunc_page(x) (((unsigned)(x)) & ~(I386_PGBYTES-1))/* User address spaces are 3GB each, starting at virtual and linear address 0. */#define VM_MIN_ADDRESS ((vm_offset_t) 0)#define VM_MAX_ADDRESS ((vm_offset_t) 0xc0000000)#endif /* _MACH_I386_VM_PARAM_H_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -