@psnext/slingcli 2.4.20260525-4 → 2.4.20260527-2

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 (243) hide show
  1. package/bin/sling.js +4 -1
  2. package/node_modules/@aws-sdk/core/package.json +2 -2
  3. package/node_modules/@aws-sdk/credential-provider-env/package.json +2 -2
  4. package/node_modules/@aws-sdk/credential-provider-http/dist-cjs/fromHttp/fromHttp.js +12 -6
  5. package/node_modules/@aws-sdk/credential-provider-http/dist-es/fromHttp/fromHttp.js +12 -6
  6. package/node_modules/@aws-sdk/credential-provider-http/package.json +3 -2
  7. package/node_modules/@aws-sdk/credential-provider-ini/package.json +9 -9
  8. package/node_modules/@aws-sdk/credential-provider-login/package.json +3 -3
  9. package/node_modules/@aws-sdk/credential-provider-node/package.json +7 -7
  10. package/node_modules/@aws-sdk/credential-provider-process/package.json +2 -2
  11. package/node_modules/@aws-sdk/credential-provider-sso/node_modules/@aws-sdk/token-providers/package.json +3 -3
  12. package/node_modules/@aws-sdk/credential-provider-sso/package.json +4 -4
  13. package/node_modules/@aws-sdk/credential-provider-web-identity/package.json +3 -3
  14. package/node_modules/@aws-sdk/middleware-websocket/package.json +2 -2
  15. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/cognito-identity/index.js +1 -1
  16. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/signin/index.js +1 -1
  17. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso/index.js +1 -1
  18. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sso-oidc/index.js +1 -1
  19. package/node_modules/@aws-sdk/nested-clients/dist-cjs/submodules/sts/index.js +1 -1
  20. package/node_modules/@aws-sdk/nested-clients/package.json +3 -3
  21. package/node_modules/@aws-sdk/signature-v4-multi-region/package.json +1 -2
  22. package/node_modules/@aws-sdk/xml-builder/package.json +2 -2
  23. package/node_modules/@earendil-works/pi-agent-core/dist/harness/compaction/compaction.js +18 -24
  24. package/node_modules/@earendil-works/pi-agent-core/package.json +2 -2
  25. package/node_modules/@earendil-works/pi-ai/dist/cli.js +14 -0
  26. package/node_modules/@earendil-works/pi-ai/dist/models.generated.js +78 -63
  27. package/node_modules/@earendil-works/pi-ai/dist/providers/amazon-bedrock.js +2 -1
  28. package/node_modules/@earendil-works/pi-ai/dist/providers/anthropic.js +8 -22
  29. package/node_modules/@earendil-works/pi-ai/dist/providers/azure-openai-responses.js +1 -1
  30. package/node_modules/@earendil-works/pi-ai/dist/providers/images/openrouter.js +1 -1
  31. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-codex-responses.js +60 -40
  32. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-completions.js +1 -1
  33. package/node_modules/@earendil-works/pi-ai/dist/providers/openai-responses.js +1 -1
  34. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/device-code.js +55 -0
  35. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/github-copilot.js +45 -69
  36. package/node_modules/@earendil-works/pi-ai/dist/utils/oauth/index.js +1 -0
  37. package/node_modules/@earendil-works/pi-ai/dist/utils/overflow.js +5 -2
  38. package/node_modules/@earendil-works/pi-ai/package.json +4 -3
  39. package/node_modules/@earendil-works/pi-coding-agent/dist/cli/file-processor.js +2 -3
  40. package/node_modules/@earendil-works/pi-coding-agent/dist/config.js +18 -12
  41. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-runtime.js +2 -1
  42. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session-services.js +3 -2
  43. package/node_modules/@earendil-works/pi-coding-agent/dist/core/agent-session.js +8 -2
  44. package/node_modules/@earendil-works/pi-coding-agent/dist/core/auth-storage.js +2 -1
  45. package/node_modules/@earendil-works/pi-coding-agent/dist/core/compaction/compaction.js +18 -24
  46. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/index.js +8 -6
  47. package/node_modules/@earendil-works/pi-coding-agent/dist/core/export-html/template.js +6 -3
  48. package/node_modules/@earendil-works/pi-coding-agent/dist/core/extensions/loader.js +12 -29
  49. package/node_modules/@earendil-works/pi-coding-agent/dist/core/model-registry.js +5 -1
  50. package/node_modules/@earendil-works/pi-coding-agent/dist/core/output-guard.js +52 -22
  51. package/node_modules/@earendil-works/pi-coding-agent/dist/core/package-manager.js +63 -36
  52. package/node_modules/@earendil-works/pi-coding-agent/dist/core/prompt-templates.js +6 -20
  53. package/node_modules/@earendil-works/pi-coding-agent/dist/core/resource-loader.js +38 -31
  54. package/node_modules/@earendil-works/pi-coding-agent/dist/core/sdk.js +9 -4
  55. package/node_modules/@earendil-works/pi-coding-agent/dist/core/session-manager.js +32 -24
  56. package/node_modules/@earendil-works/pi-coding-agent/dist/core/settings-manager.js +6 -13
  57. package/node_modules/@earendil-works/pi-coding-agent/dist/core/skills.js +8 -22
  58. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/bash.js +54 -53
  59. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit-diff.js +8 -1
  60. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/edit.js +44 -81
  61. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/file-mutation-queue.js +27 -12
  62. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/find.js +2 -3
  63. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/grep.js +3 -3
  64. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/ls.js +5 -5
  65. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/output-accumulator.js +9 -3
  66. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/path-utils.js +39 -21
  67. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/read.js +9 -8
  68. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/truncate.js +12 -2
  69. package/node_modules/@earendil-works/pi-coding-agent/dist/core/tools/write.js +20 -35
  70. package/node_modules/@earendil-works/pi-coding-agent/dist/main.js +5 -6
  71. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/config-selector.js +1 -1
  72. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/footer.js +14 -5
  73. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/login-dialog.js +29 -4
  74. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/components/user-message.js +1 -1
  75. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/interactive-mode.js +4 -4
  76. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/interactive/theme/theme.js +37 -28
  77. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-client.js +64 -7
  78. package/node_modules/@earendil-works/pi-coding-agent/dist/modes/rpc/rpc-mode.js +15 -3
  79. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/clipboard-native.js +14 -8
  80. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-core.js +124 -0
  81. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize-worker.js +31 -0
  82. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/image-resize.js +75 -115
  83. package/node_modules/@earendil-works/pi-coding-agent/dist/utils/paths.js +33 -7
  84. package/node_modules/@earendil-works/pi-coding-agent/npm-shrinkwrap.json +13 -26
  85. package/node_modules/@earendil-works/pi-coding-agent/package.json +6 -6
  86. package/node_modules/@earendil-works/pi-tui/dist/components/editor.js +40 -55
  87. package/node_modules/@earendil-works/pi-tui/dist/components/input.js +2 -2
  88. package/node_modules/@earendil-works/pi-tui/dist/components/markdown.js +12 -2
  89. package/node_modules/@earendil-works/pi-tui/dist/native-modifiers.js +53 -0
  90. package/node_modules/@earendil-works/pi-tui/dist/terminal-image.js +4 -1
  91. package/node_modules/@earendil-works/pi-tui/dist/terminal.js +38 -16
  92. package/node_modules/@earendil-works/pi-tui/dist/utils.js +19 -12
  93. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-arm64/darwin-modifiers.node +0 -0
  94. package/node_modules/@earendil-works/pi-tui/native/darwin/prebuilds/darwin-x64/darwin-modifiers.node +0 -0
  95. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-arm64/win32-console-mode.node +0 -0
  96. package/node_modules/@earendil-works/pi-tui/native/win32/prebuilds/win32-x64/win32-console-mode.node +0 -0
  97. package/node_modules/@earendil-works/pi-tui/package.json +3 -5
  98. package/node_modules/@smithy/node-http-handler/package.json +2 -2
  99. package/node_modules/undici/lib/api/api-request.js +1 -1
  100. package/node_modules/undici/lib/cache/sqlite-cache-store.js +3 -3
  101. package/node_modules/undici/lib/core/connect.js +16 -0
  102. package/node_modules/undici/lib/core/request.js +17 -2
  103. package/node_modules/undici/lib/core/socks5-client.js +10 -5
  104. package/node_modules/undici/lib/core/socks5-utils.js +17 -22
  105. package/node_modules/undici/lib/dispatcher/client-h1.js +64 -20
  106. package/node_modules/undici/lib/dispatcher/client.js +6 -2
  107. package/node_modules/undici/lib/dispatcher/h2c-client.js +1 -1
  108. package/node_modules/undici/lib/mock/mock-call-history.js +15 -15
  109. package/node_modules/undici/lib/util/cache.js +8 -7
  110. package/node_modules/undici/lib/web/fetch/formdata-parser.js +17 -6
  111. package/node_modules/undici/lib/web/fetch/index.js +5 -2
  112. package/node_modules/undici/lib/web/webidl/index.js +5 -5
  113. package/node_modules/undici/lib/web/websocket/stream/websocketstream.js +1 -7
  114. package/node_modules/undici/package.json +1 -1
  115. package/package.json +6 -6
  116. package/slingshot/index.js +269 -266
  117. package/node_modules/koffi/CHANGELOG.md +0 -1093
  118. package/node_modules/koffi/LICENSE.txt +0 -22
  119. package/node_modules/koffi/README.md +0 -43
  120. package/node_modules/koffi/build/koffi/darwin_arm64/koffi.node +0 -0
  121. package/node_modules/koffi/build/koffi/darwin_x64/koffi.node +0 -0
  122. package/node_modules/koffi/build/koffi/freebsd_arm64/koffi.node +0 -0
  123. package/node_modules/koffi/build/koffi/freebsd_ia32/koffi.node +0 -0
  124. package/node_modules/koffi/build/koffi/freebsd_x64/koffi.node +0 -0
  125. package/node_modules/koffi/build/koffi/linux_arm64/koffi.node +0 -0
  126. package/node_modules/koffi/build/koffi/linux_armhf/koffi.node +0 -0
  127. package/node_modules/koffi/build/koffi/linux_ia32/koffi.node +0 -0
  128. package/node_modules/koffi/build/koffi/linux_loong64/koffi.node +0 -0
  129. package/node_modules/koffi/build/koffi/linux_riscv64d/koffi.node +0 -0
  130. package/node_modules/koffi/build/koffi/linux_x64/koffi.node +0 -0
  131. package/node_modules/koffi/build/koffi/musl_arm64/koffi.node +0 -0
  132. package/node_modules/koffi/build/koffi/musl_x64/koffi.node +0 -0
  133. package/node_modules/koffi/build/koffi/openbsd_ia32/koffi.node +0 -0
  134. package/node_modules/koffi/build/koffi/openbsd_x64/koffi.node +0 -0
  135. package/node_modules/koffi/build/koffi/win32_arm64/koffi.exp +0 -0
  136. package/node_modules/koffi/build/koffi/win32_arm64/koffi.lib +0 -0
  137. package/node_modules/koffi/build/koffi/win32_arm64/koffi.node +0 -0
  138. package/node_modules/koffi/build/koffi/win32_ia32/koffi.exp +0 -0
  139. package/node_modules/koffi/build/koffi/win32_ia32/koffi.lib +0 -0
  140. package/node_modules/koffi/build/koffi/win32_ia32/koffi.node +0 -0
  141. package/node_modules/koffi/build/koffi/win32_x64/koffi.exp +0 -0
  142. package/node_modules/koffi/build/koffi/win32_x64/koffi.lib +0 -0
  143. package/node_modules/koffi/build/koffi/win32_x64/koffi.node +0 -0
  144. package/node_modules/koffi/doc/benchmarks.md +0 -126
  145. package/node_modules/koffi/doc/callbacks.md +0 -210
  146. package/node_modules/koffi/doc/contribute.md +0 -148
  147. package/node_modules/koffi/doc/functions.md +0 -250
  148. package/node_modules/koffi/doc/index.md +0 -61
  149. package/node_modules/koffi/doc/input.md +0 -471
  150. package/node_modules/koffi/doc/migration.md +0 -159
  151. package/node_modules/koffi/doc/misc.md +0 -180
  152. package/node_modules/koffi/doc/output.md +0 -305
  153. package/node_modules/koffi/doc/packaging.md +0 -88
  154. package/node_modules/koffi/doc/platforms.md +0 -36
  155. package/node_modules/koffi/doc/pointers.md +0 -328
  156. package/node_modules/koffi/doc/start.md +0 -118
  157. package/node_modules/koffi/doc/unions.md +0 -186
  158. package/node_modules/koffi/doc/variables.md +0 -102
  159. package/node_modules/koffi/index.d.ts +0 -288
  160. package/node_modules/koffi/index.js +0 -634
  161. package/node_modules/koffi/indirect.js +0 -533
  162. package/node_modules/koffi/lib/native/base/base.cc +0 -11015
  163. package/node_modules/koffi/lib/native/base/base.hh +0 -6003
  164. package/node_modules/koffi/lib/native/base/crc.inc +0 -2214
  165. package/node_modules/koffi/lib/native/base/crc_gen.py +0 -72
  166. package/node_modules/koffi/lib/native/base/mimetypes.inc +0 -1248
  167. package/node_modules/koffi/lib/native/base/mimetypes_gen.py +0 -58
  168. package/node_modules/koffi/lib/native/base/tower.cc +0 -821
  169. package/node_modules/koffi/lib/native/base/tower.hh +0 -81
  170. package/node_modules/koffi/lib/native/base/unicode.inc +0 -408
  171. package/node_modules/koffi/lib/native/base/unicode_gen.py +0 -152
  172. package/node_modules/koffi/package.json +0 -38
  173. package/node_modules/koffi/src/cnoke/LICENSE.txt +0 -22
  174. package/node_modules/koffi/src/cnoke/README.md +0 -99
  175. package/node_modules/koffi/src/cnoke/assets/FindCNoke.cmake +0 -127
  176. package/node_modules/koffi/src/cnoke/assets/toolchains.json +0 -126
  177. package/node_modules/koffi/src/cnoke/assets/win_delay_hook.c +0 -36
  178. package/node_modules/koffi/src/cnoke/cnoke.js +0 -170
  179. package/node_modules/koffi/src/cnoke/package.json +0 -24
  180. package/node_modules/koffi/src/cnoke/src/builder.js +0 -511
  181. package/node_modules/koffi/src/cnoke/src/index.js +0 -10
  182. package/node_modules/koffi/src/cnoke/src/tools.js +0 -407
  183. package/node_modules/koffi/src/koffi/CMakeLists.txt +0 -182
  184. package/node_modules/koffi/src/koffi/src/abi_arm32.cc +0 -1018
  185. package/node_modules/koffi/src/koffi/src/abi_arm32_asm.S +0 -169
  186. package/node_modules/koffi/src/koffi/src/abi_arm64.cc +0 -1295
  187. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.S +0 -195
  188. package/node_modules/koffi/src/koffi/src/abi_arm64_asm.asm +0 -174
  189. package/node_modules/koffi/src/koffi/src/abi_loong64.cc +0 -5
  190. package/node_modules/koffi/src/koffi/src/abi_loong64_asm.S +0 -204
  191. package/node_modules/koffi/src/koffi/src/abi_riscv64.cc +0 -915
  192. package/node_modules/koffi/src/koffi/src/abi_riscv64_asm.S +0 -203
  193. package/node_modules/koffi/src/koffi/src/abi_x64_sysv.cc +0 -939
  194. package/node_modules/koffi/src/koffi/src/abi_x64_sysv_asm.S +0 -231
  195. package/node_modules/koffi/src/koffi/src/abi_x64_win.cc +0 -715
  196. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.S +0 -166
  197. package/node_modules/koffi/src/koffi/src/abi_x64_win_asm.asm +0 -192
  198. package/node_modules/koffi/src/koffi/src/abi_x86.cc +0 -860
  199. package/node_modules/koffi/src/koffi/src/abi_x86_asm.S +0 -193
  200. package/node_modules/koffi/src/koffi/src/abi_x86_asm.asm +0 -177
  201. package/node_modules/koffi/src/koffi/src/call.cc +0 -1326
  202. package/node_modules/koffi/src/koffi/src/call.hh +0 -179
  203. package/node_modules/koffi/src/koffi/src/errno.inc +0 -462
  204. package/node_modules/koffi/src/koffi/src/ffi.cc +0 -2702
  205. package/node_modules/koffi/src/koffi/src/ffi.hh +0 -354
  206. package/node_modules/koffi/src/koffi/src/init.js +0 -105
  207. package/node_modules/koffi/src/koffi/src/parser.cc +0 -220
  208. package/node_modules/koffi/src/koffi/src/parser.hh +0 -54
  209. package/node_modules/koffi/src/koffi/src/util.cc +0 -1807
  210. package/node_modules/koffi/src/koffi/src/util.hh +0 -221
  211. package/node_modules/koffi/src/koffi/src/uv.cc +0 -193
  212. package/node_modules/koffi/src/koffi/src/uv.def +0 -10
  213. package/node_modules/koffi/src/koffi/src/uv.hh +0 -40
  214. package/node_modules/koffi/src/koffi/src/win32.cc +0 -198
  215. package/node_modules/koffi/src/koffi/src/win32.hh +0 -119
  216. package/node_modules/koffi/src/koffi/tools/write_trampolines.js +0 -77
  217. package/node_modules/koffi/vendor/node-addon-api/LICENSE.md +0 -9
  218. package/node_modules/koffi/vendor/node-addon-api/README.md +0 -95
  219. package/node_modules/koffi/vendor/node-addon-api/napi-inl.deprecated.h +0 -186
  220. package/node_modules/koffi/vendor/node-addon-api/napi-inl.h +0 -7033
  221. package/node_modules/koffi/vendor/node-addon-api/napi.h +0 -3309
  222. package/node_modules/koffi/vendor/node-api-headers/LICENSE +0 -21
  223. package/node_modules/koffi/vendor/node-api-headers/README.md +0 -95
  224. package/node_modules/koffi/vendor/node-api-headers/def/js_native_api.def +0 -125
  225. package/node_modules/koffi/vendor/node-api-headers/def/node_api.def +0 -157
  226. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api.h +0 -591
  227. package/node_modules/koffi/vendor/node-api-headers/include/js_native_api_types.h +0 -210
  228. package/node_modules/koffi/vendor/node-api-headers/include/node_api.h +0 -265
  229. package/node_modules/koffi/vendor/node-api-headers/include/node_api_types.h +0 -58
  230. package/node_modules/koffi/vendor/node-api-headers/include/uv/aix.h +0 -32
  231. package/node_modules/koffi/vendor/node-api-headers/include/uv/bsd.h +0 -34
  232. package/node_modules/koffi/vendor/node-api-headers/include/uv/darwin.h +0 -61
  233. package/node_modules/koffi/vendor/node-api-headers/include/uv/errno.h +0 -483
  234. package/node_modules/koffi/vendor/node-api-headers/include/uv/linux.h +0 -34
  235. package/node_modules/koffi/vendor/node-api-headers/include/uv/os390.h +0 -33
  236. package/node_modules/koffi/vendor/node-api-headers/include/uv/posix.h +0 -31
  237. package/node_modules/koffi/vendor/node-api-headers/include/uv/sunos.h +0 -44
  238. package/node_modules/koffi/vendor/node-api-headers/include/uv/threadpool.h +0 -37
  239. package/node_modules/koffi/vendor/node-api-headers/include/uv/tree.h +0 -521
  240. package/node_modules/koffi/vendor/node-api-headers/include/uv/unix.h +0 -512
  241. package/node_modules/koffi/vendor/node-api-headers/include/uv/version.h +0 -43
  242. package/node_modules/koffi/vendor/node-api-headers/include/uv/win.h +0 -698
  243. package/node_modules/koffi/vendor/node-api-headers/include/uv.h +0 -1990
