1/*
2 * Copyright (c) 2014 Apple Inc. All rights reserved.
3 *
4 * @APPLE_APACHE_LICENSE_HEADER_START@
5 *
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
9 *
10 *     http://www.apache.org/licenses/LICENSE-2.0
11 *
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License.
17 *
18 * @APPLE_APACHE_LICENSE_HEADER_END@
19 */
20
21#ifndef __DISPATCH_LAYOUT_PRIVATE__
22#define __DISPATCH_LAYOUT_PRIVATE__
23
24#ifndef __DISPATCH_INDIRECT__
25#error "Please #include <dispatch/private.h> instead of this file directly."
26#include <dispatch/base.h> // for HeaderDoc
27#endif
28
29__BEGIN_DECLS
30
31#if !TARGET_OS_WIN32
32__OSX_AVAILABLE_STARTING(__MAC_10_6,__IPHONE_4_0)
33DISPATCH_EXPORT const struct dispatch_queue_offsets_s {
34	// always add new fields at the end
35	const uint16_t dqo_version;
36	const uint16_t dqo_label;
37	const uint16_t dqo_label_size;
38	const uint16_t dqo_flags;
39	const uint16_t dqo_flags_size;
40	const uint16_t dqo_serialnum;
41	const uint16_t dqo_serialnum_size;
42	const uint16_t dqo_width;
43	const uint16_t dqo_width_size;
44	const uint16_t dqo_running;
45	const uint16_t dqo_running_size;
46	// fields added in dqo_version 5:
47	const uint16_t dqo_suspend_cnt;
48	const uint16_t dqo_suspend_cnt_size;
49	const uint16_t dqo_target_queue;
50	const uint16_t dqo_target_queue_size;
51	const uint16_t dqo_priority;
52	const uint16_t dqo_priority_size;
53} dispatch_queue_offsets;
54#endif
55
56#if DISPATCH_LAYOUT_SPI
57
58/*!
59 * @group Data Structure Layout SPI
60 * SPI intended for CoreSymbolication only
61 */
62
63__OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0)
64DISPATCH_EXPORT const struct dispatch_tsd_indexes_s {
65	// always add new fields at the end
66	const uint16_t dti_version;
67	const uint16_t dti_queue_index;
68	const uint16_t dti_voucher_index;
69	const uint16_t dti_qos_class_index;
70} dispatch_tsd_indexes;
71
72__OSX_AVAILABLE_STARTING(__MAC_10_10,__IPHONE_8_0)
73DISPATCH_EXPORT const struct voucher_offsets_s {
74	// always add new fields at the end
75	const uint16_t vo_version;
76	const uint16_t vo_activity_ids_count;
77	const uint16_t vo_activity_ids_count_size;
78	const uint16_t vo_activity_ids_array;
79	const uint16_t vo_activity_ids_array_entry_size;
80} voucher_offsets;
81
82#endif // DISPATCH_LAYOUT_SPI
83
84__END_DECLS
85
86#endif // __DISPATCH_LAYOUT_PRIVATE__
87