Commit graph

6153 commits

Author SHA1 Message Date
bunnie
fafee5bc72
If PR is accepted, we'd make formatOnSave true by default 2024-01-07 17:38:51 +08:00
bunnie
45edea44b3
Remove the exclusions
If we harmonize on `rustfmt` for the repo, all exclusions would be removed.
2024-01-07 17:37:30 +08:00
bunnie
d9b26b1f95 RFC: proposed rustfmt settings for the project 2024-01-07 16:59:33 +08:00
bunnie
96328cd2b9 bump getrandom version to allow compatiblity with sigchat crates 2024-01-06 18:25:16 +08:00
bunnie
d44ab2f2aa add the .a artifacts to the tree for the asm.S
these are just sync'd to the asm.S and checked in.

Eventually, we should migrate that .S file into using
in-line assembly macros, but now that I look at it, I remember
why it hasn't been done yet -- there are some fancy conditionals
used to enable compatibility with different architectures that
I don't know off the top of my head how to translate into
in-line assembly syntax.
2024-01-06 16:41:40 +08:00
bunnie
c3f3ef91b2 fix #474
dbf28fbd61 from 9 months ago
actually broke the resume path, but we didn't see it until now
because the .a files are checked into the tree.
2024-01-06 16:41:31 +08:00
bunnie
d91df62678 add susres testing feature to the ticktimer-test-client 2024-01-06 16:41:02 +08:00
bunnie
163f8a23ac add susres testing feature to the ticktimer-test-client 2024-01-06 16:39:35 +08:00
bunnie
de9af9cfd1 add std test templates to shellchat
some tests cherry-picked out of the `std` suite to help look
into locking problems in the kernel. Behind a feature gate
of `locktests`
2024-01-04 23:19:51 +08:00
bunnie
8ec08c9c76 fix rust v1.75.0 warnings that are probably benign
a lot of re-import warnings have cropped up. While I appreciate
their studiousness on this, the problem is that removing some
of these exports in the API crate could mean that future users
who want access to some API features that aren't used in this
configuration are now unaccessible.

I think it's not a huge problem at the moment, just spam-cleaning
the warnings because there are too many to deal with carefully
at the moment.
2024-01-04 19:15:28 +08:00
bunnie
0d80912f0a fix warning in 1.75.0; breaking change with earlier rust versions
This is unfortunate, and calling this out in a single commit because
this is a dubious decision to achieve warning-free code for such
a minor thing.
2024-01-04 19:13:20 +08:00
bunnie
5f25e2b992 add rand_xorshift to the project 2024-01-04 18:31:36 +08:00
bunnie
f88cca4401 cleanup hosted mode implementation for xous-log 2024-01-04 18:31:16 +08:00
bunnie
c9407a2d47 harmonize hosted mode to latest kernel API for get_pid() 2024-01-04 18:30:48 +08:00
bunnie
4efddceab0
Merge pull request #471 from betrusted-io/stability-refactor
Stability refactor
2024-01-04 18:20:02 +08:00
Sean Cross
061abb05db xous-log: stdout: insert \r when printing \n
When printing messages to stdout or stderr, insert `\r` whenever we
encounter `\n`.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 19:01:19 +08:00
Sean Cross
9a1191c0d2 emulation: ComConnector: remove IInterestingType
Apparently SPI connectors are no longer interesting. Remove this
designator as it no longer exists.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
b12c08e998 emulation: soc: add _zicsr_zifencei to rv32imac
Add "_zicsr_zifencei" to "rv32imac" when describing the CPU core. This
is required by newer versions of the spec, and will eventually be a
requirement of Renode.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
beeca26823 emulation: ec: add new riscv suffixes for csr/fence
The riscv foundation changed the descriptor of riscv cores. We must now
add "_zicsr_zifencei" to the "rv32i" designation in order to ensure we
have access to CSRs and the "FENCE.I" instruction.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
88020c99e0 loader: add pid to map_page() call
Add the pid as the page owner to `map_page()` calls. This ensures pages
are owned by their respective processes, and removes a lot of
`change_owner()` calls that immediately follow page mapping.

It also allows for superpages to be owned by their respective processes.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
e0c62e5480 loader: don't reserve the "susres" page
The "susres" page should be owned by the "susres" server and not the
kernel. Avoid mapping this page to the kernel to prevent it from getting
double-mapped.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
6b5b4a5d21 kernel: services: don't crash when a process quits
When enumerating processes, the `find_process()` process didn't consult
whether a process was actually free. This resulted in a crash,
particularly when attaching a debugger to a crashed process.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
b95d442e20 kernel: debug: add "check memory" command
This command ensures memory is all owned by the correct process and is
unique in its ownership.