@@ -1,195 +0,0 @@
1
- # SPDX-License-Identifier: MIT
2
- # SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
3
-
4
- #if defined(__APPLE__)
5
- #define SYMBOL(Symbol) _ ## Symbol
6
- #else
7
- #define SYMBOL(Symbol) Symbol
8
- #endif
9
-
10
- # Forward
11
- # ----------------------------
12
-
13
- #if defined(__APPLE__)
14
- # Fix "arm64 function not 4-byte aligned" linker warnings
15
- .p2align 2
16
- #endif
17
-
18
- # These three are the same, but they differ (in the C side) by their return type.
19
- # Unlike the three next functions, these ones don't forward XMM argument registers.
20
- .global SYMBOL(ForwardCallGG)
21
- .global SYMBOL(ForwardCallF)
22
- .global SYMBOL(ForwardCallDDDD)
23
-
24
- # The X variants are slightly slower, and are used when XMM arguments must be forwarded.
25
- .global SYMBOL(ForwardCallXGG)
26
- .global SYMBOL(ForwardCallXF)
27
- .global SYMBOL(ForwardCallXDDDD)
28
-
29
- # Copy function pointer to r9, in order to save it through argument forwarding.
30
- # Also make a copy of the SP to CallData::old_sp because the callback system might need it.
31
- # Save RSP in r29 (non-volatile), and use carefully assembled stack provided by caller.
32
- .macro prologue
33
- .cfi_startproc
34
- hint #34
35
- stp x29, x30, [sp, -16]!
36
- .cfi_def_cfa sp, 16
37
- .cfi_offset 29, 16
38
- .cfi_offset 30, 8
39
- mov x29, sp
40
- .cfi_def_cfa x29, 16
41
- str x29, [x2, 0]
42
- mov x9, x0
43
- add sp, x1, #136
44
- .endm
45
-
46
- # Call native function.
47
- # Once done, restore normal stack pointer and return.
48
- # The return value is passed untouched through r0, r1, v0 and/or v1.
49
- .macro epilogue
50
- blr x9
51
- mov sp, x29
52
- .cfi_def_cfa sp, 16
53
- ldp x29, x30, [sp], 16
54
- .cfi_def_cfa sp, 0
55
- .cfi_restore 30
56
- .cfi_restore 29
57
- ret
58
- .cfi_endproc
59
- .endm
60
-
61
- # Prepare general purpose argument registers from array passed by caller.
62
- .macro forward_gpr
63
- ldr x8, [x1, 64]
64
- ldp x6, x7, [x1, 48]
65
- ldp x4, x5, [x1, 32]
66
- ldp x2, x3, [x1, 16]
67
- ldp x0, x1, [x1, 0]
68
- .endm
69
-
70
- # Prepare vector argument registers from array passed by caller.
71
- .macro forward_vec
72
- ldp d6, d7, [x1, 120]
73
- ldp d4, d5, [x1, 104]
74
- ldp d2, d3, [x1, 88]
75
- ldp d0, d1, [x1, 72]
76
- .endm
77
-
78
- SYMBOL(ForwardCallGG):
79
- prologue
80
- forward_gpr
81
- epilogue
82
-
83
- SYMBOL(ForwardCallF):
84
- prologue
85
- forward_gpr
86
- epilogue
87
-
88
- SYMBOL(ForwardCallDDDD):
89
- prologue
90
- forward_gpr
91
- epilogue
92
-
93
- SYMBOL(ForwardCallXGG):
94
- prologue
95
- forward_vec
96
- forward_gpr
97
- epilogue
98
-
99
- SYMBOL(ForwardCallXF):
100
- prologue
101
- forward_vec
102
- forward_gpr
103
- epilogue
104
-
105
- SYMBOL(ForwardCallXDDDD):
106
- prologue
107
- forward_vec
108
- forward_gpr
109
- epilogue
110
-
111
- # Callbacks
112
- # ----------------------------
113
-
114
- .global SYMBOL(RelayCallback)
115
- .global SYMBOL(SwitchAndRelay)
116
- .global SYMBOL(RelayDirect)
117
- .global SYMBOL(TrampolineEnd)
118
-
119
- # First, make a copy of the argument registers.
120
- # Then call the C function RelayCallback with the following arguments:
121
- # static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
122
- # arguments of this call, and a pointer to a struct that will contain the result registers.
123
- # After the call, simply load these registers from the output struct.
124
- .macro trampoline id
125
- .cfi_startproc
126
- hint #34
127
- mov x9, \id
128
- b RelayTrampoline
129
- .cfi_endproc
130
- .endm
131
-
132
- RelayTrampoline:
133
- .cfi_startproc
134
- stp x29, x30, [sp, -16]!
135
- .cfi_def_cfa sp, 16
136
- .cfi_offset 29, 16
137
- .cfi_offset 30, 8
138
- sub sp, sp, #192
139
- .cfi_def_cfa sp, 208
140
- stp x0, x1, [sp, 0]
141
- stp x2, x3, [sp, 16]
142
- stp x4, x5, [sp, 32]
143
- stp x6, x7, [sp, 48]
144
- str x8, [sp, 64]
145
- stp d0, d1, [sp, 72]
146
- stp d2, d3, [sp, 88]
147
- stp d4, d5, [sp, 104]
148
- stp d6, d7, [sp, 120]
149
- mov x0, x9
150
- mov x1, sp
151
- bl SYMBOL(RelayCallback)
152
- ldp x0, x1, [sp, 136]
153
- ldp d0, d1, [sp, 152]
154
- ldp d2, d3, [sp, 168]
155
- add sp, sp, #192
156
- .cfi_def_cfa sp, 16
157
- ldp x29, x30, [sp], 16
158
- .cfi_def_cfa sp, 0
159
- .cfi_restore 30
160
- .cfi_restore 29
161
- ret
162
- .cfi_endproc
163
-
164
- # When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
165
- # The problem is that we're still running on the separate Koffi stack, and V8 will
166
- # probably misdetect this as a "stack overflow". We have to restore the old
167
- # stack pointer, call Node.js/V8 and go back to ours.
168
- # The first three parameters (x0, x1, x2) are passed through untouched.
169
- SYMBOL(SwitchAndRelay):
170
- .cfi_startproc
171
- hint #34
172
- stp x29, x30, [sp, -16]!
173
- .cfi_def_cfa sp, 16
174
- .cfi_offset 29, 16
175
- .cfi_offset 30, 8
176
- mov x29, sp
177
- ldr x9, [x4, 0]
178
- sub x9, sp, x9
179
- and x9, x9, #-16
180
- str x9, [x4, 8]
181
- mov sp, x3
182
- bl SYMBOL(RelayDirect)
183
- mov sp, x29
184
- .cfi_def_cfa sp, 16
185
- ldp x29, x30, [sp], 16
186
- .cfi_def_cfa sp, 0
187
- .cfi_restore 30
188
- .cfi_restore 29
189
- ret
190
- .cfi_endproc
191
-
192
- #include "gnu.inc"
193
-
194
- SYMBOL(TrampolineEnd):
195
- ret
@@ -1,174 +0,0 @@
1
- ; SPDX-License-Identifier: MIT
2
- ; SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
3
-
4
- AREA |.text|, CODE
5
-
6
- ; Forward
7
- ; ----------------------------
8
-
9
- ; These three are the same, but they differ (in the C side) by their return type.
10
- ; Unlike the three next functions, these ones don't forward XMM argument registers.
11
- EXPORT ForwardCallGG
12
- EXPORT ForwardCallF
13
- EXPORT ForwardCallDDDD
14
-
15
- ; The X variants are slightly slower, and are used when XMM arguments must be forwarded.
16
- EXPORT ForwardCallXGG
17
- EXPORT ForwardCallXF
18
- EXPORT ForwardCallXDDDD
19
-
20
- ; Copy function pointer to r9, in order to save it through argument forwarding.
21
- ; Save RSP in r29 (non-volatile), and use carefully assembled stack provided by caller.
22
- MACRO
23
- prologue
24
-
25
- stp x29, x30, [sp, -16]!
26
- mov x29, sp
27
- str x29, [x2, 0]
28
- mov x9, x0
29
- add sp, x1, #136
30
- MEND
31
-
32
- ; Call native function.
33
- ; Once done, restore normal stack pointer and return.
34
- ; The return value is passed untouched through r0, r1, v0 and/or v1.
35
- MACRO
36
- epilogue
37
-
38
- blr x9
39
- mov sp, x29
40
- ldp x29, x30, [sp], 16
41
- ret
42
- MEND
43
-
44
- ; Prepare general purpose argument registers from array passed by caller.
45
- MACRO
46
- forward_gpr
47
-
48
- ldr x8, [x1, 64]
49
- ldp x6, x7, [x1, 48]
50
- ldp x4, x5, [x1, 32]
51
- ldp x2, x3, [x1, 16]
52
- ldp x0, x1, [x1, 0]
53
- MEND
54
-
55
- ; Prepare vector argument registers from array passed by caller.
56
- MACRO
57
- forward_vec
58
-
59
- ldp d6, d7, [x1, 120]
60
- ldp d4, d5, [x1, 104]
61
- ldp d2, d3, [x1, 88]
62
- ldp d0, d1, [x1, 72]
63
- MEND
64
-
65
- ForwardCallGG PROC
66
- prologue
67
- forward_gpr
68
- epilogue
69
- ENDP
70
-
71
- ForwardCallF PROC
72
- prologue
73
- forward_gpr
74
- epilogue
75
- ENDP
76
-
77
- ForwardCallDDDD PROC
78
- prologue
79
- forward_gpr
80
- epilogue
81
- ENDP
82
-
83
- ForwardCallXGG PROC
84
- prologue
85
- forward_vec
86
- forward_gpr
87
- epilogue
88
- ENDP
89
-
90
- ForwardCallXF PROC
91
- prologue
92
- forward_vec
93
- forward_gpr
94
- epilogue
95
- ENDP
96
-
97
- ForwardCallXDDDD PROC
98
- prologue
99
- forward_vec
100
- forward_gpr
101
- epilogue
102
- ENDP
103
-
104
- ; Callbacks
105
- ; ----------------------------
106
-
107
- EXPORT RelayCallback
108
- EXTERN RelayCallback
109
- EXPORT SwitchAndRelay
110
- EXPORT RelayDirect
111
- EXTERN RelayDirect
112
- EXPORT TrampolineEnd
113
-
114
- ; First, make a copy of the argument registers.
115
- ; Then call the C function RelayCallback with the following arguments:
116
- ; static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
117
- ; arguments of this call, and a pointer to a struct that will contain the result registers.
118
- ; After the call, simply load these registers from the output struct.
119
- MACRO
120
- trampoline $ID
121
-
122
- mov x9, $ID
123
- b RelayTrampoline
124
- MEND
125
-
126
- RelayTrampoline PROC
127
- stp x29, x30, [sp, -16]!
128
- sub sp, sp, #192
129
- stp x0, x1, [sp, 0]
130
- stp x2, x3, [sp, 16]
131
- stp x4, x5, [sp, 32]
132
- stp x6, x7, [sp, 48]
133
- str x8, [sp, 64]
134
- stp d0, d1, [sp, 72]
135
- stp d2, d3, [sp, 88]
136
- stp d4, d5, [sp, 104]
137
- stp d6, d7, [sp, 120]
138
- mov x0, x9
139
- mov x1, sp
140
- bl RelayCallback
141
- ldp x0, x1, [sp, 136]
142
- ldp d0, d1, [sp, 152]
143
- ldp d2, d3, [sp, 168]
144
- add sp, sp, #192
145
- ldp x29, x30, [sp], 16
146
- ret
147
- ENDP
148
-
149
- ; When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
150
- ; The problem is that we're still running on the separate Koffi stack, and V8 will
151
- ; probably misdetect this as a "stack overflow". We have to restore the old
152
- ; stack pointer, call Node.js/V8 and go back to ours.
153
- ; The first three parameters (x0, x1, x2) are passed through untouched.
154
- SwitchAndRelay PROC
155
- stp x29, x30, [sp, -16]!
156
- mov x29, sp
157
- ldr x9, [x4, 0]
158
- sub x9, sp, x9
159
- and x9, x9, #-16
160
- str x9, [x4, 8]
161
- mov sp, x3
162
- bl RelayDirect
163
- mov sp, x29
164
- ldp x29, x30, [sp], 16
165
- ret
166
- ENDP
167
-
168
- INCLUDE armasm.inc
169
-
170
- TrampolineEnd PROC
171
- ret
172
- ENDP
173
-
174
- END
@@ -1,5 +0,0 @@
1
- // SPDX-License-Identifier: MIT
2
- // SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
3
-
4
- // There's nothing to see here, this architecture uses the ABI code in abi_riscv64.cc!
5
- // This file only exists to avoid leaving abi_loong64_asm.S alone :)
@@ -1,204 +0,0 @@
1
- # SPDX-License-Identifier: MIT
2
- # SPDX-FileCopyrightText: 2025 Niels Martignène <niels.martignene@protonmail.com>
3
-
4
- #define SYMBOL(Symbol) Symbol
5
-
6
- # Forward
7
- # ----------------------------
8
-
9
- # These three are the same, but they differ (in the C side) by their return type.
10
- # Unlike the three next functions, these ones don't forward FA argument registers.
11
- .global ForwardCallGG
12
- .global ForwardCallF
13
- .global ForwardCallDG
14
- .global ForwardCallGD
15
- .global ForwardCallDD
16
-
17
- # The X variants are slightly slower, and are used when FA arguments must be forwarded.
18
- .global ForwardCallXGG
19
- .global ForwardCallXF
20
- .global ForwardCallXDG
21
- .global ForwardCallXGD
22
- .global ForwardCallXDD
23
-
24
- # Copy function pointer to t7, in order to save it through argument forwarding.
25
- # Also make a copy of the SP to CallData::old_sp because the callback system might need it.
26
- # Save SP in FP, and use carefully assembled stack provided by caller.
27
- .macro prologue
28
- addi.d $sp, $sp, -16
29
- st.d $ra, $sp, 0
30
- st.d $fp, $sp, 8
31
- move $fp, $sp
32
- st.d $fp, $a2, 0
33
- move $t7, $a0
34
- addi.d $sp, $a1, 128
35
- .endm
36
-
37
- # Call native function.
38
- # Once done, restore normal stack pointer and return.
39
- # The return value is passed untouched through registers.
40
- .macro epilogue
41
- jirl $ra, $t7,0
42
- move $sp, $fp
43
- ld.d $ra, $sp, 0
44
- ld.d $fp, $sp, 8
45
- addi.d $sp, $sp, 16
46
- jr $ra
47
- .endm
48
-
49
- # Prepare general purpose argument registers from array passed by caller.
50
- .macro forward_gpr
51
- ld.d $a7, $a1, 120
52
- ld.d $a6, $a1, 112
53
- ld.d $a5, $a1, 104
54
- ld.d $a4, $a1, 96
55
- ld.d $a3, $a1, 88
56
- ld.d $a2, $a1, 80
57
- ld.d $a0, $a1, 64
58
- ld.d $a1, $a1, 72
59
- .endm
60
-
61
- # Prepare vector argument registers from array passed by caller.
62
- .macro forward_vec
63
- fld.d $fa7, $a1, 56
64
- fld.d $fa6, $a1, 48
65
- fld.d $fa5, $a1, 40
66
- fld.d $fa4, $a1, 32
67
- fld.d $fa3, $a1, 24
68
- fld.d $fa2, $a1, 16
69
- fld.d $fa1, $a1, 8
70
- fld.d $fa0, $a1, 0
71
- .endm
72
-
73
- ForwardCallGG:
74
- prologue
75
- forward_gpr
76
- epilogue
77
-
78
- ForwardCallF:
79
- prologue
80
- forward_gpr
81
- epilogue
82
-
83
- ForwardCallDG:
84
- prologue
85
- forward_gpr
86
- epilogue
87
-
88
- ForwardCallGD:
89
- prologue
90
- forward_gpr
91
- epilogue
92
-
93
- ForwardCallDD:
94
- prologue
95
- forward_gpr
96
- epilogue
97
-
98
- ForwardCallXGG:
99
- prologue
100
- forward_vec
101
- forward_gpr
102
- epilogue
103
-
104
- ForwardCallXF:
105
- prologue
106
- forward_vec
107
- forward_gpr
108
- epilogue
109
-
110
- ForwardCallXDG:
111
- prologue
112
- forward_vec
113
- forward_gpr
114
- epilogue
115
-
116
- ForwardCallXGD:
117
- prologue
118
- forward_vec
119
- forward_gpr
120
- epilogue
121
-
122
- ForwardCallXDD:
123
- prologue
124
- forward_vec
125
- forward_gpr
126
- epilogue
127
-
128
- # Callbacks
129
- # ----------------------------
130
-
131
- .global RelayCallback
132
- .global SwitchAndRelay
133
- .global RelayDirect
134
- .global TrampolineEnd
135
-
136
- # First, make a copy of the argument registers.
137
- # Then call the C function RelayCallback with the following arguments:
138
- # static trampoline ID, a pointer to the saved GPR array, a pointer to the stack
139
- # arguments of this call, and a pointer to a struct that will contain the result registers.
140
- # After the call, simply load these registers from the output struct.
141
- .macro trampoline id
142
- li.d $t0, \id
143
- b RelayTrampoline
144
- .balign 16
145
- .endm
146
-
147
- RelayTrampoline:
148
- addi.d $sp, $sp, -176
149
- st.d $ra, $sp, 0
150
- st.d $a0, $sp, 8
151
- st.d $a1, $sp, 16
152
- st.d $a2, $sp, 24
153
- st.d $a3, $sp, 32
154
- st.d $a4, $sp, 40
155
- st.d $a5, $sp, 48
156
- st.d $a6, $sp, 56
157
- st.d $a7, $sp, 64
158
- fst.d $fa0, $sp, 72
159
- fst.d $fa1, $sp, 80
160
- fst.d $fa2, $sp, 88
161
- fst.d $fa3, $sp, 96
162
- fst.d $fa4, $sp, 104
163
- fst.d $fa5, $sp, 112
164
- fst.d $fa6, $sp, 120
165
- fst.d $fa7, $sp, 128
166
- move $a0, $t0
167
- addi.d $a1, $sp, 8
168
- bl RelayCallback
169
- ld.d $ra, $sp, 0
170
- ld.d $a0, $sp, 136
171
- ld.d $a1, $sp, 144
172
- fld.d $fa0, $sp, 152
173
- fld.d $fa1, $sp, 160
174
- addi.d $sp, $sp, 176
175
- jr $ra
176
-
177
- # When a callback is relayed, Koffi will call into Node.js and V8 to execute Javascript.
178
- # The problem is that we're still running on the separate Koffi stack, and V8 will
179
- # probably misdetect this as a "stack overflow". We have to restore the old
180
- # stack pointer, call Node.js/V8 and go back to ours.
181
- # The first three parameters (a0, a1, a2) are passed through untouched.
182
- SwitchAndRelay:
183
- addi.d $sp, $sp, -16
184
- st.d $ra, $sp, 0
185
- st.d $fp, $sp, 8
186
- move $fp, $sp
187
- ld.d $t0, $a4, 0
188
- sub.d $t0, $sp, $t0
189
- li.d $t1, -16
190
- and $t0, $t0, $t1
191
- st.d $t0, $a4, 8
192
- move $sp, $a3
193
- bl RelayDirect
194
- move $sp, $fp
195
- ld.d $ra, $sp, 0
196
- ld.d $fp, $sp, 8
197
- addi.d $sp, $sp, 16
198
- jr $ra
199
-
200
- .balign 16
201
- #include "gnu.inc"
202
-
203
- TrampolineEnd:
204
- jr $ra