peachsim 0.1.1673 → 0.1.1684

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (213) hide show
  1. package/cli/commands/control.ts +13 -1
  2. package/cli/commands/coverage-swift.ts +83 -27
  3. package/cli/commands/coverage.ts +219 -20
  4. package/cli/commands/detect.ts +10 -6
  5. package/cli/commands/inspect/core.ts +2 -0
  6. package/cli/commands/inspect/settling.ts +37 -4
  7. package/cli/commands/inspect/wait-ready.ts +7 -0
  8. package/cli/outbound-endpoints.ts +12 -0
  9. package/detox/index.ts +11 -1
  10. package/detox/jest-environment.cjs +14 -0
  11. package/dist-lib/agent-daemon-client.cjs +1 -1
  12. package/dist-lib/agent-events.cjs +1 -1
  13. package/dist-lib/attached-projects.cjs +1 -1
  14. package/dist-lib/auth/shared-session.cjs +1 -1
  15. package/dist-lib/backend-origin.cjs +1 -1
  16. package/dist-lib/beta.cjs +1 -1
  17. package/dist-lib/beta.mjs +1 -1
  18. package/dist-lib/bridge-constants.cjs +1 -1
  19. package/dist-lib/bridge-contract-input.cjs +1 -1
  20. package/dist-lib/bridge-contract-input.mjs +1 -1
  21. package/dist-lib/bridge-contract.cjs +1 -1
  22. package/dist-lib/bridge-contract.mjs +1 -1
  23. package/dist-lib/bundle-channel.cjs +3299 -1665
  24. package/dist-lib/capture-contract.cjs +1 -1
  25. package/dist-lib/capture-contract.mjs +1 -1
  26. package/dist-lib/cloud-contract.cjs +1 -1
  27. package/dist-lib/cloud-contract.mjs +1 -1
  28. package/dist-lib/cloud-test-args.cjs +1 -1
  29. package/dist-lib/cloud-test-args.mjs +1 -1
  30. package/dist-lib/cloud.cjs +1 -1
  31. package/dist-lib/cloud.mjs +1 -1
  32. package/dist-lib/config.cjs +1 -1
  33. package/dist-lib/config.mjs +1 -1
  34. package/dist-lib/detox/index.cjs +43 -8
  35. package/dist-lib/detox/jest-environment.cjs +14 -0
  36. package/dist-lib/dev-bundle-resolution.cjs +1 -1
  37. package/dist-lib/expo-swift-bundle.cjs +2432 -1128
  38. package/dist-lib/expo-swift-metadata.cjs +1 -1
  39. package/dist-lib/expo-swift-metadata.mjs +1 -1
  40. package/dist-lib/home-paths.cjs +1 -1
  41. package/dist-lib/host/bridge-host.cjs +2908 -1601
  42. package/dist-lib/host/fetch-proxy-handler.cjs +22 -6
  43. package/dist-lib/host/fetch-proxy-overrides.cjs +1 -1
  44. package/dist-lib/host/fetch-proxy-overrides.mjs +1 -1
  45. package/dist-lib/host/replacement-module-handler.cjs +1 -1
  46. package/dist-lib/host/websocket-proxy.cjs +1 -1
  47. package/dist-lib/index.cjs +1941 -742
  48. package/dist-lib/jump-to-source-babel.cjs +1 -1
  49. package/dist-lib/jump-to-source-native.cjs +1 -1
  50. package/dist-lib/kotlin-host.cjs +1 -1
  51. package/dist-lib/menu.cjs +1 -1
  52. package/dist-lib/menu.mjs +1 -1
  53. package/dist-lib/metro-fingerprint-registry.cjs +1 -1
  54. package/dist-lib/metro-fingerprint-registry.mjs +1 -1
  55. package/dist-lib/metro-production-bundle.cjs +1 -1
  56. package/dist-lib/metro-production-bundle.mjs +1 -1
  57. package/dist-lib/metro.cjs +6215 -4283
  58. package/dist-lib/native-app-identity-project.cjs +31 -6
  59. package/dist-lib/native-app-identity-project.mjs +31 -6
  60. package/dist-lib/native-app-identity.cjs +1 -1
  61. package/dist-lib/native-app-identity.mjs +1 -1
  62. package/dist-lib/native-firebase-metadata.cjs +1 -1
  63. package/dist-lib/native-firebase-metadata.mjs +1 -1
  64. package/dist-lib/plist.cjs +1 -1
  65. package/dist-lib/plist.mjs +1 -1
  66. package/dist-lib/profiles.cjs +1 -1
  67. package/dist-lib/public-brand.cjs +1 -1
  68. package/dist-lib/public-origins-lib-esm.json +24 -23
  69. package/dist-lib/public-origins-lib-static.json +1 -1
  70. package/dist-lib/public-origins-lib.json +134 -78
  71. package/dist-lib/react-native-host-modules.cjs +1 -1
  72. package/dist-lib/react-native-host-modules.mjs +1 -1
  73. package/dist-lib/reap-browser.cjs +2 -2
  74. package/dist-lib/scripts/dev-server-scanner.cjs +1 -1
  75. package/dist-lib/sdk.cjs +39 -5
  76. package/dist-lib/sdk.mjs +39 -5
  77. package/dist-lib/skills.cjs +3637 -2168
  78. package/dist-lib/swift-compile.cjs +496 -352
  79. package/dist-lib/swift-compile.mjs +494 -350
  80. package/dist-lib/swift-package.cjs +58 -9
  81. package/dist-lib/swift-package.mjs +57 -9
  82. package/dist-lib/swift-submit.cjs +1 -1
  83. package/dist-lib/swift-submit.mjs +1 -1
  84. package/dist-lib/swift-toolchain.cjs +26 -11
  85. package/dist-lib/swift.cjs +1 -1
  86. package/dist-lib/vite-swift.cjs +2443 -1134
  87. package/dist-lib/vite.cjs +1907 -763
  88. package/dist-lib/worklet-executable.cjs +1 -1
  89. package/dist-lib/worklet-executable.mjs +1 -1
  90. package/dist-types/packages/peach-engine/src/engine/canvaskit-api.d.ts +1 -1
  91. package/dist-types/packages/peach-engine/src/engine/clipboardContract.d.ts +9 -1
  92. package/dist-types/packages/peach-engine/src/engine/paint-boundary.d.ts +1 -0
  93. package/dist-types/packages/peach-engine/src/preview/upload-protocol.d.ts +11 -3
  94. package/dist-types/packages/peach-engine/src/rolldown-bundle-inventory.d.ts +1 -1
  95. package/dist-types/packages/peach-engine/src/webview-automation-host.d.ts +6 -0
  96. package/dist-types/packages/peach-globals/src/clipboardBridgeContract.d.ts +2 -0
  97. package/dist-types/packages/peach-globals/src/compositorBridgeContract.d.ts +10 -1
  98. package/dist-types/packages/peach-globals/src/index.d.ts +1 -1
  99. package/package.json +1 -1
  100. package/runtime-companion.json +1 -1
  101. package/sdk/ios/System/Library/Frameworks/CoreFoundation.framework/Headers/CoreFoundation.h +69 -2
  102. package/sdk/ios/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h +44 -4
  103. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFComposeAssistantViewController.h +29 -0
  104. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeControllerDeferredAction.h +14 -0
  105. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailComposeViewController.h +162 -0
  106. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMailDraft.h +24 -0
  107. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController+UPI.h +31 -0
  108. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MFMessageComposeViewController.h +169 -0
  109. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Headers/MessageUI.h +13 -0
  110. package/sdk/ios/System/Library/Frameworks/MessageUI.framework/Modules/module.modulemap +11 -0
  111. package/sdk/ios/System/Library/Frameworks/UIKit.framework/Headers/UIKit.h +10 -0
  112. package/sdk/ios/usr/include/_ctype.h +388 -0
  113. package/sdk/ios/usr/include/_inttypes.h +296 -0
  114. package/sdk/ios/usr/include/_locale.h +83 -0
  115. package/sdk/ios/usr/include/_locale_posix2008.h +65 -0
  116. package/sdk/ios/usr/include/_time.h +207 -0
  117. package/sdk/ios/usr/include/arm/param.h +151 -0
  118. package/sdk/ios/usr/include/ctype.h +70 -0
  119. package/sdk/ios/usr/include/dispatch/dispatch.h +72 -6
  120. package/sdk/ios/usr/include/dlfcn.h +1 -2
  121. package/sdk/ios/usr/include/inttypes.h +35 -0
  122. package/sdk/ios/usr/include/locale.h +59 -0
  123. package/sdk/ios/usr/include/machine/param.h +42 -0
  124. package/sdk/ios/usr/include/net/if.h +1 -2
  125. package/sdk/ios/usr/include/peach/pthread.h +4 -4
  126. package/sdk/ios/usr/include/pthread/qos.h +304 -0
  127. package/sdk/ios/usr/include/runetype.h +118 -0
  128. package/sdk/ios/usr/include/setjmp.h +99 -0
  129. package/sdk/ios/usr/include/sys/_types/_clock_t.h +32 -0
  130. package/sdk/ios/usr/include/sys/_types/_ct_rune_t.h +33 -0
  131. package/sdk/ios/usr/include/sys/_types/_fd_clr.h +31 -0
  132. package/sdk/ios/usr/include/sys/_types/_fd_copy.h +31 -0
  133. package/sdk/ios/usr/include/sys/_types/_fd_def.h +121 -0
  134. package/sdk/ios/usr/include/sys/_types/_fd_isset.h +31 -0
  135. package/sdk/ios/usr/include/sys/_types/_fd_set.h +31 -0
  136. package/sdk/ios/usr/include/sys/_types/_fd_setsize.h +31 -0
  137. package/sdk/ios/usr/include/sys/_types/_fd_zero.h +31 -0
  138. package/sdk/ios/usr/include/sys/_types/_rune_t.h +32 -0
  139. package/sdk/ios/usr/include/sys/_types/_time_t.h +32 -0
  140. package/sdk/ios/usr/include/sys/_types/_wint_t.h +33 -0
  141. package/sdk/ios/usr/include/sys/cdefs.h +5 -0
  142. package/sdk/ios/usr/include/sys/param.h +235 -0
  143. package/sdk/ios/usr/include/sys/proc.h +1 -0
  144. package/sdk/ios/usr/include/sys/qos.h +151 -12
  145. package/sdk/ios/usr/include/time.h +67 -2
  146. package/sdk/ios/wasm/include/__typedef_sigset_t.h +7 -0
  147. package/sdk/ios/wasm/include/fcntl.h +11 -0
  148. package/sdk/ios/wasm/include/mach/machine/boolean.h +2 -0
  149. package/sdk/ios/wasm/include/mach/machine/exception.h +5 -0
  150. package/sdk/ios/wasm/include/mach/machine/kern_return.h +2 -0
  151. package/sdk/ios/wasm/include/mach/machine/processor_info.h +2 -0
  152. package/sdk/ios/wasm/include/mach/machine/rpc.h +2 -0
  153. package/sdk/ios/wasm/include/mach/machine/thread_state.h +3 -0
  154. package/sdk/ios/wasm/include/mach/machine/thread_status.h +3 -0
  155. package/sdk/ios/wasm/include/mach/machine/vm_param.h +3 -0
  156. package/sdk/ios/wasm/include/mach/machine/vm_types.h +18 -0
  157. package/sdk/ios/wasm/include/machine/_types.h +153 -0
  158. package/sdk/ios/wasm/include/machine/endian.h +2 -0
  159. package/sdk/ios/wasm/include/machine/limits.h +2 -0
  160. package/sdk/ios/wasm/include/machine/types.h +30 -0
  161. package/sdk/ios/wasm/include/poll.h +8 -0
  162. package/sdk/ios/wasm/include/pthread.h +50 -0
  163. package/sdk/ios/wasm/include/signal.h +72 -0
  164. package/sdk/ios/wasm/include/stdlib.h +3 -0
  165. package/sdk/ios/wasm/include/string.h +10 -0
  166. package/sdk/ios/wasm/include/sys/_pthread/_pthread_attr_t.h +7 -0
  167. package/sdk/ios/wasm/include/sys/_pthread/_pthread_t.h +7 -0
  168. package/sdk/ios/wasm/include/sys/mman.h +122 -0
  169. package/sdk/ios/wasm/include/sys/select.h +37 -0
  170. package/sdk/ios/wasm/include/sys/signal.h +259 -0
  171. package/sdk/ios/wasm/include/sys/socket.h +8 -0
  172. package/sdk/ios/wasm/include/sys/types.h +14 -0
  173. package/sdk/ios/wasm/include/sys/ucontext.h +1 -0
  174. package/sdk/ios/wasm/include/sys/uio.h +11 -0
  175. package/sdk/ios/wasm/include/sys/wait.h +89 -0
  176. package/sdk/ios/wasm/include/time.h +8 -0
  177. package/sdk/ios/wasm/include/unistd.h +17 -0
  178. package/src/bridge-contract.ts +2 -0
  179. package/src/chromium-admission.ts +10 -5
  180. package/src/device-catalog.ts +4 -4
  181. package/src/host/fetch-proxy-handler.ts +20 -0
  182. package/src/host/rolldown-bundle-forward.ts +4 -1
  183. package/src/metro-plugin.ts +5 -2
  184. package/src/nitro-adapter.lock.json +6 -6
  185. package/src/nitro-compile.ts +63 -2
  186. package/src/numbered-lock.ts +72 -0
  187. package/src/react-native-coverage/capability-reference-resolution.ts +62 -5
  188. package/src/react-native-coverage/capability-source-references.ts +50 -13
  189. package/src/react-native-coverage/native-source-credit.ts +126 -0
  190. package/src/react-native-coverage/native-source-ranges-file.ts +38 -0
  191. package/src/react-native-coverage/native-surface.ts +49 -0
  192. package/src/react-native-coverage/verified-reach.ts +22 -2
  193. package/src/runtime-assets.ts +17 -0
  194. package/src/swift-compile.ts +84 -47
  195. package/src/swift-coverage/indexing.ts +17 -1
  196. package/src/swift-coverage/sdk.ts +71 -0
  197. package/src/swift-coverage/source.ts +74 -2
  198. package/src/swift-coverage/types.ts +6 -0
  199. package/src/swift-distribution.lock.json +12 -12
  200. package/src/swift-host.ts +133 -14
  201. package/src/swift-objc-compile.ts +11 -22
  202. package/src/swift-objc-metadata.ts +2 -8
  203. package/src/swift-objc-platform.ts +53 -0
  204. package/src/swift-objc-standin.ts +49 -0
  205. package/src/swift-package-manifest.ts +48 -3
  206. package/src/swift-package.ts +85 -12
  207. package/src/swift-packages.ts +157 -44
  208. package/src/swift-source-pods.ts +288 -0
  209. package/src/swift-standins.ts +4 -1
  210. package/src/swift-toolchain.ts +32 -10
  211. package/src/vite-plugin-one.ts +5 -4
  212. package/src/worker-system-chunks.ts +7 -1
  213. package/src/xcode-project.ts +40 -11
