Commit Graph

344 Commits

Author SHA1 Message Date
hayodea eeaa4ed2df CMake: Add preliminary CPack support
We'll tune it later.
2025-09-16 22:19:48 -04:00
hayodea 0788bbd799 Cmake,DAPS: Add support for DAPS preprocessing
We add a new extension, .dapss for preprocessable DAPS spec files.
We now run the C preprocessor on the .dapss files to produce
.daps files.
2025-09-16 21:30:50 -04:00
hayodea a6eccede4a DAPSpecs: Formatting 2025-09-16 20:44:46 -04:00
hayodea 437f7ea10f Postfix these files with .dapss 2025-09-16 20:08:38 -04:00
hayodea 58f7df49ae Move DAP specs into /devices 2025-09-16 20:04:05 -04:00
hayodea 03da91f5e5 Move DAP specs into /bodies/devices 2025-09-16 19:57:19 -04:00
hayodea 02c071394b Update todos 2025-09-16 19:54:32 -04:00
hayodea c52c447a78 Formatting 2025-09-16 18:46:30 -04:00
hayodea ddd6f6d6c6 CompThr: Comment on posted CBs 2025-09-16 18:45:55 -04:00
hayodea f5c359a6a9 Update todos 2025-09-16 18:40:40 -04:00
hayodea af33b7f097 SenseApiMgr: Make at/detachSenseDev & at/detachAllSenseDevs posted
They are posted to Marionette.

* We also fixed callOriginCb invocations;
* Also made posted CBs use std::bind instead of greedily
  early-invoking the CB on the servicing thread's stack.
2025-09-16 18:38:06 -04:00
hayodea 92e55641a0 LivoxGen1: Replace throw with cb+early ret 2025-09-16 18:36:50 -04:00
hayodea 9e00cd1530 Formatting, indentation 2025-09-16 18:36:11 -04:00
hayodea 8fd8826f8d Mind:threadMgmt ops: move 0-iter callback to top 2025-09-16 18:24:16 -04:00
hayodea 5d30941aab AsyncLoop: Add copy constr + assignment op
Make nTotal non-const.
2025-09-16 18:20:08 -04:00
hayodea 429bd2a349 Exc: Replace with cb+ret 2025-09-16 15:10:28 -04:00
hayodea 5c79a89cd4 Body: Don't forget to finalizeAllLibs 2025-09-16 15:09:56 -04:00
hayodea a931f9f01a CompThr: Name segments to indicate that they're posted 2025-09-15 15:15:40 -04:00
hayodea 7f3bfec835 Mind:init/finiReq: now posted to mrntt; callbacks std:bind
We now have mind::initialize/finalizeReq post their requests
to Mrntt instead of executing on the caller's thread context.

We also fixed the way that we invoke callbacks by properly wrapping
it in a std::bind.
2025-09-15 15:01:26 -04:00
hayodea 19b39d391f DevMgr: Move helper function to top 2025-09-15 14:33:42 -04:00
hayodea 674d74cfb9 DevMgr:newDevSpecInd: fix posting and async pattern conformance 2025-09-15 14:32:26 -04:00
hayodea b768739b96 CompThr: Delete shutdownInd & exceptionInd
We no longer need them because we now have
mrntt::mrntt.finalizeReq(), which does a more holistic job of
shutting down Marionette (and thus, ultimately, Salmanoff).
2025-09-15 13:43:11 -04:00
hayodea 77acbdd8de Indentation 2025-09-15 13:10:30 -04:00
hayodea 7b699d5d36 LivoxGen1: Check for 3 '.'s in smo-ip 2025-09-15 13:05:58 -04:00
hayodea db8f047322 SApiMgr:attDevReq: use body||world thread for i/e-devs
We now pass in the correct ComponentThread based on the type of
device that's being attached.
2025-09-15 12:47:37 -04:00
hayodea 472184bbbc Fix build errors with mind::globalMind and Qualia headers 2025-09-15 12:47:09 -04:00
hayodea dd3d5fea66 Todo: update completed tasks 2025-09-15 12:45:52 -04:00
hayodea 6573a1b14d CMake: delete subdir CMakeLists; use one CMakeList for smocore 2025-09-15 12:44:57 -04:00
hayodea 0759461c69 Mrntt:main: call mrntt:finalizeReq on exception
We'll wrap this in some exception-specific wrapper later.
2025-09-15 11:42:38 -04:00
hayodea 62cada2547 Bodies:dev: rename d0 to win0 2025-09-15 08:36:14 -04:00
hayodea e755383e72 Body: postfix _posted to posted sequence methods 2025-09-15 08:33:49 -04:00
hayodea d1e4c1a2ea Body:finalize: Will run if even one initReq step was executed
If even one step in Body.initializeReq was executed at all, then
whether or not it succeeded, we consider the body component to have
been initialized, at least with respect to whether finalizeReq
ought to run.
2025-09-15 08:30:17 -04:00
hayodea 29b192b2ee Formatting, spam-reduction 2025-09-15 08:25:49 -04:00
hayodea 7c48abbcca Body:init: Return true if any devices were initialized at all 2025-09-15 08:25:20 -04:00
hayodea 0ec227cf9e Body:finalize: Run even if body.init wasn't called
We now run body.finalizeReq even if body.init wasn't called. We'll
do a finer-grained check on each aspect of Body that needs to be
finalized now. This check was too large-grained.
2025-09-15 08:23:54 -04:00
hayodea baad2a9890 mrntt:main: Get rid of finalizeInd
This leverages the new clean dynamic allocation of the globalMind
object to make the mrntt::main and SMO's initialization and
shutdown much cleaner. We no longer concern ourselves with
shutting down the Mind threads inside of mrntt::main, but rather
we leave that state machine to the Mind class and Mrntt component.
2025-09-14 23:31:12 -04:00
hayodea 91ccd16b33 Add Mrntt component; init globalMind in mrntt.initializeReq
This makes the initialization sequence much cleaner and conceptually
well encapsulated.

