]> git.saurik.com Git - apple/xnu.git/blame - osfmk/mach/resource_monitors.h
xnu-6153.121.1.tar.gz
[apple/xnu.git] / osfmk / mach / resource_monitors.h
CommitLineData
1c79356b 1/*
39037602 2 * Copyright (c) 2016 Apple Inc. All rights reserved.
5d5c5d0d 3 *
2d21ac55 4 * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
39037602 5 *
2d21ac55
A
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. The rights granted to you under the License
10 * may not be used to create, or enable the creation or redistribution of,
11 * unlawful or unlicensed copies of an Apple operating system, or to
12 * circumvent, violate, or enable the circumvention or violation of, any
13 * terms of an Apple operating system software license agreement.
39037602 14 *
2d21ac55
A
15 * Please obtain a copy of the License at
16 * http://www.opensource.apple.com/apsl/ and read it before using this file.
39037602 17 *
2d21ac55
A
18 * The Original Code and all software distributed under the License are
19 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
8f6c56a5
A
20 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
2d21ac55
A
22 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
23 * Please see the License for the specific language governing rights and
24 * limitations under the License.
39037602 25 *
2d21ac55 26 * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
1c79356b 27 */
39037602
A
28
29#ifndef _MACH_RESOURCE_MONITORS_H_
30#define _MACH_RESOURCE_MONITORS_H_
31
32#include <sys/syslimits.h> /* PATH_MAX */
33#ifndef XNU_KERNEL_PRIVATE
34#include <TargetConditionals.h>
35#endif
36
37__BEGIN_DECLS
38
1c79356b 39/*
39037602
A
40 * resource_notify_flags_t
41 * The top 32 bits are common flags, the bottom for per-call flags.
1c79356b 42 */
39037602
A
43typedef uint64_t resource_notify_flags_t;
44#define kRNFlagsNone 0
45
46/* Flags applicable to any monitors. */
47#define kRNFatalLimitFlag (1ULL << 32)
1c79356b 48
39037602 49/* For the disk writes I/O monitor.
0a7de745 50 * The default is logical writes. */
39037602
A
51#define kRNPhysicalWritesFlag (1ULL < 1)
52
53/* TEMPORARY compatibility, to be removed */
54#define kCPUTriggerFatalFlag kRNFatalLimitFlag
1c79356b 55
9bccf70c 56
9bccf70c 57
9bccf70c 58
1c79356b 59/*
39037602
A
60 * Process name types for proc_internal.h.
61 * proc_name_t is used by resource_notify.defs clients in user space.
1c79356b 62 *
39037602
A
63 * MAXCOMLEN is defined in bsd/sys/param.h which we can neither include
64 * (type conflicts) nor modify (POSIX).
1c79356b 65 */
39037602 66#define MAXCOMLEN 16
1c79356b 67
0a7de745
A
68typedef char command_t[MAXCOMLEN + 1];
69typedef char proc_name_t[2*MAXCOMLEN + 1];
39037602 70typedef char posix_path_t[PATH_MAX];
1c79356b 71
39037602 72__END_DECLS
1c79356b 73
39037602 74#endif /* _MACH_RESOURCE_MONITORS_H_ */