Migrates Pigweed off of SpinLock to use the new InterruptSpinLock
name.
Also updates some stale documentation regarding SystemClock backends
which use InterruptSpinLocks before C++ construction now that there
is a constexpr constructor, as it was already getting updated for
the rename.
Change-Id: Ie821b7c5c59f21a16bcc9bd9674c5df6a85e27b1
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/37561
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Renames the existing pw::sync::SpinLock to InterruptSpinLock to
make it obvious that this is not just a spin lock and that interrupt
masking is included.
This change leaves C++ & GN redirects in place in order to support
migrating Pigweed and customers in follow up changes.
Change-Id: If9fb5594e7d71778b15cd15a9cd7ec71ca0e403b
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/37560
Commit-Queue: Ewout van Bekkum <ewout@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Moves the armv7m implementation of pw_cpu_exception to
pw_cpu_exception_cortex_m since much of the logic can be shared between
ARMv8-M and ARMv7-M. Symbol names are also updated to reflect current
naming style for extern "C" symbols. Old names will be removed in
pwrev/31060.
Warning, symbol renames are breaking!
pw_CpuExceptionEntry -> pw_cpu_exception_Entry
pw_CpuExceptionDefaultHandler -> pw_cpu_exception_DefaultHandler
Change-Id: I7ab99ac7637c436ba959d7546043090c66fe4215
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30922
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Pigweed-Auto-Submit: Armando Montanez <amontanez@google.com>
Adds a dummy spin lock backend implementation for baremetal
configuration.
The provided implementation makes a single attempt to acquire the
lock and asserts if it is unavailable. It does not perform interrupt
masking or disable global interrupts, so this implementation does
not support simultaneous multi-threaded environments including IRQs,
and is only meant to prevent data corruption.
Change-Id: I4d44b2dd5cc6f38be1188a9f480f61c6d042b855
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/30520
Reviewed-by: Ewout van Bekkum <ewout@google.com>
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Backends for the pw_rpc/system_server facade were defined in the pw_rpc
module, preventing targets from customizing their server configurations
and channels. This change moves the backends into the respective target
directories. Additionally, pw_unit_test's RPC main is updated to use the
system server.
Change-Id: I670e13dd178ab8a7fc8dfa8fade3f82a46d5208c
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/28500
Reviewed-by: Wyatt Hepler <hepler@google.com>
Reviewed-by: Keir Mierle <keir@google.com>
Commit-Queue: Alexei Frolov <frolv@google.com>
- Add the --fail-on-unused-args option to gn gen by default in
presubmit.
- Import .gni files for backend build args into the toolchains
that set them.
- Skip the init_cipd and init_virtualenv steps in local presubmits.
Instead, use the current environment. This is much faster and avoids
confusion about which environment is in use.
Fixes: 294
Change-Id: Ib86da7c3d4560b6c92cbacced725ee54c485e3d6
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/27580
Commit-Queue: Wyatt Hepler <hepler@google.com>
Reviewed-by: Michael Spang <spang@google.com>
Using socket or sys_io to connect to server and client on host.
Test: Manually tested
Requires: pigweed:25460
Change-Id: I174121b90cea69621a885202b0d4d2df78a9aba8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/20040
Commit-Queue: Jiaming (Charlie) Wang <jiamingw@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Updates all Pigweed targets, except for arduino, to use the
extra_strict_warnings where relevant.
Also fixes up several places which wouldn't compile with "-Wshadow"
enabled.
Change-Id: Ieb2c7f4870e4609181825e2c894ccbac56135cad
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21688
Reviewed-by: Armando Montanez <amontanez@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Commit-Queue: Ewout van Bekkum <ewout@google.com>
The "# gn-format disable" comments are no longer necessary. Delete these
comments and reformat with a Vim macro and gn format.
Change-Id: Ia62c40ad73eef91187d0d443d6e3b0fa723e5aa9
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/21380
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Wyatt Hepler <hepler@google.com>
In general toolchains should set values for the builtin arguments
current_cpu and current_os; this configures both the toolchain itself
and everything it builds. Make it so in Pigweed.
If there's a toolchain with current_os = "ios", use the arguments for
Apple's linker.
Bug: 241
Change-Id: I2ce8c46eb48cbc70c5d14086934bdf59c2fc3f36
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/16006
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Reviewed-by: Armando Montanez <amontanez@google.com>
Commit-Queue: Michael Spang <spang@google.com>
Add functions to check if a pw::allocator::Block object is valid in the
sense that it's aligned, the prev/next pointer matches with each other,
and poison bytes is not corrupted if enabled. Add functions to crash on
seeing an invalid Block.
Add a gn arg to enable heap poison, with sizeof(void*) before and after
the usable space with a fixed pattern.
Change-Id: I68a0194b4522ccadb21ecba96ce47a2265e8bf59
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/14500
Commit-Queue: Chenghan Zhou <chenghanzh@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
The pw_cpu_exception facade is comprised of three parts: the part
implemented by the architecture, and the part implemented by the
application, and some supporting libraries that make it easier to dump
CPU state. Since these are provided independently, the facade has been
split into three facades:
1. entry
2. handler
3. support
Change-Id: I48c92f42b208f79596740f1bec59ed3d29e277a8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/11646
Commit-Queue: Armando Montanez <amontanez@google.com>
Reviewed-by: Wyatt Hepler <hepler@google.com>
Removes floating point printf support from the default ARM toolchain and
makes it into an optional config that isn't added by default (since it
adds ~14KB of flash usage).
Change-Id: I340630fa596ae131b56e75c7acb2536766cd11b8
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/12660
Reviewed-by: Keir Mierle <keir@google.com>
Reviewed-by: Alexei Frolov <frolv@google.com>
Commit-Queue: Armando Montanez <amontanez@google.com>
Updates pigweed to depend directly on is_host_toolchain provided by the
toolchain. Also adds a toolchain option that controls the extension of
final linked binaries.
Change-Id: Ia9499fe5974997a5bbc0bb9cfb89b5569b987189