2 * Copyright (c) 2016 Apple Inc. All rights reserved.
17 STAILQ_ENTRY(region
) r_linkage
;
19 mach_vm_offset_t r_address
;
20 mach_vm_offset_t r_size
;
22 #define _R_ADDR(r) ((r)->r_address)
23 #define _R_SIZE(r) ((r)->r_size)
24 #define R_SETADDR(r, a) ((r)->r_address = (a))
25 #define R_SETSIZE(r, z) ((r)->r_size = (z))
26 #define R_ENDADDR(r) (_R_ADDR(r) + _R_SIZE(r))
28 vm_region_submap_info_data_64_t r_info
;
29 vm_page_info_basic_data_t r_pageinfo
;
31 #ifdef CONFIG_PURGABLE
44 * This field may be non-NULL if the region is a read-only part
45 * of a mapped file (i.e. the shared cache) and thus
46 * doesn't need to be copied.
49 const struct libent
*fr_libent
;
55 * These (optional) fields are filled in after we parse the information
56 * about the dylibs we've mapped, as provided by dyld.
58 struct subregion
**r_subregions
;
59 unsigned r_nsubregions
;
61 const struct regionop
*r_op
;
64 static __inline
const mach_vm_offset_t
R_ADDR(const struct region
*r
) {
68 static __inline
const mach_vm_offset_t
R_SIZE(const struct region
*r
) {
73 * Describes the disposition of the region after a walker returns
76 WALK_CONTINUE
, // press on ..
77 WALK_DELETE_REGION
, // discard this region, then continue
78 WALK_TERMINATE
, // early termination, no error
79 WALK_ERROR
, // early termination, error
83 struct write_segment_data
;
85 typedef walk_return_t
walk_region_cbfn_t(struct region
*, void *);
88 void (*rop_print
)(const struct region
*);
89 walk_return_t (*rop_write
)(const struct region
*, struct write_segment_data
*);
90 void (*rop_delete
)(struct region
*);
93 #define ROP_PRINT(r) (((r)->r_op->rop_print)(r))
94 #define ROP_WRITE(r, w) (((r)->r_op->rop_write)(r, w))
95 #define ROP_DELETE(r) (((r)->r_op->rop_delete)(r))
97 extern const struct regionop vanilla_ops
, sparse_ops
, zfod_ops
;
99 extern const struct regionop fileref_ops
;
104 #endif /* _REGION_H */