We also now dynamically allocate the Mind objects. They're allocated
dynamically by Mrntt inside of initializeReq. This means that we no
longer have to worry about jolting and cleaning up the running threads
of global mind object even when we never explicitly called
Mind.initializeReq.

Along with other conceptual improvements to our abstractions, this
patch also gets us to a real "end of program initialization" point
for the first time.
2025-09-14 22:17:19 -04:00
hayodea 16865dc36f Rename these files and change ifdef guards 2025-09-14 13:16:02 -04:00
hayodea da0ef64f62 Split CompThread=>MindThr+MrnttThr; alloc globalMind in mrnttMain
We now allocate globalMind locally inside of marionetteMain. Why?

Before now, we had an asymmetric threading situation where the
globalMind's threads were initialized at during global constructor
invocation and not on demand. This meant that we had to shut down
those threads even if we had never got to the point of calling
Mind::initializeReq.

This significantly complicated our shutdown sequence since we had
to factor in the lifetime of the std::thread objects inside of the
ComponentThreads which were inside of the globalMind object.

Now, if we hadn't called Mind::initializeReq, we don't have to
perform any Mind::finalizeReq or adjacent operations. Shutdown is
symmetrically mirrored against the operations we actually performed
during execution.

We introduced some complexity by splitting ComponentThreads into
two derivative types (MindThread and MarionetteThread) but I think
in the long term we'll be able to massage this split into a much
cleaner situation overall.
2025-09-14 11:07:05 -04:00
hayodea 83af74f4be Update todo 2025-09-14 11:01:52 -04:00
hayodea 7cb6c8521e MindThread:shutdownInd: explicitly invoke on globalMind 2025-09-14 10:59:52 -04:00
hayodea 1d3d929ddd Mind: Use state variables to manage shutdown
We now allow the shutdown*Req() methods of Mind:: to return early
if their aspect of the object in question hasn't actually been
initialized.
2025-09-13 18:59:44 -04:00
hayodea 25a9721f92 Mind: Implement initialize/finalizeBodyReq()
We've done a lot of general work on the init sequencing.
2025-09-12 16:09:26 -04:00
hayodea b99b147959 CMake: libsmocore links against libsenseApis 2025-09-12 16:00:19 -04:00
hayodea 96bf653167 Add comments about Mrntt/Manager vs Mind sync/async design 2025-09-12 09:52:02 -04:00
hayodea 4429135539 Mind,Mrntt: Use async pattern in Mind; init threads before initializeSmo
In Mrntt, we now initialize Mind:: object threads before calling
initializeSalmanoffReq().

We've also propagated the spinscale async pattern into the Mind
class.
2025-09-11 20:11:10 -04:00
hayodea 89947dfc71 AsyncLoop: Add test for zero-iteration loops
This mnemonically ensures that we'll remember to check for
these kinds of async loops.
2025-09-11 20:10:01 -04:00
hayodea fb17c51ef6 ComponentThread: Remove lambdas; use standard async pattern
We've finally cleaned this code up by removing these dirty lambdas.
Next we do the Mind:: class sequences.
2025-09-11 18:41:45 -04:00
hayodea b8c931397d Async: add TargetedContinuation
This class enables us to consistently represent continuations
that are intended to be posted on a particular target handling
thread. It hols a sh_ptr to the caller so that the target thread
can re-enqueue the response on the caller after processing the
REQ/IND op.
2025-09-11 18:37:48 -04:00
hayodea f5195450e4 Formatting 2025-09-11 09:10:12 -04:00