@@ -0,0 +1,33 @@
1
+ /*
2
+ * Copyright (c) 2012 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
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.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
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
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+
29
+ #ifndef _WINT_T
30
+ #define _WINT_T
31
+ #include <machine/_types.h> /* __darwin_wint_t */
32
+ typedef __darwin_wint_t wint_t;
33
+ #endif /* _WINT_T */
@@ -40,12 +40,17 @@
40
40
  #else
41
41
  #define __DARWIN_C_LEVEL __DARWIN_C_FULL
42
42
  #endif
43
+ #define __kernel_ptr_semantics
44
+ #define __kernel_data_semantics
45
+ #define __kernel_dual_semantics
43
46
  #define __unused __attribute__((__unused__))
44
47
  #define __used __attribute__((__used__))
45
48
  #define __deprecated __attribute__((__deprecated__))
46
49
  #define __deprecated_msg(_msg) __attribute__((__deprecated__(_msg)))
47
50
  #define __deprecated_enum_msg(_msg) __deprecated_msg(_msg)
48
51
  #define __unavailable __attribute__((__unavailable__))
52
+ #define __dead2 __attribute__((__noreturn__))
53
+ #define __pure2 __attribute__((__const__))
49
54
  #if __STDC_VERSION__ < 199901
50
55
  #define __restrict
