pw_kernel: Store stacks in .bss to save space

This change saves ~4,000 bytes from the kernel ELF file. In particular,
here are the outputs of `bazelisk build --config k_host
//pw_kernel/tooling:code_size` from before and after this change:

Before
======
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/mps2_an505/kernel_only_demo,17652
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/mps2_an505/userspace_demo,14532
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/qemu_virt_riscv32/kernel_only_demo,16684
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/qemu_virt_riscv32/userspace_demo,13128

After
=====
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/mps2_an505/kernel_only_demo,13548
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/mps2_an505/userspace_demo,10432
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/qemu_virt_riscv32/kernel_only_demo,12624
bazel-out/darwin_x86_64-opt/bin/pw_kernel/target/qemu_virt_riscv32/userspace_demo,9080

Change-Id: Ie93cfc52215753e1b4482d5fe3058dc53fcfa86a
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/303372
Commit-Queue: Joshua Liebow-Feeser <joshlf@google.com>
Lint: Lint 🤖 <android-build-ayeaye@system.gserviceaccount.com>
Pigweed-Auto-Submit: Joshua Liebow-Feeser <joshlf@google.com>
Docs-Not-Needed: Joshua Liebow-Feeser <joshlf@google.com>
Presubmit-Verified: CQ Bot Account <pigweed-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Erik Gilling <konkers@google.com>
10 files changed
tree: b849382680d9ea6fca01f943d27a281437e0ebed
  1. .allstar/
  2. .gemini/
  3. .github/
  4. .vscode/
  5. build_overrides/
  6. docker/
  7. docs/
  8. kudzu/
  9. pw_alignment/
  10. pw_allocator/
  11. pw_analog/
  12. pw_android_toolchain/
  13. pw_arduino_build/
  14. pw_assert/
  15. pw_assert_basic/
  16. pw_assert_fuchsia/
  17. pw_assert_log/
  18. pw_assert_tokenized/
  19. pw_assert_trap/
  20. pw_assert_zephyr/
  21. pw_async/
  22. pw_async2/
  23. pw_async2_basic/
  24. pw_async2_epoll/
  25. pw_async_basic/
  26. pw_async_fuchsia/
  27. pw_atomic/
  28. pw_base64/
  29. pw_bloat/
  30. pw_blob_store/
  31. pw_bluetooth/
  32. pw_bluetooth_hci/
  33. pw_bluetooth_profiles/
  34. pw_bluetooth_proxy/
  35. pw_bluetooth_sapphire/
  36. pw_boot/
  37. pw_boot_cortex_m/
  38. pw_build/
  39. pw_build_android/
  40. pw_build_info/
  41. pw_build_mcuxpresso/
  42. pw_bytes/
  43. pw_channel/
  44. pw_checksum/
  45. pw_chre/
  46. pw_chrono/
  47. pw_chrono_embos/
  48. pw_chrono_freertos/
  49. pw_chrono_rp2040/
  50. pw_chrono_stl/
  51. pw_chrono_threadx/
  52. pw_chrono_zephyr/
  53. pw_cli/
  54. pw_cli_analytics/
  55. pw_clock_tree/
  56. pw_clock_tree_mcuxpresso/
  57. pw_compilation_testing/
  58. pw_config_loader/
  59. pw_console/
  60. pw_containers/
  61. pw_cpu_exception/
  62. pw_cpu_exception_cortex_m/
  63. pw_cpu_exception_risc_v/
  64. pw_crypto/
  65. pw_digital_io/
  66. pw_digital_io_linux/
  67. pw_digital_io_mcuxpresso/
  68. pw_digital_io_rp2040/
  69. pw_digital_io_zephyr/
  70. pw_display/
  71. pw_dma_mcuxpresso/
  72. pw_docgen/
  73. pw_doctor/
  74. pw_elf/
  75. pw_emu/
  76. pw_env_setup/
  77. pw_env_setup_zephyr/
  78. pw_file/
  79. pw_flatbuffers/
  80. pw_format/
  81. pw_function/
  82. pw_fuzzer/
  83. pw_grpc/
  84. pw_hdlc/
  85. pw_hex_dump/
  86. pw_i2c/
  87. pw_i2c_linux/
  88. pw_i2c_mcuxpresso/
  89. pw_i2c_rp2040/
  90. pw_i2c_zephyr/
  91. pw_ide/
  92. pw_interrupt/
  93. pw_interrupt_cortex_m/
  94. pw_interrupt_freertos/
  95. pw_interrupt_zephyr/
  96. pw_intrusive_ptr/
  97. pw_json/
  98. pw_kernel/
  99. pw_kvs/
  100. pw_libc/
  101. pw_libcxx/
  102. pw_log/
  103. pw_log_android/
  104. pw_log_basic/
  105. pw_log_fuchsia/
  106. pw_log_null/
  107. pw_log_rpc/
  108. pw_log_string/
  109. pw_log_tokenized/
  110. pw_log_zephyr/
  111. pw_malloc/
  112. pw_malloc_freelist/
  113. pw_malloc_freertos/
  114. pw_metric/
  115. pw_minimal_cpp_stdlib/
  116. pw_module/
  117. pw_multibuf/
  118. pw_multisink/
  119. pw_numeric/
  120. pw_package/
  121. pw_perf_test/
  122. pw_persistent_ram/
  123. pw_polyfill/
  124. pw_preprocessor/
  125. pw_presubmit/
  126. pw_protobuf/
  127. pw_protobuf_compiler/
  128. pw_random/
  129. pw_random_fuchsia/
  130. pw_result/
  131. pw_ring_buffer/
  132. pw_router/
  133. pw_rpc/
  134. pw_rpc_transport/
  135. pw_rust/
  136. pw_sensor/
  137. pw_snapshot/
  138. pw_software_update/
  139. pw_span/
  140. pw_spi/
  141. pw_spi_linux/
  142. pw_spi_mcuxpresso/
  143. pw_spi_rp2040/
  144. pw_status/
  145. pw_stm32cube_build/
  146. pw_stream/
  147. pw_stream_shmem_mcuxpresso/
  148. pw_stream_uart_linux/
  149. pw_stream_uart_mcuxpresso/
  150. pw_string/
  151. pw_symbolizer/
  152. pw_sync/
  153. pw_sync_baremetal/
  154. pw_sync_embos/
  155. pw_sync_freertos/
  156. pw_sync_stl/
  157. pw_sync_threadx/
  158. pw_sync_zephyr/
  159. pw_sys_io/
  160. pw_sys_io_ambiq_sdk/
  161. pw_sys_io_arduino/
  162. pw_sys_io_baremetal_lm3s6965evb/
  163. pw_sys_io_baremetal_stm32f429/
  164. pw_sys_io_emcraft_sf2/
  165. pw_sys_io_mcuxpresso/
  166. pw_sys_io_rp2040/
  167. pw_sys_io_stdio/
  168. pw_sys_io_stm32cube/
  169. pw_sys_io_zephyr/
  170. pw_system/
  171. pw_target_runner/
  172. pw_thread/
  173. pw_thread_embos/
  174. pw_thread_freertos/
  175. pw_thread_stl/
  176. pw_thread_threadx/
  177. pw_thread_zephyr/
  178. pw_tls_client/
  179. pw_tls_client_boringssl/
  180. pw_tls_client_mbedtls/
  181. pw_tokenizer/
  182. pw_toolchain/
  183. pw_trace/
  184. pw_trace_tokenized/
  185. pw_transfer/
  186. pw_uart/
  187. pw_uart_mcuxpresso/
  188. pw_unit_test/
  189. pw_uuid/
  190. pw_varint/
  191. pw_watch/
  192. pw_web/
  193. pw_work_queue/
  194. seed/
  195. targets/
  196. third_party/
  197. ts/
  198. zephyr/
  199. .bazelignore
  200. .bazelrc
  201. .bazelversion
  202. .black.toml
  203. .clang-format
  204. .clang-tidy
  205. .eslintrc.cjs
  206. .git-blame-ignore-revs
  207. .gitattributes
  208. .gitignore
  209. .gn
  210. .mypy.ini
  211. .prettierignore
  212. .prettierrc.cjs
  213. .pw_ide.yaml
  214. .pylintrc
  215. .ruff.toml
  216. activate.bat
  217. Android.bp
  218. AUTHORS
  219. bootstrap.bat
  220. bootstrap.fish
  221. bootstrap.sh
  222. BUILD.bazel
  223. BUILD.gn
  224. BUILDCONFIG.gn
  225. CMakeLists.txt
  226. GEMINI.md
  227. go.mod
  228. go.sum
  229. jest.config.ts
  230. Kconfig.zephyr
  231. LICENSE
  232. MODULE.bazel
  233. MODULE.bazel.lock
  234. modules.gni
  235. OWNERS
  236. package-lock.json
  237. package.json
  238. pigweed.json
  239. PIGWEED_MODULES
  240. pnpm-lock.yaml
  241. README.md
  242. REPO.bazel
  243. rollup-protos.config.js
  244. rollup.config.js
  245. tsconfig.json
  246. WORKSPACE
  247. WORKSPACE_OWNERS
README.md

Pigweed

Pigweed is an open source collection of embedded-targeted libraries–or as we like to call them, modules. These modules are building blocks and infrastructure that enable faster and more reliable development on small-footprint MMU-less 32-bit microcontrollers like the STMicroelectronics STM32L452 or the Nordic nRF52832.

For more information please see our website: https://pigweed.dev/.

Links