[package]
name = "rustsbi"
description = "Minimal RISC-V's SBI implementation library in Rust"
version = "0.3.2"
authors = [
    "Luo Jia <me@luojia.cc>",
    "Campbell He <hkp18@mails.tsinghua.edu.cn>",
    "Yifan Wu <shinbokuow@163.com>",
]
repository = "https://github.com/rustsbi/rustsbi"
documentation = "https://docs.rs/rustsbi"
license = "MulanPSL-2.0 OR MIT"
readme = "README.md"
keywords = ["riscv", "sbi", "rustsbi"]
categories = ["os", "embedded", "hardware-support", "no-std"]
edition = "2021"

[dependencies]
sbi-spec = "0.0.5"
riscv = { version = "0.10.1", optional = true }

[features]
default = ["machine"]
# Enable RISC-V SBI 2.0-rc1 extensions, i.e. the DBCN extension
# It will add a generic parameter to RustSBI instance structure.
# FIXME: remove this feature (and from CI workflow) on rustsbi 0.4.0 and adds this generic parameter permanently onto RustSBI.
sbi_2_0 = []
# Run RustSBI on machine mode
# This feature enables to use RISC-V primitives on current machine mode environment
# If you are developing a cross-architecture virtual machine, consider disabling this feature
# to customize environment variables for RISC-V architecture like mvendorid, mimpid, etc.
machine = ["dep:riscv"]
# Build RustSBI singleton
# This would enable `init_*` functions. It will take extra place on bss or data region
# to take care of singleton reference locks.
# Disable this feature to use instance based RustSBI environment.
singleton = ["dep:riscv", "machine"]
# Support legacy extension; this feature is not included by default.
legacy = ["sbi-spec/legacy", "singleton"]

[package.metadata.docs.rs]
default-target = "riscv64imac-unknown-none-elf"
targets = [
    "riscv32imac-unknown-none-elf", "riscv64imac-unknown-none-elf",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html