Commit Graph

3 Commits

Author SHA1 Message Date
Prashanth Swaminathan
f605f2d2ed pw_sync_baremetal: Add simple mutex implementation
Adds a dummy mutex implementation for baremetal configurations.

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: Id122f890a37822c3b752b810e0e687f19f8c9dbd
Reviewed-on: https://pigweed-review.googlesource.com/c/pigweed/pigweed/+/45721
Commit-Queue: Auto-Submit <auto-submit@pigweed.google.com.iam.gserviceaccount.com>
Pigweed-Auto-Submit: Prashanth Swaminathan <prashanthsw@google.com>
Reviewed-by: Ewout van Bekkum <ewout@google.com>
2021-05-18 17:55:29 +00:00
Ewout van Bekkum
126e01176c pw_sync: rename SpinLock -> InterruptSpinLock
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>
2021-03-12 20:52:04 +00:00
Prashanth Swaminathan
acbd070e63 pw_sync_baremetal: Add scaffolding for baremetal
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>
2021-01-23 02:27:51 +00:00