refactor: rename syscall to libsys
This commit is contained in:
Generated
+11
-11
@@ -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",
|
||||
]
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ members = [
|
||||
"fs/vfs",
|
||||
"fs/memfs",
|
||||
"fs/fat32",
|
||||
"syscall",
|
||||
"libsys",
|
||||
"kernel",
|
||||
"libusr",
|
||||
"user",
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@ edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
vfs = { path = "../vfs" }
|
||||
syscall = { path = "../../syscall" }
|
||||
libsys = { path = "../../libsys" }
|
||||
|
||||
[features]
|
||||
cow = []
|
||||
|
||||
@@ -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::<usize>();
|
||||
|
||||
@@ -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
|
||||
|
||||
+1
-1
@@ -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<A: BlockAllocator + Copy + 'static> {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
+1
-1
@@ -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}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
use syscall::error::Errno;
|
||||
use libsys::error::Errno;
|
||||
use vfs::VnodeKind;
|
||||
|
||||
#[repr(packed)]
|
||||
|
||||
+1
-1
@@ -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" }
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
use syscall::error::Errno;
|
||||
use libsys::error::Errno;
|
||||
|
||||
/// Block device interface
|
||||
pub trait BlockDevice {
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+1
-1
@@ -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
|
||||
};
|
||||
|
||||
+1
-1
@@ -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 {
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
use crate::{FileMode, FileRef, OpenFlags, VnodeKind, VnodeRef};
|
||||
use syscall::{
|
||||
use libsys::{
|
||||
error::Errno,
|
||||
path::{path_component_left, path_component_right}
|
||||
};
|
||||
|
||||
+2
-2
@@ -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;
|
||||
|
||||
+1
-1
@@ -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<Vnode>]
|
||||
pub type VnodeRef = Rc<Vnode>;
|
||||
|
||||
+1
-1
@@ -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 }
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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,
|
||||
};
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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> {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Module for device interfaces and drivers
|
||||
|
||||
use syscall::error::Errno;
|
||||
use libsys::error::Errno;
|
||||
|
||||
// Device classes
|
||||
pub mod fdt;
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
use crate::dev::Device;
|
||||
use core::fmt;
|
||||
use syscall::error::Errno;
|
||||
use libsys::error::Errno;
|
||||
|
||||
pub mod pcie;
|
||||
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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}
|
||||
};
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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};
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
@@ -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<usize> {
|
||||
let mut res: usize;
|
||||
|
||||
@@ -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},
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
[package]
|
||||
name = "syscall"
|
||||
name = "libsys"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
+1
-1
@@ -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"] }
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
use core::fmt;
|
||||
use syscall::{
|
||||
use libsys::{
|
||||
calls::{sys_fstatat, sys_write},
|
||||
stat::{Stat, AT_FDCWD},
|
||||
};
|
||||
|
||||
+3
-3
@@ -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"]
|
||||
|
||||
+1
-1
@@ -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<Termios, &'static str> {
|
||||
let mut termios = MaybeUninit::<Termios>::uninit();
|
||||
|
||||
Reference in New Issue
Block a user