It takes a long time to run, so ensure the watchdog timer is disabled.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
e44d009b84 kernel: mem: add function for verifying mappings
Add a function to ensure mappings are unique across the whole system.
This takes a very long time and can crash if the watchdog timer isn't
paused.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:42:16 +08:00
Sean Cross
d5816b667a kernel: riscv: remove unsafe code from process
Remove transmutes from process.rs and replace them with ordinary casts.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:24:31 +08:00
Sean Cross
d4893c1c83 kernel: riscv: add phys_to_virt function
The phys_to_virt function can be used to determine what physical address
page is mapped to a virtual address page.

This throws an error when a page is mapped twice, which shouldn't
happen.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:23:19 +08:00
Sean Cross
124040bbb3 kernel: asm: align kernel stack to 16 bytes
The kernel stack offset should be aligned to 16 bytes. Previously it was
aligned to 8 bytes. It's unclear if this was the cause of any issues,
but it is best practice to keep things aligned to 16 bytes.

As part of this, key the atomic instructions off of the CPP macro
presence of atomic instructions.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-29 18:15:48 +08:00
Sean Cross
8e3b3bc1e8 Merge branch 'main' of github.com:betrusted-io/xous-core 2023-12-27 15:06:16 +08:00
bunnie
488d976f23 move original copy to new location, trying to preserve commit history 2023-12-27 15:04:27 +08:00
bunnie
336da86915 remove duplicate asm.S 2023-12-27 15:03:58 +08:00
Sean Cross
c3f6d7412a kernel: remove unused asm.S file
This file hasn't been used in a long time, and is merely a copy of the
file that is actually used.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-27 14:14:18 +08:00
Sean Cross
409b50b85e blitstr2: regenerate files after template changes
Regenerate the font files after adjusting the template to generate files
that will not get changed by rustfmt.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-27 14:13:16 +08:00
Sean Cross
aee07683b7 loader: run cargo fmt
There are no changes to this project.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-27 14:12:26 +08:00
Sean Cross
22546710df blitstr2: codegen: generate rustfmt-compatible code
Generate code that can be put through rustfmt without being altered.
This removes an issue where the font tables can be rearraged by simply
running `rustfmt` on the repository.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-27 14:12:26 +08:00
bunnie
9ebf8eb2fc bump version pins in lockfile for xous libs 2023-12-26 00:22:21 +08:00
bunnie
c2c56f9d3f fix typo in kernel feature specifier 2023-12-26 00:20:56 +08:00
bunnie
fda782663a bump version pins for xous change 2023-12-26 00:13:10 +08:00
bunnie
0d6f98665a
Merge pull request #470 from betrusted-io/kernel-memory-fixes
Kernel memory fixes
2023-12-26 00:08:07 +08:00
Sean Cross
3658940260 kernel: add big-heap flag for running tests
When running Rust tests, a larger heap is needed. Add a kernel flag to
support this by default.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-25 23:35:37 +08:00
Sean Cross
006a50d206 kernel: mem: fix memory zeroing
Fix memory zeroing when requesting a physical pointer. Previously, only
the first 25% of a page was zeroed due to a bug when casting between
*mut u8 and *mut usize.

This now uses `write_volatile` to ensure the memory clear isn't
optimized out, and uses `usize` pointers everywhere.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-25 23:30:26 +08:00
Sean Cross
f2e9d2b76c kernel: riscv: threads: ensure registers are zeroed
The register set should be cleared already, however it is possible
(though remote) that register values are not cleared when a thread is
created.

Ordinarily threads are zeroed when destroyed, but this makes sure
they're zeroed upon creation as well.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-25 23:29:20 +08:00
Sean Cross
d798962151 kernel: format some files
Format some files prior to patching them.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-12-25 23:28:52 +08:00
bunnie
22cd08dc57 bump version in restore script 2023-12-25 23:06:07 +08:00
bunnie
2b521a75f8 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2023-12-24 23:55:51 +08:00
bunnie
65310d42bd update release notes with patches made during release regression testing 2023-12-24 23:55:21 +08:00
bunnie
b6306ac8f4 add debug statements around i2c locking 2023-12-24 23:51:24 +08:00
bunnie
5a0461cb01 make menu building a bit more efficient by not locking when not necessary 2023-12-24 23:51:04 +08:00
bunnie
7e04357aba modernize codec debug 2023-12-24 23:50:50 +08:00
bunnie
8931f10383 work around boot instability issue with a delay setting up codec in TTS
The `codec` seems to hang sometimes during `Setup8kStereo` at boot.
Did not get to the bottom of it, but suspect that the RTC I2C init
sequence is interfering with the codec init sequence. This might
be resolved while also fixing #467, but for now, a short delay
on boot works around the problem.
2023-12-24 23:35:47 +08:00
bunnie
23a9b0cc34 add more helpful debug output for token claim failure 2023-12-24 22:14:39 +08:00