vm_object.h (5e38e3f5eb2664cf1cc1fc8b272c66b344b1059f) | vm_object.h (10d9120c44480b6ce02f9b37ee8c0724c358ee65) |
---|---|
1/*- 2 * SPDX-License-Identifier: (BSD-3-Clause AND MIT-CMU) 3 * 4 * Copyright (c) 1991, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * The Mach Operating System project at Carnegie-Mellon University. --- 182 unchanged lines hidden (view full) --- 191#define OBJ_COLORED 0x1000 /* pg_color is defined */ 192#define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ 193#define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ 194#define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ 195 196/* 197 * Helpers to perform conversion between vm_object page indexes and offsets. 198 * IDX_TO_OFF() converts an index into an offset. | 1/*- 2 * SPDX-License-Identifier: (BSD-3-Clause AND MIT-CMU) 3 * 4 * Copyright (c) 1991, 1993 5 * The Regents of the University of California. All rights reserved. 6 * 7 * This code is derived from software contributed to Berkeley by 8 * The Mach Operating System project at Carnegie-Mellon University. --- 182 unchanged lines hidden (view full) --- 191#define OBJ_COLORED 0x1000 /* pg_color is defined */ 192#define OBJ_ONEMAPPING 0x2000 /* One USE (a single, non-forked) mapping flag */ 193#define OBJ_DISCONNECTWNT 0x4000 /* disconnect from vnode wanted */ 194#define OBJ_TMPFS 0x8000 /* has tmpfs vnode allocated */ 195 196/* 197 * Helpers to perform conversion between vm_object page indexes and offsets. 198 * IDX_TO_OFF() converts an index into an offset. |
199 * OFF_TO_IDX() converts an offset into an index. Since offsets are signed 200 * by default, the sign propagation in OFF_TO_IDX(), when applied to 201 * negative offsets, is intentional and returns a vm_object page index 202 * that cannot be created by a userspace mapping. 203 * UOFF_TO_IDX() treats the offset as an unsigned value and converts it 204 * into an index accordingly. Use it only when the full range of offset 205 * values are allowed. Currently, this only applies to device mappings. | 199 * OFF_TO_IDX() converts an offset into an index. |
206 * OBJ_MAX_SIZE specifies the maximum page index corresponding to the 207 * maximum unsigned offset. 208 */ 209#define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) 210#define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) | 200 * OBJ_MAX_SIZE specifies the maximum page index corresponding to the 201 * maximum unsigned offset. 202 */ 203#define IDX_TO_OFF(idx) (((vm_ooffset_t)(idx)) << PAGE_SHIFT) 204#define OFF_TO_IDX(off) ((vm_pindex_t)(((vm_ooffset_t)(off)) >> PAGE_SHIFT)) |
211#define UOFF_TO_IDX(off) (((vm_pindex_t)(off)) >> PAGE_SHIFT) 212#define OBJ_MAX_SIZE (UOFF_TO_IDX(UINT64_MAX) + 1) | 205#define OBJ_MAX_SIZE (OFF_TO_IDX(UINT64_MAX) + 1) |
213 214#ifdef _KERNEL 215 216#define OBJPC_SYNC 0x1 /* sync I/O */ 217#define OBJPC_INVAL 0x2 /* invalidate */ 218#define OBJPC_NOSYNC 0x4 /* skip if VPO_NOSYNC */ 219 220/* --- 135 unchanged lines hidden --- | 206 207#ifdef _KERNEL 208 209#define OBJPC_SYNC 0x1 /* sync I/O */ 210#define OBJPC_INVAL 0x2 /* invalidate */ 211#define OBJPC_NOSYNC 0x4 /* skip if VPO_NOSYNC */ 212 213/* --- 135 unchanged lines hidden --- |