Skip to content

Commit

Permalink
Merge pull request #2 from Alzymologist/release-0-1-0
Browse files Browse the repository at this point in the history
Prepare for releasing
  • Loading branch information
varovainen authored Jan 17, 2024
2 parents 474803b + 840b78e commit 8d3a1b0
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 0 deletions.
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: "cargo"
directory: "/"
labels: ["dependabot"]
schedule:
interval: "weekly"
- package-ecosystem: "github-actions"
directory: "/"
labels: ["dependabot-ci"]
schedule:
interval: "weekly"
29 changes: 29 additions & 0 deletions .github/workflows/rust-cargo-deny.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Check cargo deny

on:
pull_request:
push:
branches:
- main
- stable

jobs:
cargo-deny:
name: Cargo deny
runs-on: ubuntu-latest
strategy:
matrix:
checks:
- advisories

continue-on-error: ${{ matrix.checks == 'advisories' }}

steps:
- name: Checkout Sources
uses: actions/[email protected]

- name: Run cargo-deny
uses: EmbarkStudios/cargo-deny-action@v1
with:
command: --manifest-path=./Cargo.toml check ${{ matrix.checks }}

38 changes: 38 additions & 0 deletions .github/workflows/rust-clippy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Rust clippy

on:
pull_request:
push:
branches:
- main
- stable

jobs:
linter:
name: Cargo clippy
runs-on: ubuntu-latest
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 50
submodules: 'recursive'

- name: Install Rust stable toolchain
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
override: true

- name: Rust Cache
uses: Swatinem/[email protected]

- name: cargo clippy
run: cargo clippy --all-targets -- -D warnings
35 changes: 35 additions & 0 deletions .github/workflows/rust-fmt.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Rustfmt

on:
pull_request:
push:
branches:
- main
- stable

jobs:
rustfmt:
name: Cargo fmt
runs-on: ubuntu-latest
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 50
submodules: 'recursive'

- name: Install Rust stable toolchain
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
override: true

- name: cargo fmt
run: cargo fmt --all -- --check
44 changes: 44 additions & 0 deletions .github/workflows/rust-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: Rust test

on:
pull_request:
push:
branches:
- main
- stable

jobs:
check:
name: Cargo test
runs-on: ubuntu-latest
steps:

- name: Cancel Previous Runs
uses: styfle/[email protected]
with:
access_token: ${{ github.token }}

- name: Checkout sources
uses: actions/[email protected]
with:
fetch-depth: 50
submodules: 'recursive'

- name: Install Rust stable toolchain
uses: actions-rs/[email protected]
with:
profile: minimal
toolchain: stable
override: true

- name: Install cargo-nextest
uses: baptiste0928/cargo-install@v2
with:
crate: cargo-nextest
version: 0.9

- name: Rust Cache
uses: Swatinem/[email protected]

- name: cargo nextest
run: cargo nextest run
9 changes: 9 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
[package]
description = "HAL to keep data in memory that could not be directly mapped to RAM"
license = "GPL-3.0-or-later"
name = "external-memory-tools"
version = "0.1.0"
authors = ["Alexander Slesarev <[email protected]>", "Vera Abramova <[email protected]>"]
edition = "2021"
repository = "https://github.com/Alzymologist/external-memory-tools"
homepage = "https://github.com/Alzymologist/external-memory-tools"
documentation = "https://docs.rs/external-memory-tools/"
keywords = ["no_std", "baremetal", "memory", "secure"]
exclude = ["/.github"]


[features]
default = ["std"]
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# External memory tools

This is a tiny collections of tools useful to address memory that is not mapped directly into RAM. Do not use it unless you know exactly what you are doing, the cases where this is needed are very limited and mostly related to very special baremetal systems.

## Brief explanation

Rust allows neat memory allocations on no-std systems with the use of allocator abstraction; however, all normal tools assume that the memory that is addressed by that allocator could be low-level mapped into some address space. In some rare cases this is not possible (for example, in security vaults mapping arbitrary memory would present a direct breach to system security model).

So if you happen to work with one of those systems and you find yourself repeating the same patterns over and over again - use this crate.

## Usage

Implement needed buffer access operations on your target memory and enjoy!

To use this crate with regular memory (for simpler cross platformness), just use `()` as `External Memory` - feature is implemented there. Unfortunately, you would still have to include `()` as parameter in every affected function call.

## Development

Currently only read operations are supported; if you decide to contribute and add more features like writable and read-writeable buffers, please start hiding those under feature flags to keep things lean and safe.

0 comments on commit 8d3a1b0

Please sign in to comment.