51
56
  #else
@@ -0,0 +1,235 @@
1
+ /*
2
+ * Copyright (c) 2000 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
5
+ *
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.
14
+ *
15
+ * Please obtain a copy of the License at
16
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
17
+ *
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
20
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
21
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
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.
25
+ *
26
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
27
+ */
28
+ /* Copyright (c) 1995, 1997 Apple Computer, Inc. All Rights Reserved */
29
+ /*-
30
+ * Copyright (c) 1982, 1986, 1989, 1993
31
+ * The Regents of the University of California. All rights reserved.
32
+ * (c) UNIX System Laboratories, Inc.
33
+ * All or some portions of this file are derived from material licensed
34
+ * to the University of California by American Telephone and Telegraph
35
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
36
+ * the permission of UNIX System Laboratories, Inc.
37
+ *
38
+ * Redistribution and use in source and binary forms, with or without
39
+ * modification, are permitted provided that the following conditions
40
+ * are met:
41
+ * 1. Redistributions of source code must retain the above copyright
42
+ * notice, this list of conditions and the following disclaimer.
43
+ * 2. Redistributions in binary form must reproduce the above copyright
44
+ * notice, this list of conditions and the following disclaimer in the
45
+ * documentation and/or other materials provided with the distribution.
46
+ * 3. All advertising materials mentioning features or use of this software
47
+ * must display the following acknowledgement:
48
+ * This product includes software developed by the University of
49
+ * California, Berkeley and its contributors.
50
+ * 4. Neither the name of the University nor the names of its contributors
51
+ * may be used to endorse or promote products derived from this software
52
+ * without specific prior written permission.
53
+ *
54
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
55
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
56
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
57
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
58
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
59
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
60
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
61
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
62
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
63
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
64
+ * SUCH DAMAGE.
65
+ *
66
+ * @(#)param.h 8.3 (Berkeley) 4/4/95
67
+ */
68
+
69
+ #ifndef _SYS_PARAM_H_
70
+ #define _SYS_PARAM_H_
71
+
72
+ #define BSD 199506 /* System version (year & month). */
73
+ #define BSD4_3 1
74
+ #define BSD4_4 1
75
+
76
+ #define NeXTBSD 1995064 /* NeXTBSD version (year, month, release) */
77
+ #define NeXTBSD4_0 0 /* NeXTBSD 4.0 */
78
+
79
+ #include <sys/_types.h>
80
+ #include <sys/_types/_null.h>
81
+
82
+ #ifndef LOCORE
83
+ #include <sys/types.h>
84
+ #endif
85
+
86
+ /*
87
+ * Machine-independent constants (some used in following include files).
88
+ * Redefined constants are from POSIX 1003.1 limits file.
89
+ *
90
+ * MAXCOMLEN should be >= sizeof(ac_comm) (see <acct.h>)
91
+ * MAXLOGNAME should be >= UT_NAMESIZE (see <utmp.h>)
92
+ */
93
+ #include <sys/syslimits.h>
94
+
95
+ #define MAXCOMLEN 16 /* max command name remembered */
96
+ #define MAXINTERP 64 /* max interpreter file name length */
97
+ #define MAXLOGNAME 255 /* max login name length */
98
+ #define MAXUPRC CHILD_MAX /* max simultaneous processes */
99
+ #define NCARGS ARG_MAX /* max bytes for an exec function */
100
+ #define NGROUPS NGROUPS_MAX /* max number groups */
101
+ #define NOFILE 256 /* default max open files per process */
102
+ #define NOGROUP 65535 /* marker for empty group set member */
103
+ #define MAXHOSTNAMELEN 256 /* max hostname size */
104
+ #define MAXDOMNAMELEN 256 /* maximum domain name length */
105
+
106
+ /* Machine type dependent parameters. */
107
+ #include <machine/param.h>
108
+
109
+ /* More types and definitions used throughout the kernel. */
110
+ #include <limits.h>
111
+
112
+ /* Signals. */
113
+ #include <sys/signal.h>
114
+
115
+ /*
116
+ * Priorities. Note that with 32 run queues, differences less than 4 are
117
+ * insignificant.
118
+ */
119
+ #define PSWP 0
120
+ #define PVM 4
121
+ #define PINOD 8
122
+ #define PRIBIO 16
123
+ #define PVFS 20
124
+ #define PZERO 22 /* No longer magic, shouldn't be here. XXX */
125
+ #define PSOCK 24
126
+ #define PWAIT 32
127
+ #define PLOCK 36
128
+ #define PPAUSE 40
129
+ #define PUSER 50
130
+ #define MAXPRI 127 /* Priorities range from 0 through MAXPRI. */
131
+
132
+ #define PRIMASK 0x0ff
133
+ #define PCATCH 0x100 /* OR'd with pri for tsleep to check signals */
134
+ #define PTTYBLOCK 0x200 /* for tty SIGTTOU and SIGTTIN blocking */
135
+ #define PDROP 0x400 /* OR'd with pri to stop re-aquistion of mutex upon wakeup */
136
+ #define PSPIN 0x800 /* OR'd with pri to require mutex in spin mode upon wakeup */
137
+
138
+ #define NBPW sizeof(int) /* number of bytes per word (integer) */
139
+
140
+ #define CMASK 022 /* default file mask: S_IWGRP|S_IWOTH */
141
+ #define NODEV (dev_t)(-1) /* non-existent device */
142
+
143
+ /*
144
+ * Clustering of hardware pages on machines with ridiculously small
145
+ * page sizes is done here. The paging subsystem deals with units of
146
+ * CLSIZE pte's describing NBPG (from machine/param.h) pages each.
147
+ */
148
+ #define CLBYTES (CLSIZE*NBPG)
149
+ #define CLOFSET (CLSIZE*NBPG-1) /* for clusters, like PGOFSET */
150
+ #define claligned(x) ((((int)(x))&CLOFSET)==0)
151
+ #define CLOFF CLOFSET
152
+ #define CLSHIFT (PGSHIFT+CLSIZELOG2)
153
+
154
+ #if CLSIZE == 1
155
+ #define clbase(i) (i)
156
+ #define clrnd(i) (i)
157
+ #else
158
+ /* Give the base virtual address (first of CLSIZE). */
159
+ #define clbase(i) ((i) &~ (CLSIZE-1))
160
+ /* Round a number of clicks up to a whole cluster. */
161
+ #define clrnd(i) (((i) + (CLSIZE-1)) &~ (CLSIZE-1))
162
+ #endif
163
+
164
+ #define CBLOCK 64 /* Clist block size, must be a power of 2. */
165
+ #define CBQSIZE (CBLOCK/NBBY) /* Quote bytes/cblock - can do better. */
166
+ /* Data chars/clist. */
167
+ #define CBSIZE (CBLOCK - sizeof(struct cblock *) - CBQSIZE)
168
+ #define CROUND (CBLOCK - 1) /* Clist rounding. */
169
+
170
+ /*
171
+ * File system parameters and macros.
172
+ *
173
+ * The file system is made out of blocks of at most MAXPHYS units, with
174
+ * smaller units (fragments) only in the last direct block. MAXBSIZE
175
+ * primarily determines the size of buffers in the buffer pool. It may be
176
+ * made larger than MAXPHYS without any effect on existing file systems;
177
+ * however making it smaller may make some file systems unmountable.
178
+ * We set this to track the value of MAX_UPL_TRANSFER_BYTES from
179
+ * osfmk/mach/memory_object_types.h to bound it at the maximum UPL size.
180
+ */
181
+ #define MAXBSIZE (256 * 4096)
182
+ #define MAXPHYSIO MAXPHYS
183
+ #define MAXFRAG 8
184
+
185
+ #define MAXPHYSIO_WIRED (16 * 1024 * 1024)
186
+
187
+ /*
188
+ * MAXPATHLEN defines the longest permissable path length after expanding
189
+ * symbolic links. It is used to allocate a temporary buffer from the buffer
190
+ * pool in which to do the name expansion, hence should be a power of two,
191
+ * and must be less than or equal to MAXBSIZE. MAXSYMLINKS defines the
192
+ * maximum number of symbolic links that may be expanded in a path name.
193
+ * It should be set high enough to allow all legitimate uses, but halt
194
+ * infinite loops reasonably quickly.
195
+ */
196
+ #define MAXPATHLEN PATH_MAX
197
+ #define MAXSYMLINKS 32
198
+
199
+ /* Bit map related macros. */
200
+ #define setbit(a, i) (((unsigned char *)(a))[(i)/NBBY] |= 1u<<((i)%NBBY))
201
+ #define clrbit(a, i) (((unsigned char *)(a))[(i)/NBBY] &= ~(1u<<((i)%NBBY)))
202
+ #define isset(a, i) (((unsigned char *)(a))[(i)/NBBY] & (1u<<((i)%NBBY)))
203
+ #define isclr(a, i) ((((unsigned char *)(a))[(i)/NBBY] & (1u<<((i)%NBBY))) == 0)
204
+
205
+ /* Macros for counting, rounding. */
206
+ #ifndef howmany
207
+ #define howmany(x, y) ((((x) % (y)) == 0) ? ((x) / (y)) : (((x) / (y)) + 1))
208
+ #endif
209
+ #define roundup(x, y) ((((x) % (y)) == 0) ? \
210
+ (x) : ((x) + ((y) - ((x) % (y)))))
211
+ #define powerof2(x) ((((x)-1)&(x))==0)
212
+
213
+ /* Macros for min/max. */
214
+ #ifndef MIN
215
+ #define MIN(a, b) (((a)<(b))?(a):(b))
216
+ #endif /* MIN */
217
+ #ifndef MAX
218
+ #define MAX(a, b) (((a)>(b))?(a):(b))
219
+ #endif /* MAX */
220
+
221
+ /*
222
+ * Scale factor for scaled integers used to count %cpu time and load avgs.
223
+ *
224
+ * The number of CPU `tick's that map to a unique `%age' can be expressed
225
+ * by the formula (1 / (2 ^ (FSHIFT - 11))). The maximum load average that
226
+ * can be calculated (assuming 32 bits) can be closely approximated using
227
+ * the formula (2 ^ (2 * (16 - FSHIFT))) for (FSHIFT < 15).
228
+ *
229
+ * For the scheduler to maintain a 1:1 mapping of CPU `tick' to `%age',
230
+ * FSHIFT must be at least 11; this gives us a maximum load avg of ~1024.
231
+ */
232
+ #define FSHIFT 11 /* bits to right of fixed binary point */
233
+ #define FSCALE (1<<FSHIFT)
234
+
235
+ #endif /* _SYS_PARAM_H_ */
@@ -3,6 +3,7 @@
3
3
  #include <stdint.h>
