Commit graph

29 commits

Author SHA1 Message Date
bunnie
eee9f4e765 refactor xous-names to permit only a fixed number of connections
this prevents less trusted processes from connecting to servers
after the kernel initializations are done.

this works so long as we don't have disconnects from the kernel
servers. In order to support disconnects we will also need a
way to re-enumerate the SID to guarantee that we don't have a re-use
problem. But for now, the kernel is not designed with any practical
disconnect mechanism; there is no code that calls the Quit mechanism
on any server.
2021-06-15 17:41:14 +08:00
bunnie
fadc9c29ab Merge remote-tracking branch 'origin/master' into bunnie-dev 2021-06-02 03:59:25 +08:00
bunnie
30aa794f30 add reference counting on connections between servers
the connection number is re-used for all objects created
within a process space, so you can't `Drop` the connection
immediately when an object goes out of scope. You have to
make sure all instance of the object go out of scope. This
patch adds reference counting to all the objects so that
the `Drop` function works as intended.
2021-05-21 16:24:30 +08:00
Sean Cross
eb7895d601 xous: add a return code to TerminateProcess
As part of this refactor, make `terminate_process()` a divergent call.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-05-20 11:01:00 +08:00
bunnie
08a86749fe fix hosted mode bugs 2021-05-09 01:13:16 +08:00
bunnie
391122823d refactor heapless version in attempt to debug issue that cropped up in xous-names
somehow, updating the toolchain has broken the FnvIndexMap implementation
2021-05-08 18:44:23 +08:00
bunnie
adc7f8e98d cleanup the i2c API
condense async/sync methods into a single one and decide which
is which based upon the presence of an Option<callback>
2021-05-06 14:03:06 +08:00
bunnie
bc82dbd157 transition i2c api on codec, finally found the damn race condition 2021-05-06 05:05:17 +08:00
bunnie
75bb4805b1 clean up RTC server to use the new I2C API 2021-05-06 04:16:31 +08:00
bunnie
b596c40dd6 refactor I2C to have work queue, cleaner (but untested) APIs 2021-05-06 03:40:04 +08:00
bunnie
bb5bc1d212 refactor i2c to break out the i2c machine to a separate server
the concurrency issues on I2C are getting hairy, and it was probably a
dubious decision from the start to merge I2C into the LLIO block; but
originally this was motivated by the idea of keeping all the
"miscellaneous slow stuff" in one process to keep the memory footprint
small and make code a bit more readable.

Keeping I2C in the same process space as the LLIO but splitting it
into its own thread and server splits the difference, by giving us
more options to deal with the concurrency, without inflating the size
of the kernel binary and allocating a lot of extra static data.
2021-05-06 00:45:14 +08:00
bunnie
abf308e82d try to trace down issue #61 2021-05-02 16:39:08 +08:00
bunnie
a1bcfb469e add another call to make sure the RTC is initialized correctly 2021-04-27 00:40:29 +08:00
bunnie
4ecd7c06ac trying to fix renode stuff, but not quite there 2021-04-23 21:49:13 +08:00
bunnie
4022462144 fix RTC wakeup alarm code 2021-04-23 17:51:12 +08:00
bunnie
061284ec5f debugging BOOST mode glitch issue
Here's an arcane bug for you:

When powering down, the Spartan 7 3.3V I/O drivers will
output a roughly 800us wide glitch as 3.3V falls below around
1.7V, if the 0.95V core voltage comes down first (which it does
because we have an active discharge on 0.95V, but not on 3.3V).

In this case, it's just wide and high enough to cause the
BOOST mode line to engage, which takes the BOOST output
and ties it to VBUS, which is just enough for the system to
think you're powering it back on again. Which is not what
you want when powering down.

The ultimate fix was to put a heftier pull-down on the BOOST
line so that it can't trip the BOOST output into the VBUS.
Another option could be more active discharge FETs, but that
would require a full board spin and we are already at certification,
so we'll stick with the stronger pull-down on BOOST. It seems to
be a robust fix in the worst corner cases we can find.

The downside is that when powering an external USB device,
you are burning an extra 30mW of power overcoming the pull-down,
but typically, any external USB devices plugged into Precursor
will burn far in excess of that, so the delta should be negligible.
2021-04-23 15:33:14 +08:00
bunnie
9647c47c2c refine/update docs for unhooking callbacks 2021-04-14 03:20:40 +08:00
bunnie
75295485a7 fix RTC callbacks 2021-04-14 02:58:22 +08:00
bunnie
f1d97fe428 RTC cmdline function mostly working
seems there is some issue with de-registering/disconnecting
connections though, need to make simpler test cases to diagnose
2021-04-10 01:01:51 +08:00
bunnie
2916eb3775 relocate the destroy callback call to after the server exits 2021-04-09 18:51:43 +08:00
bunnie
162bf01819 intermediate check in of callback destroy problem 2021-04-09 18:06:21 +08:00
bunnie
8b93dd0c63 RTC server now basically working
There is an issue with the rtc commandline time checking
with respect to unhooking its callback, maybe related to
the new disconnect/destroy server code
2021-04-09 05:24:29 +08:00
bunnie
856934c2c9 some progress, but check in to recreate previous crash 2021-04-09 00:15:42 +08:00
bunnie
0fa3d3c969 begin debugging of the RTC 2021-04-08 04:38:01 +08:00
bunnie
45c90659e5 rtc first draft 2021-04-08 02:30:57 +08:00
bunnie
0f9eea10d9 flesh out callback handling of events in LLIO 2021-04-07 18:29:50 +08:00
bunnie
9ba2fb134c refactor most major modules, but Xous now crashes 2021-04-05 23:50:00 +08:00
bunnie
470b5c6440 finalize API refactor for xous-names 2021-03-30 02:13:23 +08:00
bunnie
6677d79834 initial RTC framework 2021-03-18 16:22:08 +08:00