2 * Copyright (c) 2016 Apple Inc. All rights reserved.
12 mach_vm_offset_t s_address
;
13 mach_vm_offset_t s_size
;
14 native_segment_command_t s_segcmd
;
15 const struct libent
*s_libent
;
19 static __inline
void S_SETADDR(struct subregion
*s
, mach_vm_offset_t a
) {
23 static __inline
void S_SETSIZE(struct subregion
*s
, mach_vm_offset_t sz
) {
27 static __inline
const mach_vm_offset_t
S_ADDR(const struct subregion
*s
) {
31 static __inline
const mach_vm_offset_t
S_SIZE(const struct subregion
*s
) {
35 static __inline
const mach_vm_offset_t
S_ENDADDR(const struct subregion
*s
) {
36 return S_ADDR(s
) + S_SIZE(s
);
39 static __inline
const char *S_MACHO_TYPE(const struct subregion
*s
) {
40 return s
->s_segcmd
.segname
;
43 static __inline off_t
S_MACHO_FILEOFF(const struct subregion
*s
) {
44 return s
->s_segcmd
.fileoff
;
47 static __inline off_t
S_MACHO_FILESIZE(const struct subregion
*s
) {
48 return s
->s_segcmd
.filesize
;
51 static __inline
const struct libent
*S_LIBENT(const struct subregion
*s
) {
55 static __inline
const char *S_PATHNAME(const struct subregion
*s
) {
56 const struct libent
*le
= S_LIBENT(s
);
57 return le
? le
->le_pathname
: "(unknown)";
60 static __inline
const char *S_FILENAME(const struct subregion
*s
) {
61 const struct libent
*le
= S_LIBENT(s
);
62 return le
? le
->le_filename
: S_PATHNAME(s
);
65 extern bool issubregiontype(const struct subregion
*, const char *);
67 extern walk_region_cbfn_t decorate_memory_region
;
68 extern walk_region_cbfn_t undecorate_memory_region
;
69 extern walk_region_cbfn_t sparse_region_optimization
;
71 #endif /* _SPARSE_H */