mirror of
https://github.com/panpaul/tiny_os
synced 2024-09-20 09:45:19 +08:00
chore: rename api to uapi
This commit is contained in:
parent
a65176bc57
commit
f577370ee7
18
Cargo.lock
generated
18
Cargo.lock
generated
@ -18,14 +18,6 @@ dependencies = [
|
|||||||
"vspace",
|
"vspace",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "api"
|
|
||||||
version = "0.1.0"
|
|
||||||
dependencies = [
|
|
||||||
"num-derive",
|
|
||||||
"num-traits",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "autocfg"
|
name = "autocfg"
|
||||||
version = "1.2.0"
|
version = "1.2.0"
|
||||||
@ -105,7 +97,6 @@ name = "kernel"
|
|||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"allocator",
|
"allocator",
|
||||||
"api",
|
|
||||||
"bitflags 2.5.0",
|
"bitflags 2.5.0",
|
||||||
"cfg-if",
|
"cfg-if",
|
||||||
"fdt",
|
"fdt",
|
||||||
@ -116,6 +107,7 @@ dependencies = [
|
|||||||
"sbi-rt",
|
"sbi-rt",
|
||||||
"spin",
|
"spin",
|
||||||
"static_assertions",
|
"static_assertions",
|
||||||
|
"uapi",
|
||||||
"uart_16550",
|
"uart_16550",
|
||||||
"utils",
|
"utils",
|
||||||
"vspace",
|
"vspace",
|
||||||
@ -256,6 +248,14 @@ dependencies = [
|
|||||||
"unicode-ident",
|
"unicode-ident",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "uapi"
|
||||||
|
version = "0.1.0"
|
||||||
|
dependencies = [
|
||||||
|
"num-derive",
|
||||||
|
"num-traits",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "uart_16550"
|
name = "uart_16550"
|
||||||
version = "0.3.0"
|
version = "0.3.0"
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
resolver = "2"
|
resolver = "2"
|
||||||
members = ["api", "kernel", "lib/*"]
|
members = ["kernel", "lib/*", "uapi"]
|
||||||
|
|
||||||
[profile.dev]
|
[profile.dev]
|
||||||
panic = "abort"
|
panic = "abort"
|
||||||
|
@ -20,8 +20,8 @@ riscv = []
|
|||||||
"riscv.board.virt" = ["riscv.riscv64"]
|
"riscv.board.virt" = ["riscv.riscv64"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
|
uapi = { path = "../uapi" }
|
||||||
allocator = { path = "../lib/allocator" }
|
allocator = { path = "../lib/allocator" }
|
||||||
api = { path = "../api" }
|
|
||||||
utils = { path = "../lib/utils", default-features = false }
|
utils = { path = "../lib/utils", default-features = false }
|
||||||
vspace = { path = "../lib/vspace", default-features = false }
|
vspace = { path = "../lib/vspace", default-features = false }
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use crate::objects::null::NullCap;
|
use crate::objects::null::NullCap;
|
||||||
use api::cap::ObjectType;
|
|
||||||
use core::cell::Cell;
|
use core::cell::Cell;
|
||||||
|
use uapi::cap::ObjectType;
|
||||||
use utils::{
|
use utils::{
|
||||||
linked_list::{Link, LinkHelper},
|
linked_list::{Link, LinkHelper},
|
||||||
LinkHelperImpl,
|
LinkHelperImpl,
|
||||||
|
@ -3,7 +3,7 @@ use super::{
|
|||||||
Cap, KernelObject,
|
Cap, KernelObject,
|
||||||
};
|
};
|
||||||
use crate::arch::layout::mmap_phys_to_virt;
|
use crate::arch::layout::mmap_phys_to_virt;
|
||||||
use api::{cap::ObjectType, error::CapFault};
|
use uapi::{cap::ObjectType, error::CapFault};
|
||||||
use utils::MASK;
|
use utils::MASK;
|
||||||
use vspace::addr::{AddressOps, PhysAddr};
|
use vspace::addr::{AddressOps, PhysAddr};
|
||||||
|
|
||||||
|
@ -14,12 +14,12 @@
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use api::{
|
use cap::CapEntry;
|
||||||
|
use core::{marker::PhantomData, ptr::NonNull};
|
||||||
|
use uapi::{
|
||||||
cap::ObjectType,
|
cap::ObjectType,
|
||||||
error::{SysError, SysResult},
|
error::{SysError, SysResult},
|
||||||
};
|
};
|
||||||
use cap::CapEntry;
|
|
||||||
use core::{marker::PhantomData, ptr::NonNull};
|
|
||||||
|
|
||||||
pub mod cap;
|
pub mod cap;
|
||||||
pub mod cnode;
|
pub mod cnode;
|
||||||
@ -51,7 +51,7 @@ impl<'a, T: KernelObject + ?Sized> TryFrom<&'a CapEntry> for Cap<'a, T> {
|
|||||||
|
|
||||||
impl<'a, T: KernelObject + ?Sized> Cap<'a, T> {
|
impl<'a, T: KernelObject + ?Sized> Cap<'a, T> {
|
||||||
pub fn append(&mut self, new: &mut CapEntry) {
|
pub fn append(&mut self, new: &mut CapEntry) {
|
||||||
let next = self.cte.link.next();
|
let next = self.cte.link.next_raw();
|
||||||
|
|
||||||
// update new cap's link
|
// update new cap's link
|
||||||
new.link.set_prev(Some(NonNull::from(self.cte)));
|
new.link.set_prev(Some(NonNull::from(self.cte)));
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
use super::cap::RawCap;
|
use super::cap::RawCap;
|
||||||
use super::{Cap, KernelObject};
|
use super::{Cap, KernelObject};
|
||||||
use api::cap::ObjectType;
|
use uapi::cap::ObjectType;
|
||||||
use vspace::addr::PhysAddr;
|
use vspace::addr::PhysAddr;
|
||||||
|
|
||||||
/// NullObject is used as empty (capability) slot
|
/// NullObject is used as empty (capability) slot
|
||||||
|
@ -2,8 +2,8 @@ use super::cap::RawCap;
|
|||||||
use super::cnode::{CNodeCap, CNodeObject};
|
use super::cnode::{CNodeCap, CNodeObject};
|
||||||
use super::null::NullCap;
|
use super::null::NullCap;
|
||||||
use super::{Cap, KernelObject};
|
use super::{Cap, KernelObject};
|
||||||
use api::cap::ObjectType;
|
use uapi::cap::ObjectType;
|
||||||
use api::error::{SysError, SysResult};
|
use uapi::error::{SysError, SysResult};
|
||||||
use utils::then::Then;
|
use utils::then::Then;
|
||||||
use utils::MASK;
|
use utils::MASK;
|
||||||
use vspace::addr::{align_up, PhysAddr};
|
use vspace::addr::{align_up, PhysAddr};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "api"
|
name = "uapi"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user