4
4
  #include <sys/types.h>
5
5
  #include <sys/time.h>
6
+ #include <sys/param.h>
6
7
  #if defined(__wasi__)
7
8
  struct itimerval { struct timeval it_interval, it_value; };
8
9
  #endif
@@ -1,7 +1,115 @@
1
+ /*
2
+ * Copyright (c) 2013-2014 Apple Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
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. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+
1
24
  #ifndef _SYS_QOS_H
2
25
  #define _SYS_QOS_H
3
26
 
4
- #include <stdint.h>
27
+ #include <sys/cdefs.h>
28
+ #include <Availability.h>
29
+
30
+ /*!
31
+ * @typedef qos_class_t
32
+ *
33
+ * @abstract
34
+ * An abstract thread quality of service (QOS) classification.
35
+ *
36
+ * @discussion
37
+ * Thread quality of service (QOS) classes are ordered abstract representations
38
+ * of the nature of work that is expected to be performed by a pthread, dispatch
39
+ * queue, or NSOperation. Each class specifies a maximum thread scheduling
40
+ * priority for that band (which may be used in combination with a relative
41
+ * priority offset within the band), as well as quality of service
42
+ * characteristics for timer latency, CPU throughput, I/O throughput, network
43
+ * socket traffic management behavior and more.
44
+ *
45
+ * A best effort is made to allocate available system resources to every QOS
46
+ * class. Quality of service degredation only occurs during system resource
47
+ * contention, proportionally to the QOS class. That said, QOS classes
48
+ * representing user-initiated work attempt to achieve peak throughput while
49
+ * QOS classes for other work attempt to achieve peak energy and thermal
50
+ * efficiency, even in the absence of contention. Finally, the use of QOS
51
+ * classes does not allow threads to supersede any limits that may be applied
52
+ * to the overall process.
53
+ */
54
+
55
+ /*!
56
+ * @constant QOS_CLASS_USER_INTERACTIVE
57
+ * @abstract A QOS class which indicates work performed by this thread
58
+ * is interactive with the user.
59
+ * @discussion Such work is requested to run at high priority relative to other
60
+ * work on the system. Specifying this QOS class is a request to run with
61
+ * nearly all available system CPU and I/O bandwidth even under contention.
62
+ * This is not an energy-efficient QOS class to use for large tasks. The use of
63
+ * this QOS class should be limited to critical interaction with the user such
64
+ * as handling events on the main event loop, view drawing, animation, etc.
65
+ *
66
+ * @constant QOS_CLASS_USER_INITIATED
67
+ * @abstract A QOS class which indicates work performed by this thread
68
+ * was initiated by the user and that the user is likely waiting for the
69
+ * results.
70
+ * @discussion Such work is requested to run at a priority below critical user-
71
+ * interactive work, but relatively higher than other work on the system. This
72
+ * is not an energy-efficient QOS class to use for large tasks. Its use
73
+ * should be limited to operations of short enough duration that the user is
74
+ * unlikely to switch tasks while waiting for the results. Typical
75
+ * user-initiated work will have progress indicated by the display of
76
+ * placeholder content or modal user interface.
77
+ *
78
+ * @constant QOS_CLASS_DEFAULT
79
+ * @abstract A default QOS class used by the system in cases where more specific
80
+ * QOS class information is not available.
81
+ * @discussion Such work is requested to run at a priority below critical user-
82
+ * interactive and user-initiated work, but relatively higher than utility and
83
+ * background tasks. Threads created by pthread_create() without an attribute
84
+ * specifying a QOS class will default to QOS_CLASS_DEFAULT. This QOS class
85
+ * value is not intended to be used as a work classification, it should only be
86
+ * set when propagating or restoring QOS class values provided by the system.
87
+ *
88
+ * @constant QOS_CLASS_UTILITY
89
+ * @abstract A QOS class which indicates work performed by this thread
90
+ * may or may not be initiated by the user and that the user is unlikely to be
91
+ * immediately waiting for the results.
92
+ * @discussion Such work is requested to run at a priority below critical user-
93
+ * interactive and user-initiated work, but relatively higher than low-level
94
+ * system maintenance tasks. The use of this QOS class indicates the work
95
+ * should be run in an energy and thermally-efficient manner. The progress of
96
+ * utility work may or may not be indicated to the user, but the effect of such
97
+ * work is user-visible.
98
+ *
99
+ * @constant QOS_CLASS_BACKGROUND
100
+ * @abstract A QOS class which indicates work performed by this thread was not
101
+ * initiated by the user and that the user may be unaware of the results.
102
+ * @discussion Such work is requested to run at a priority below other work.
103
+ * The use of this QOS class indicates the work should be run in the most energy
104
+ * and thermally-efficient manner.
105
+ *
106
+ * @constant QOS_CLASS_UNSPECIFIED
107
+ * @abstract A QOS class value which indicates the absence or removal of QOS
108
+ * class information.
109
+ * @discussion As an API return value, may indicate that threads or pthread
110
+ * attributes were configured with legacy API incompatible or in conflict with
111
+ * the QOS class system.
112
+ */
5
113
 
