diff --git a/Cargo.lock b/Cargo.lock index 4bb8681..dbb4da4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -72,24 +72,31 @@ dependencies = [ "cfg-if", "cortex-a", "fdt-rs", + "libsys", "memfs", - "syscall", "tock-registers", "vfs", ] +[[package]] +name = "libsys" +version = "0.1.0" +dependencies = [ + "bitflags", +] + [[package]] name = "libusr" version = "0.1.0" dependencies = [ - "syscall", + "libsys", ] [[package]] name = "memfs" version = "0.1.0" dependencies = [ - "syscall", + "libsys", "vfs", ] @@ -185,13 +192,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "syscall" -version = "0.1.0" -dependencies = [ - "bitflags", -] - [[package]] name = "tock-registers" version = "0.7.0" @@ -221,5 +221,5 @@ dependencies = [ name = "vfs" version = "0.1.0" dependencies = [ - "syscall", + "libsys", ] diff --git a/Cargo.toml b/Cargo.toml index e3c8c4b..3187e18 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -12,7 +12,7 @@ members = [ "fs/vfs", "fs/memfs", "fs/fat32", - "syscall", + "libsys", "kernel", "libusr", "user", diff --git a/fs/memfs/Cargo.toml b/fs/memfs/Cargo.toml index a2d5267..0ee1a70 100644 --- a/fs/memfs/Cargo.toml +++ b/fs/memfs/Cargo.toml @@ -7,7 +7,7 @@ edition = "2021" [dependencies] vfs = { path = "../vfs" } -syscall = { path = "../../syscall" } +libsys = { path = "../../libsys" } [features] cow = [] diff --git a/fs/memfs/src/block.rs b/fs/memfs/src/block.rs index 5e46ef4..64241c9 100644 --- a/fs/memfs/src/block.rs +++ b/fs/memfs/src/block.rs @@ -1,6 +1,6 @@ use core::mem::{size_of, MaybeUninit}; use core::ops::{Deref, DerefMut}; -use syscall::error::Errno; +use libsys::error::Errno; pub const SIZE: usize = 4096; pub const ENTRY_COUNT: usize = SIZE / size_of::(); diff --git a/fs/memfs/src/bvec.rs b/fs/memfs/src/bvec.rs index 366c370..030daaa 100644 --- a/fs/memfs/src/bvec.rs +++ b/fs/memfs/src/bvec.rs @@ -2,7 +2,7 @@ use crate::{block, BlockAllocator, BlockRef}; use core::cmp::min; use core::mem::MaybeUninit; use core::ops::{Index, IndexMut}; -use syscall::error::Errno; +use libsys::error::Errno; const L0_BLOCKS: usize = 32; // 128K const L1_BLOCKS: usize = 8; // 16M diff --git a/fs/memfs/src/dir.rs b/fs/memfs/src/dir.rs index 0567757..4ee24e5 100644 --- a/fs/memfs/src/dir.rs +++ b/fs/memfs/src/dir.rs @@ -1,6 +1,6 @@ use crate::{BlockAllocator, Bvec, FileInode}; use alloc::boxed::Box; -use syscall::error::Errno; +use libsys::error::Errno; use vfs::{IoctlCmd, OpenFlags, Stat, Vnode, VnodeImpl, VnodeKind, VnodeRef}; pub struct DirInode { diff --git a/fs/memfs/src/file.rs b/fs/memfs/src/file.rs index 1bfb297..639155b 100644 --- a/fs/memfs/src/file.rs +++ b/fs/memfs/src/file.rs @@ -1,5 +1,5 @@ use crate::{BlockAllocator, Bvec}; -use syscall::error::Errno; +use libsys::error::Errno; use vfs::{OpenFlags, Stat, VnodeImpl, VnodeKind, VnodeRef, IoctlCmd}; pub struct FileInode<'a, A: BlockAllocator + Copy + 'static> { diff --git a/fs/memfs/src/lib.rs b/fs/memfs/src/lib.rs index 42e02d2..5529c34 100644 --- a/fs/memfs/src/lib.rs +++ b/fs/memfs/src/lib.rs @@ -14,7 +14,7 @@ extern crate std; use alloc::{boxed::Box, rc::Rc}; use core::any::Any; use core::cell::{Ref, RefCell}; -use syscall::{ +use libsys::{ error::Errno, path::{path_component_right, path_component_left} }; diff --git a/fs/memfs/src/tar.rs b/fs/memfs/src/tar.rs index 3fe7fb3..4f4984c 100644 --- a/fs/memfs/src/tar.rs +++ b/fs/memfs/src/tar.rs @@ -1,4 +1,4 @@ -use syscall::error::Errno; +use libsys::error::Errno; use vfs::VnodeKind; #[repr(packed)] diff --git a/fs/vfs/Cargo.toml b/fs/vfs/Cargo.toml index e754bc3..d05ed41 100644 --- a/fs/vfs/Cargo.toml +++ b/fs/vfs/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -syscall = { path = "../../syscall" } +libsys = { path = "../../libsys" } diff --git a/fs/vfs/src/block.rs b/fs/vfs/src/block.rs index 8092a62..9e630fd 100644 --- a/fs/vfs/src/block.rs +++ b/fs/vfs/src/block.rs @@ -1,4 +1,4 @@ -use syscall::error::Errno; +use libsys::error::Errno; /// Block device interface pub trait BlockDevice { diff --git a/fs/vfs/src/char.rs b/fs/vfs/src/char.rs index aeebdd8..7eae7de 100644 --- a/fs/vfs/src/char.rs +++ b/fs/vfs/src/char.rs @@ -1,5 +1,5 @@ use crate::{OpenFlags, Stat, VnodeImpl, VnodeKind, VnodeRef, IoctlCmd}; -use syscall::error::Errno; +use libsys::error::Errno; /// Generic character device trait pub trait CharDevice { diff --git a/fs/vfs/src/file.rs b/fs/vfs/src/file.rs index cf30f76..af6bf77 100644 --- a/fs/vfs/src/file.rs +++ b/fs/vfs/src/file.rs @@ -2,7 +2,7 @@ use crate::{VnodeKind, VnodeRef}; use alloc::rc::Rc; use core::cell::RefCell; use core::cmp::min; -use syscall::{ +use libsys::{ traits::{Read, Seek, SeekDir, Write}, error::Errno }; diff --git a/fs/vfs/src/fs.rs b/fs/vfs/src/fs.rs index dcb96b5..a086b10 100644 --- a/fs/vfs/src/fs.rs +++ b/fs/vfs/src/fs.rs @@ -2,7 +2,7 @@ use crate::{BlockDevice, VnodeRef}; use alloc::rc::Rc; use core::any::Any; use core::cell::Ref; -use syscall::error::Errno; +use libsys::error::Errno; /// General filesystem interface pub trait Filesystem { diff --git a/fs/vfs/src/ioctx.rs b/fs/vfs/src/ioctx.rs index 5095186..2980d20 100644 --- a/fs/vfs/src/ioctx.rs +++ b/fs/vfs/src/ioctx.rs @@ -1,5 +1,5 @@ use crate::{FileMode, FileRef, OpenFlags, VnodeKind, VnodeRef}; -use syscall::{ +use libsys::{ error::Errno, path::{path_component_left, path_component_right} }; diff --git a/fs/vfs/src/lib.rs b/fs/vfs/src/lib.rs index d02b0f4..c8a74fe 100644 --- a/fs/vfs/src/lib.rs +++ b/fs/vfs/src/lib.rs @@ -9,8 +9,8 @@ extern crate std; extern crate alloc; -pub use syscall::stat::{FileMode, OpenFlags, Stat}; -pub use syscall::ioctl::IoctlCmd; +pub use libsys::stat::{FileMode, OpenFlags, Stat}; +pub use libsys::ioctl::IoctlCmd; mod block; pub use block::BlockDevice; diff --git a/fs/vfs/src/node.rs b/fs/vfs/src/node.rs index e3c4608..8df4eee 100644 --- a/fs/vfs/src/node.rs +++ b/fs/vfs/src/node.rs @@ -2,7 +2,7 @@ use crate::{File, FileMode, FileRef, Filesystem, IoctlCmd, OpenFlags, Stat}; use alloc::{borrow::ToOwned, boxed::Box, rc::Rc, string::String, vec::Vec}; use core::cell::{RefCell, RefMut}; use core::fmt; -use syscall::error::Errno; +use libsys::error::Errno; /// Convenience type alias for [Rc] pub type VnodeRef = Rc; diff --git a/kernel/Cargo.toml b/kernel/Cargo.toml index 8f4b9a8..da46004 100644 --- a/kernel/Cargo.toml +++ b/kernel/Cargo.toml @@ -12,7 +12,7 @@ test = false [dependencies] vfs = { path = "../fs/vfs" } memfs = { path = "../fs/memfs" } -syscall = { path = "../syscall" } +libsys = { path = "../libsys" } cfg-if = "1.x.x" tock-registers = "0.7.x" fdt-rs = { version = "0.x.x", default-features = false } diff --git a/kernel/src/arch/aarch64/boot/mod.rs b/kernel/src/arch/aarch64/boot/mod.rs index 898d481..0c054a2 100644 --- a/kernel/src/arch/aarch64/boot/mod.rs +++ b/kernel/src/arch/aarch64/boot/mod.rs @@ -11,7 +11,7 @@ use crate::dev::{ Device, }; use crate::fs::devfs; -use syscall::error::Errno; +use libsys::error::Errno; //use crate::debug::Level; use crate::mem::{ self, heap, diff --git a/kernel/src/arch/aarch64/exception.rs b/kernel/src/arch/aarch64/exception.rs index 7be2b26..2a3e0d5 100644 --- a/kernel/src/arch/aarch64/exception.rs +++ b/kernel/src/arch/aarch64/exception.rs @@ -3,11 +3,11 @@ use crate::arch::machine; use crate::debug::Level; use crate::dev::irq::{IntController, IrqContext}; -use crate::proc::{sched, Process}; use crate::mem; +use crate::proc::{sched, Process}; use crate::syscall; -use ::syscall::abi; use cortex_a::registers::{ESR_EL1, FAR_EL1}; +use libsys::abi; use tock_registers::interfaces::Readable; /// Trapped SIMD/FP functionality diff --git a/kernel/src/arch/aarch64/irq/gic/mod.rs b/kernel/src/arch/aarch64/irq/gic/mod.rs index b4b40a9..c2c39c8 100644 --- a/kernel/src/arch/aarch64/irq/gic/mod.rs +++ b/kernel/src/arch/aarch64/irq/gic/mod.rs @@ -7,7 +7,7 @@ use crate::dev::{ use crate::mem::virt::{DeviceMemory, DeviceMemoryIo}; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; mod gicc; use gicc::Gicc; diff --git a/kernel/src/arch/aarch64/mach_orangepi3/gpio.rs b/kernel/src/arch/aarch64/mach_orangepi3/gpio.rs index 6ff7577..0fb90e7 100644 --- a/kernel/src/arch/aarch64/mach_orangepi3/gpio.rs +++ b/kernel/src/arch/aarch64/mach_orangepi3/gpio.rs @@ -12,7 +12,7 @@ use crate::dev::{ use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::register_structs; use tock_registers::registers::ReadWrite; diff --git a/kernel/src/arch/aarch64/mach_orangepi3/mod.rs b/kernel/src/arch/aarch64/mach_orangepi3/mod.rs index 66113c7..6d1d347 100644 --- a/kernel/src/arch/aarch64/mach_orangepi3/mod.rs +++ b/kernel/src/arch/aarch64/mach_orangepi3/mod.rs @@ -13,7 +13,7 @@ use crate::dev::{ }; use crate::fs::devfs::{self, CharDeviceType}; use crate::mem::phys; -use syscall::error::Errno; +use libsys::error::Errno; mod gpio; mod rtc; diff --git a/kernel/src/arch/aarch64/mach_orangepi3/rtc.rs b/kernel/src/arch/aarch64/mach_orangepi3/rtc.rs index 5a13f5f..e65b85b 100644 --- a/kernel/src/arch/aarch64/mach_orangepi3/rtc.rs +++ b/kernel/src/arch/aarch64/mach_orangepi3/rtc.rs @@ -7,7 +7,7 @@ use crate::dev::{ use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::{ interfaces::{Readable, Writeable}, register_bitfields, register_structs, diff --git a/kernel/src/arch/aarch64/mach_orangepi3/uart.rs b/kernel/src/arch/aarch64/mach_orangepi3/uart.rs index 3c0bce2..147444f 100644 --- a/kernel/src/arch/aarch64/mach_orangepi3/uart.rs +++ b/kernel/src/arch/aarch64/mach_orangepi3/uart.rs @@ -8,7 +8,7 @@ use crate::dev::{ use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::registers::{Aliased, ReadOnly, ReadWrite}; use tock_registers::{register_bitfields, register_structs}; diff --git a/kernel/src/arch/aarch64/mach_orangepi3/wdog.rs b/kernel/src/arch/aarch64/mach_orangepi3/wdog.rs index 5ae7ecd..5178b9d 100644 --- a/kernel/src/arch/aarch64/mach_orangepi3/wdog.rs +++ b/kernel/src/arch/aarch64/mach_orangepi3/wdog.rs @@ -2,7 +2,7 @@ use crate::dev::Device; use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::{ interfaces::Writeable, register_bitfields, register_structs, registers::ReadWrite, }; diff --git a/kernel/src/arch/aarch64/mach_qemu/mod.rs b/kernel/src/arch/aarch64/mach_qemu/mod.rs index c8a2389..fdeb445 100644 --- a/kernel/src/arch/aarch64/mach_qemu/mod.rs +++ b/kernel/src/arch/aarch64/mach_qemu/mod.rs @@ -13,7 +13,7 @@ use crate::dev::{ }; use crate::fs::devfs::{self, CharDeviceType}; use crate::mem::phys; -use syscall::error::Errno; +use libsys::error::Errno; pub use gic::IrqNumber; diff --git a/kernel/src/arch/aarch64/mach_rpi3/emmc.rs b/kernel/src/arch/aarch64/mach_rpi3/emmc.rs index 75bc25d..68119ea 100644 --- a/kernel/src/arch/aarch64/mach_rpi3/emmc.rs +++ b/kernel/src/arch/aarch64/mach_rpi3/emmc.rs @@ -7,7 +7,7 @@ use crate::dev::Device; use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::{ReadWriteable, Readable, Writeable}; use tock_registers::registers::{ReadOnly, ReadWrite}; use tock_registers::{register_bitfields, register_structs}; diff --git a/kernel/src/arch/aarch64/mach_rpi3/irqchip.rs b/kernel/src/arch/aarch64/mach_rpi3/irqchip.rs index deab40a..dbb903f 100644 --- a/kernel/src/arch/aarch64/mach_rpi3/irqchip.rs +++ b/kernel/src/arch/aarch64/mach_rpi3/irqchip.rs @@ -7,7 +7,7 @@ use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; use core::fmt; use cortex_a::registers::MPIDR_EL1; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::register_structs; diff --git a/kernel/src/arch/aarch64/mach_rpi3/mailbox.rs b/kernel/src/arch/aarch64/mach_rpi3/mailbox.rs index 94b9f5b..359b6d2 100644 --- a/kernel/src/arch/aarch64/mach_rpi3/mailbox.rs +++ b/kernel/src/arch/aarch64/mach_rpi3/mailbox.rs @@ -2,7 +2,7 @@ use crate::dev::Device; use crate::mem::{self, virt::DeviceMemoryIo}; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::{Readable, Writeable}; use tock_registers::registers::{ReadOnly, WriteOnly}; diff --git a/kernel/src/arch/aarch64/mach_rpi3/mod.rs b/kernel/src/arch/aarch64/mach_rpi3/mod.rs index fabb2e4..a7c6d79 100644 --- a/kernel/src/arch/aarch64/mach_rpi3/mod.rs +++ b/kernel/src/arch/aarch64/mach_rpi3/mod.rs @@ -5,7 +5,7 @@ use crate::dev::{ Device, }; use crate::mem::phys; -use syscall::error::Errno; +use libsys::error::Errno; pub mod irqchip; pub use irqchip::{Bcm283xIrqchip, IrqNumber}; diff --git a/kernel/src/arch/aarch64/timer.rs b/kernel/src/arch/aarch64/timer.rs index 583a93a..f88a682 100644 --- a/kernel/src/arch/aarch64/timer.rs +++ b/kernel/src/arch/aarch64/timer.rs @@ -8,7 +8,7 @@ use crate::dev::{ }; use core::time::Duration; use cortex_a::registers::{CNTFRQ_EL0, CNTPCT_EL0, CNTP_CTL_EL0, CNTP_TVAL_EL0}; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::{Readable, Writeable}; /// Generic timer struct diff --git a/kernel/src/dev/fdt.rs b/kernel/src/dev/fdt.rs index d515323..77eca43 100644 --- a/kernel/src/dev/fdt.rs +++ b/kernel/src/dev/fdt.rs @@ -5,7 +5,7 @@ use fdt_rs::{ base::DevTree, index::{DevTreeIndex, DevTreeIndexNode, DevTreeIndexProp}, }; -use syscall::{error::Errno, path::path_component_left}; +use libsys::{error::Errno, path::path_component_left}; #[repr(align(16))] struct Wrap { diff --git a/kernel/src/dev/gpio.rs b/kernel/src/dev/gpio.rs index e21670f..d79072b 100644 --- a/kernel/src/dev/gpio.rs +++ b/kernel/src/dev/gpio.rs @@ -1,7 +1,7 @@ //! GPIO and pin control interfaces use crate::dev::Device; -use syscall::error::Errno; +use libsys::error::Errno; /// Pin function mode pub enum PinMode { diff --git a/kernel/src/dev/irq.rs b/kernel/src/dev/irq.rs index 234c143..a32476c 100644 --- a/kernel/src/dev/irq.rs +++ b/kernel/src/dev/irq.rs @@ -1,7 +1,7 @@ //! Interrupt controller and handler interfaces use crate::dev::Device; use core::marker::PhantomData; -use syscall::error::Errno; +use libsys::error::Errno; /// Token to indicate the local core is running in IRQ context pub struct IrqContext<'irq_context> { diff --git a/kernel/src/dev/mod.rs b/kernel/src/dev/mod.rs index 82c173e..fdaf7a8 100644 --- a/kernel/src/dev/mod.rs +++ b/kernel/src/dev/mod.rs @@ -1,6 +1,6 @@ //! Module for device interfaces and drivers -use syscall::error::Errno; +use libsys::error::Errno; // Device classes pub mod fdt; diff --git a/kernel/src/dev/pci/mod.rs b/kernel/src/dev/pci/mod.rs index cddfa7e..922cbb1 100644 --- a/kernel/src/dev/pci/mod.rs +++ b/kernel/src/dev/pci/mod.rs @@ -2,7 +2,7 @@ use crate::dev::Device; use core::fmt; -use syscall::error::Errno; +use libsys::error::Errno; pub mod pcie; diff --git a/kernel/src/dev/pci/pcie/gpex.rs b/kernel/src/dev/pci/pcie/gpex.rs index 9ea5169..c988aab 100644 --- a/kernel/src/dev/pci/pcie/gpex.rs +++ b/kernel/src/dev/pci/pcie/gpex.rs @@ -6,7 +6,7 @@ use crate::dev::{ }; use crate::mem::virt::DeviceMemory; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; /// GPEX host controller struct pub struct GenericPcieHost { diff --git a/kernel/src/dev/rtc/pl031.rs b/kernel/src/dev/rtc/pl031.rs index b4eddef..429c5ca 100644 --- a/kernel/src/dev/rtc/pl031.rs +++ b/kernel/src/dev/rtc/pl031.rs @@ -8,7 +8,7 @@ use crate::dev::{ use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::{ interfaces::{ReadWriteable, Readable, Writeable}, register_bitfields, register_structs, diff --git a/kernel/src/dev/sd.rs b/kernel/src/dev/sd.rs index 5946843..b5cdd04 100644 --- a/kernel/src/dev/sd.rs +++ b/kernel/src/dev/sd.rs @@ -1,6 +1,6 @@ //! SD host controller interface and card operation facilities use crate::dev::Device; -use syscall::error::Errno; +use libsys::error::Errno; use vfs::BlockDevice; /// Generic SD/MMC host controller interface diff --git a/kernel/src/dev/serial/mod.rs b/kernel/src/dev/serial/mod.rs index a11495e..ed7f120 100644 --- a/kernel/src/dev/serial/mod.rs +++ b/kernel/src/dev/serial/mod.rs @@ -1,7 +1,7 @@ //! Module for serial device drivers use crate::dev::Device; -use syscall::error::Errno; +use libsys::error::Errno; #[cfg(feature = "pl011")] pub mod pl011; diff --git a/kernel/src/dev/serial/pl011.rs b/kernel/src/dev/serial/pl011.rs index 791aa6c..27be9db 100644 --- a/kernel/src/dev/serial/pl011.rs +++ b/kernel/src/dev/serial/pl011.rs @@ -11,7 +11,7 @@ use crate::mem::virt::DeviceMemoryIo; use crate::sync::IrqSafeSpinLock; use crate::util::InitOnce; use core::fmt; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::{ interfaces::{ReadWriteable, Readable, Writeable}, register_bitfields, register_structs, diff --git a/kernel/src/dev/timer.rs b/kernel/src/dev/timer.rs index 14efc6b..3d24525 100644 --- a/kernel/src/dev/timer.rs +++ b/kernel/src/dev/timer.rs @@ -2,7 +2,7 @@ use crate::dev::Device; use core::time::Duration; -use syscall::error::Errno; +use libsys::error::Errno; /// Interface for generic timestamp source pub trait TimestampSource: Device { diff --git a/kernel/src/dev/tty.rs b/kernel/src/dev/tty.rs index ba1e8d6..56d2775 100644 --- a/kernel/src/dev/tty.rs +++ b/kernel/src/dev/tty.rs @@ -2,8 +2,8 @@ use crate::dev::serial::SerialDevice; use crate::proc::wait::Wait; use crate::sync::IrqSafeSpinLock; -use syscall::error::Errno; -use syscall::{ +use libsys::error::Errno; +use libsys::{ termios::{Termios, TermiosIflag, TermiosLflag, TermiosOflag}, ioctl::IoctlCmd }; diff --git a/kernel/src/fs/devfs.rs b/kernel/src/fs/devfs.rs index 5394e9e..6a65421 100644 --- a/kernel/src/fs/devfs.rs +++ b/kernel/src/fs/devfs.rs @@ -2,7 +2,7 @@ use crate::util::InitOnce; use alloc::boxed::Box; use core::sync::atomic::{AtomicUsize, Ordering}; -use syscall::error::Errno; +use libsys::error::Errno; use vfs::{CharDevice, CharDeviceWrapper, Vnode, VnodeKind, VnodeRef}; /// Possible character device kinds diff --git a/kernel/src/mem/phys/manager.rs b/kernel/src/mem/phys/manager.rs index 1afe715..a2ffbd1 100644 --- a/kernel/src/mem/phys/manager.rs +++ b/kernel/src/mem/phys/manager.rs @@ -2,7 +2,7 @@ use super::{PageInfo, PageUsage}; use crate::mem::{virtualize, PAGE_SIZE}; use crate::sync::IrqSafeSpinLock; use core::mem; -use syscall::{ +use libsys::{ error::Errno, mem::{memset, memcpy} }; diff --git a/kernel/src/mem/phys/mod.rs b/kernel/src/mem/phys/mod.rs index 4d95b57..6e1d300 100644 --- a/kernel/src/mem/phys/mod.rs +++ b/kernel/src/mem/phys/mod.rs @@ -3,7 +3,7 @@ use crate::config::{ConfigKey, CONFIG}; use crate::mem::PAGE_SIZE; use core::mem::size_of; -use syscall::error::Errno; +use libsys::error::Errno; mod manager; mod reserved; diff --git a/kernel/src/mem/virt/fixed.rs b/kernel/src/mem/virt/fixed.rs index 01cc7c6..5275576 100644 --- a/kernel/src/mem/virt/fixed.rs +++ b/kernel/src/mem/virt/fixed.rs @@ -5,7 +5,7 @@ use crate::mem::{ virt::{Entry, MapAttributes, Table}, }; use cortex_a::asm::barrier::{self, dsb, isb}; -use syscall::error::Errno; +use libsys::error::Errno; const DEVICE_MAP_OFFSET: usize = mem::KERNEL_OFFSET + (256usize << 30); diff --git a/kernel/src/mem/virt/mod.rs b/kernel/src/mem/virt/mod.rs index 0dade9a..5e879e5 100644 --- a/kernel/src/mem/virt/mod.rs +++ b/kernel/src/mem/virt/mod.rs @@ -4,7 +4,7 @@ use core::marker::PhantomData; use core::ops::Deref; use cortex_a::asm::barrier::{self, dsb, isb}; use cortex_a::registers::TTBR0_EL1; -use syscall::error::Errno; +use libsys::error::Errno; use tock_registers::interfaces::Writeable; pub mod table; diff --git a/kernel/src/mem/virt/table.rs b/kernel/src/mem/virt/table.rs index 4c4ba20..d686fa7 100644 --- a/kernel/src/mem/virt/table.rs +++ b/kernel/src/mem/virt/table.rs @@ -5,7 +5,7 @@ use crate::mem::{ phys::{self, PageUsage}, }; use core::ops::{Index, IndexMut}; -use syscall::{error::Errno, mem::memset}; +use libsys::{error::Errno, mem::memset}; /// Transparent wrapper structure representing a single /// translation table entry diff --git a/kernel/src/proc/elf.rs b/kernel/src/proc/elf.rs index 4075ac9..cfe3125 100644 --- a/kernel/src/proc/elf.rs +++ b/kernel/src/proc/elf.rs @@ -5,7 +5,7 @@ use crate::mem::{ virt::{MapAttributes, Space}, }; use core::mem::{size_of, MaybeUninit}; -use syscall::{ +use libsys::{ error::Errno, traits::{Read, Seek, SeekDir} }; diff --git a/kernel/src/proc/io.rs b/kernel/src/proc/io.rs index 2b97960..2b44c5e 100644 --- a/kernel/src/proc/io.rs +++ b/kernel/src/proc/io.rs @@ -1,6 +1,6 @@ //! Process file descriptors and I/O context use alloc::collections::BTreeMap; -use syscall::error::Errno; +use libsys::error::Errno; use vfs::{FileRef, Ioctx}; /// Process I/O context. Contains file tables, root/cwd info etc. diff --git a/kernel/src/proc/process.rs b/kernel/src/proc/process.rs index 02acc22..8a667cb 100644 --- a/kernel/src/proc/process.rs +++ b/kernel/src/proc/process.rs @@ -11,7 +11,7 @@ use alloc::rc::Rc; use core::cell::UnsafeCell; use core::fmt; use core::sync::atomic::{AtomicU32, Ordering}; -use syscall::error::Errno; +use libsys::error::Errno; pub use crate::arch::platform::context::{self, Context}; diff --git a/kernel/src/proc/wait.rs b/kernel/src/proc/wait.rs index c40783c..52d9d37 100644 --- a/kernel/src/proc/wait.rs +++ b/kernel/src/proc/wait.rs @@ -6,7 +6,7 @@ use crate::proc::{self, sched::SCHED, Pid, Process}; use crate::sync::IrqSafeSpinLock; use alloc::collections::LinkedList; use core::time::Duration; -use syscall::error::Errno; +use libsys::error::Errno; /// Wait channel structure. Contains a queue of processes /// waiting for some event to happen. diff --git a/kernel/src/syscall/arg.rs b/kernel/src/syscall/arg.rs index 9b0715c..61108b8 100644 --- a/kernel/src/syscall/arg.rs +++ b/kernel/src/syscall/arg.rs @@ -2,7 +2,7 @@ use crate::mem; use core::mem::size_of; -use syscall::error::Errno; +use libsys::error::Errno; fn translate(virt: usize) -> Option { let mut res: usize; diff --git a/kernel/src/syscall/mod.rs b/kernel/src/syscall/mod.rs index 234c6a5..cb7f880 100644 --- a/kernel/src/syscall/mod.rs +++ b/kernel/src/syscall/mod.rs @@ -6,7 +6,7 @@ use crate::proc::{elf, wait, Pid, Process, ProcessIo}; use core::mem::size_of; use core::ops::DerefMut; use core::time::Duration; -use syscall::{ +use libsys::{ abi, error::Errno, stat::{AT_EMPTY_PATH, AT_FDCWD}, diff --git a/syscall/Cargo.toml b/libsys/Cargo.toml similarity index 92% rename from syscall/Cargo.toml rename to libsys/Cargo.toml index 878f881..1524b9c 100644 --- a/syscall/Cargo.toml +++ b/libsys/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "syscall" +name = "libsys" version = "0.1.0" edition = "2021" diff --git a/syscall/src/abi.rs b/libsys/src/abi.rs similarity index 100% rename from syscall/src/abi.rs rename to libsys/src/abi.rs diff --git a/syscall/src/calls.rs b/libsys/src/calls.rs similarity index 100% rename from syscall/src/calls.rs rename to libsys/src/calls.rs diff --git a/syscall/src/error.rs b/libsys/src/error.rs similarity index 100% rename from syscall/src/error.rs rename to libsys/src/error.rs diff --git a/syscall/src/ioctl.rs b/libsys/src/ioctl.rs similarity index 100% rename from syscall/src/ioctl.rs rename to libsys/src/ioctl.rs diff --git a/syscall/src/lib.rs b/libsys/src/lib.rs similarity index 100% rename from syscall/src/lib.rs rename to libsys/src/lib.rs diff --git a/syscall/src/mem.rs b/libsys/src/mem.rs similarity index 100% rename from syscall/src/mem.rs rename to libsys/src/mem.rs diff --git a/syscall/src/path.rs b/libsys/src/path.rs similarity index 100% rename from syscall/src/path.rs rename to libsys/src/path.rs diff --git a/syscall/src/stat.rs b/libsys/src/stat.rs similarity index 100% rename from syscall/src/stat.rs rename to libsys/src/stat.rs diff --git a/syscall/src/termios.rs b/libsys/src/termios.rs similarity index 100% rename from syscall/src/termios.rs rename to libsys/src/termios.rs diff --git a/syscall/src/traits.rs b/libsys/src/traits.rs similarity index 100% rename from syscall/src/traits.rs rename to libsys/src/traits.rs diff --git a/libusr/Cargo.toml b/libusr/Cargo.toml index 26a72d1..0b91506 100644 --- a/libusr/Cargo.toml +++ b/libusr/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -syscall = { path = "../syscall", features = ["user"] } +libsys = { path = "../libsys", features = ["user"] } diff --git a/libusr/src/io.rs b/libusr/src/io.rs index 5968513..c98712c 100644 --- a/libusr/src/io.rs +++ b/libusr/src/io.rs @@ -1,5 +1,5 @@ use core::fmt; -use syscall::{ +use libsys::{ calls::{sys_fstatat, sys_write}, stat::{Stat, AT_FDCWD}, }; diff --git a/libusr/src/lib.rs b/libusr/src/lib.rs index f5e6993..bff9503 100644 --- a/libusr/src/lib.rs +++ b/libusr/src/lib.rs @@ -7,9 +7,9 @@ pub mod io; pub mod os; pub mod sys { - pub use syscall::calls::*; - pub use syscall::stat::{self, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO}; - pub use syscall::termios; + pub use libsys::calls::*; + pub use libsys::stat::{self, STDERR_FILENO, STDIN_FILENO, STDOUT_FILENO}; + pub use libsys::termios; } #[link_section = ".text._start"] diff --git a/libusr/src/os.rs b/libusr/src/os.rs index 76058da..bd75771 100644 --- a/libusr/src/os.rs +++ b/libusr/src/os.rs @@ -1,7 +1,7 @@ use crate::sys; use core::fmt; use core::mem::{size_of, MaybeUninit}; -use syscall::{ioctl::IoctlCmd, termios::Termios}; +use libsys::{ioctl::IoctlCmd, termios::Termios}; pub fn get_tty_attrs(fd: u32) -> Result { let mut termios = MaybeUninit::::uninit();