Commit graph

13 commits

Author SHA1 Message Date
bunnie
49456db837 fix typos 2025-11-30 21:32:08 +08:00
bunnie
ecbac27e76 fix rustc-1.89 warnings 2025-08-19 19:45:29 +08:00
bunnie
e4e6db8bc9 fix implicit lifetime warning 2024-12-02 18:54:26 +08:00
bunnie
043dfd84ae update formatting to latest nightly rules 2024-09-24 01:49:45 +08:00
bunnie
4c7c9312c1 change xous-ipc api to 0.10.0 2024-09-23 00:24:48 +08:00
bunnie
679435c5f4 format sevices/pddb
wow the formatter hated this code.

hope i can recognize it later on when it needs work,
nobody else probably wants to touch it. :-/
2024-01-14 22:35:23 +08:00
Sean Cross
5dfad296ae xous: mark MemoryRange::as_slice and friends as unsafe
Mark `MemoryRange::as_slice()` and `MemoryRange::as_slice_mut()` as
unsafe.

This is due to the fact that not all representable types can be cast to
an arbitrary value. For example, if Process A sends random values to
Process B, then Process B casts the memory to a slice of `bool`, then
any values that are not 0 or 1 are undefined.

Because these functions can leak UB into the program, they are marked as
unsafe.

This patch adds `unsafe {}` blocks to all instances where this function
is called. Additionally, all instances have been checked to verify that
they do not cast to any invalid types -- most use `u8` or `u32`.

Additionally, the long-deprecated `MemoryRange::from_parts()` call was
removed, since that causes UB without being marked as unsafe.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-09-12 10:07:38 +08:00
bunnie
f0b351c2e0 suggested method to preserve intent of drop to fix error
However, I didn't write this library (and I don't have a test
suite for it), so I'm not quite sure if this preserves the
invariants on the fd_mapping() structure. Needs @xobs' review.
2023-07-16 17:58:40 +08:00
bunnie
9932d971c4 clean up the warnings that are deemed safe to clean up
one warning remains, will address this in a future PR.
2023-07-16 17:55:28 +08:00
bunnie
7cb98699aa add some consistency check and repair facility to PDDB 2023-01-27 15:26:46 +08:00
Sean Cross
dc4ca79834 services: pddb: use an enum for file types
Rather than hardcoding numbers, use an enum with the constant values.
This will make it easier to reason about what the constants mean.

Signed-off-by: Sean Cross <sean@xobs.io>
2023-01-18 09:06:16 +08:00
Sean Cross
086c014de2 pddb: close all related filehandles when a file is deleted
Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 23:56:31 +08:00
Sean Cross
ee18fe889c pddb: initial libstd support
Add support for libstd calls to pddb.

The pddb uses `:` as the path separator, and grafts the concept of paths
onto dicts.

Currently implemented features:

    * mkdir
    * rmdir
    * create file
    * open file
    * read file
    * write file
    * unlink file
    * seek file

Other calls may be added as needed.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-07-05 22:50:58 +08:00