6
114
  #define __QOS_ENUM(name, type, ...) enum { __VA_ARGS__ }; typedef type name##_t
7
115
  #define __QOS_CLASS_AVAILABLE(...)
@@ -15,7 +123,7 @@
15
123
  #endif
16
124
  #if __has_feature(enumerator_attributes)
17
125
  #undef __QOS_CLASS_AVAILABLE
18
- #define __QOS_CLASS_AVAILABLE(...) __attribute__((availability(ios, introduced=8.0)))
126
+ #define __QOS_CLASS_AVAILABLE __API_AVAILABLE
19
127
  #endif
20
128
  #endif
21
129
 
@@ -36,26 +144,57 @@ __QOS_ENUM(qos_class, unsigned int,
36
144
 
37
145
  #undef __QOS_ENUM
38
146
 
147
+ /*!
148
+ * @constant QOS_MIN_RELATIVE_PRIORITY
149
+ * @abstract The minimum relative priority that may be specified within a
150
+ * QOS class. These priorities are relative only within a given QOS class
151
+ * and meaningful only for the current process.
152
+ */
39
153
  #define QOS_MIN_RELATIVE_PRIORITY (-15)
40
154
 
155
+ /* Userspace (only) definitions */
156
+
41
157
  #ifndef KERNEL
42
158
 
43
- #ifdef __cplusplus
44
- extern "C" {
45
- #endif
159
+ __BEGIN_DECLS
46
160
 
47
- __attribute__((availability(ios, introduced=8.0)))
161
+ /*!
162
+ * @function qos_class_self
163
+ *
164
+ * @abstract
165
+ * Returns the requested QOS class of the current thread.
166
+ *
167
+ * @return
168
+ * One of the QOS class values in qos_class_t.
169
+ */
170
+ __API_AVAILABLE(macos(10.10), ios(8.0))
48
171
  qos_class_t
49
172
  qos_class_self(void);
50
173
 
51
- __attribute__((availability(ios, introduced=8.0)))
174
+ /*!
175
+ * @function qos_class_main
176
+ *
177
+ * @abstract
178
+ * Returns the initial requested QOS class of the main thread.
179
+ *
180
+ * @discussion
181
+ * The QOS class that the main thread of a process is created with depends on
182
+ * the type of process (e.g. application or daemon) and on how it has been
183
+ * launched.
184
+ *
185
+ * This function returns that initial requested QOS class value chosen by the
186
+ * system to enable propagation of that classification to matching work not
187
+ * executing on the main thread.
188
+ *
189
+ * @return
190
+ * One of the QOS class values in qos_class_t.
191
+ */
192
+ __API_AVAILABLE(macos(10.10), ios(8.0))
52
193
  qos_class_t
53
194
  qos_class_main(void);
54
195
 
55
- #ifdef __cplusplus
56
- }
57
- #endif
196
+ __END_DECLS
58
197
 
59
- #endif
198
+ #endif // KERNEL
60
199
 
61
- #endif
200
+ #endif // _SYS_QOS_H
@@ -1,2 +1,67 @@
1
- #pragma once
2
- typedef long time_t;
1
+ /*
2
+ * Copyright (c) 2000, 2023 Apple Computer, Inc. All rights reserved.
3
+ *
4
+ * @APPLE_LICENSE_HEADER_START@
5
+ *
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. Please obtain a copy of the License at
10
+ * http://www.opensource.apple.com/apsl/ and read it before using this
11
+ * file.
12
+ *
13
+ * The Original Code and all software distributed under the License are
14
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15
+ * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16
+ * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18
+ * Please see the License for the specific language governing rights and
19
+ * limitations under the License.
20
+ *
21
+ * @APPLE_LICENSE_HEADER_END@
22
+ */
23
+ /*
24
+ * Copyright (c) 1989, 1993
25
+ * The Regents of the University of California. All rights reserved.
26
+ * (c) UNIX System Laboratories, Inc.
27
+ * All or some portions of this file are derived from material licensed
28
+ * to the University of California by American Telephone and Telegraph
29
+ * Co. or Unix System Laboratories, Inc. and are reproduced herein with
30
+ * the permission of UNIX System Laboratories, Inc.
31
+ *
32
+ * Redistribution and use in source and binary forms, with or without
33
+ * modification, are permitted provided that the following conditions
34
+ * are met:
35
+ * 1. Redistributions of source code must retain the above copyright
36
+ * notice, this list of conditions and the following disclaimer.
37
+ * 2. Redistributions in binary form must reproduce the above copyright
38
+ * notice, this list of conditions and the following disclaimer in the
39
+ * documentation and/or other materials provided with the distribution.
40
+ * 3. All advertising materials mentioning features or use of this software
41
+ * must display the following acknowledgement:
42
+ * This product includes software developed by the University of
43
+ * California, Berkeley and its contributors.
44
+ * 4. Neither the name of the University nor the names of its contributors
45
+ * may be used to endorse or promote products derived from this software
46
+ * without specific prior written permission.
47
+ *
48
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
49
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
50
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
51
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
52
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
53
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
54
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
55
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
56
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
57
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
58
+ * SUCH DAMAGE.
59
+ *
60
+ * @(#)time.h 8.3 (Berkeley) 1/21/94
61
+ */
62
+
63
+ #include <_time.h>
64
+
65
+ #ifdef _USE_EXTENDED_LOCALES_
66
+ #include <xlocale/_time.h>
67
+ #endif /* _USE_EXTENDED_LOCALES_ */
@@ -0,0 +1,7 @@
1
+ // the installed libc names sigset_t through this header. darwin's sigset_t
2
+ // (sys/_types/_sigset_t.h) is one bit per signal, so libc, sys/signal.h and
3
+ // signal.h all name that type.
4
+ #ifndef __wasilibc___typedef_sigset_t_h
5
+ #define __wasilibc___typedef_sigset_t_h
6
+ typedef unsigned int sigset_t;
7
+ #endif
@@ -0,0 +1,11 @@
1
+ #pragma once
2
+ // darwin's cancellation points bind to the darwin provider, which acts on a
3
+ // pending cancel first.
4
+ #include_next <fcntl.h>
5
+ #include <sys/cdefs.h>
6
+ __BEGIN_DECLS
7
+ int open(const char *, int, ...) __asm__("__peach_darwin_open");
8
+ int openat(int, const char *, int, ...) __asm__("__peach_darwin_openat");
9
+ int creat(const char *, mode_t) __asm__("__peach_darwin_creat");
10
+ int fcntl(int, int, ...) __asm__("__peach_darwin_fcntl");
11
+ __END_DECLS
@@ -0,0 +1,2 @@
1
+ #pragma once
2
+ typedef int boolean_t;
@@ -0,0 +1,5 @@
1
+ #pragma once
2
+ // machine-independent exception declarations use these native arm constants.
3
+ #define EXC_TYPES_COUNT 14
4
+ #define EXC_MASK_MACHINE 0
5
+ #define EXCEPTION_CODE_MAX 2
@@ -0,0 +1,2 @@
1
+ #pragma once
2
+ typedef int kern_return_t;
@@ -0,0 +1,2 @@
1
+ #pragma once
2
+ // wasm has no arm or x86 processor counters.
@@ -0,0 +1,2 @@
1
+ #pragma once
2
+ // the native arm rpc header contains no declarations.
@@ -0,0 +1,3 @@
1
+ #pragma once
2
+ // the sdk defines the generic message capacity independently of cpu architecture.
3
+ #define THREAD_STATE_MAX 1296
@@ -0,0 +1,3 @@
1
+ #pragma once
2
+ // wasm has no arm or x86 register-state flavors; ios's no-state flavor names none.
3
+ #define THREAD_STATE_NONE 5
@@ -0,0 +1,3 @@
1
+ #pragma once
2
+ #include <mach/vm_page_size.h>
3
+ // page query declarations keep their native owner; wasm has no arm address map.
@@ -0,0 +1,18 @@
1
+ #pragma once
2
+ #include <machine/_types.h>
3
+ #include <stdint.h>
4
+ typedef __darwin_natural_t natural_t;
5
+ typedef int integer_t;
6
+ typedef uintptr_t vm_offset_t;
7
+ typedef uintptr_t vm_size_t;
8
+ typedef uint64_t mach_vm_address_t;
9
+ typedef uint64_t mach_vm_offset_t;
10
+ typedef uint64_t mach_vm_size_t;
11
+ typedef uint32_t vm_map_offset_t;
12
+ typedef uint32_t vm_map_address_t;
13
+ typedef uint32_t vm_map_size_t;
14
+ typedef uint32_t vm32_offset_t;
15
+ typedef uint32_t vm32_address_t;
16
+ typedef uint32_t vm32_size_t;
17
+ typedef vm_offset_t mach_port_context_t;
18
+ #define MACH_MSG_TYPE_INTEGER_T MACH_MSG_TYPE_INTEGER_32