Rename crates from jinux-* to aster-*

This commit is contained in:
Jianfeng Jiang
2023-12-25 03:12:25 +00:00
committed by Tate, Hongliang Tian
parent 6dbf5d560d
commit 93781df27b
460 changed files with 596 additions and 595 deletions

View File

@ -1,8 +1,8 @@
use core::hint::spin_loop;
use alloc::{boxed::Box, string::ToString, sync::Arc};
use jinux_frame::{io_mem::IoMem, sync::SpinLock, trap::TrapFrame};
use jinux_util::safe_ptr::SafePtr;
use aster_frame::{io_mem::IoMem, sync::SpinLock, trap::TrapFrame};
use aster_util::safe_ptr::SafePtr;
use log::info;
use pod::Pod;
@ -97,7 +97,7 @@ impl BlockDevice {
.unwrap();
fn handle_block_device(_: &TrapFrame) {
jinux_block::get_device(super::DEVICE_NAME)
aster_block::get_device(super::DEVICE_NAME)
.unwrap()
.handle_irq();
}
@ -107,7 +107,7 @@ impl BlockDevice {
}
device.transport.finish_init();
jinux_block::register_device(super::DEVICE_NAME.to_string(), Arc::new(device));
aster_block::register_device(super::DEVICE_NAME.to_string(), Arc::new(device));
Ok(())
}
@ -120,7 +120,7 @@ impl BlockDevice {
}
}
impl jinux_block::BlockDevice for BlockDevice {
impl aster_block::BlockDevice for BlockDevice {
fn read_block(&self, block_id: usize, buf: &mut [u8]) {
self.read(block_id, buf);
}

View File

@ -1,9 +1,9 @@
pub mod device;
use aster_frame::io_mem::IoMem;
use aster_util::safe_ptr::SafePtr;
use bitflags::bitflags;
use int_to_c_enum::TryFromInt;
use jinux_frame::io_mem::IoMem;
use jinux_util::safe_ptr::SafePtr;
use pod::Pod;
use crate::transport::VirtioTransport;

View File

@ -1,5 +1,5 @@
use jinux_frame::io_mem::IoMem;
use jinux_util::safe_ptr::SafePtr;
use aster_frame::io_mem::IoMem;
use aster_util::safe_ptr::SafePtr;
use pod::Pod;
use crate::transport::VirtioTransport;

View File

@ -1,9 +1,9 @@
use core::hint::spin_loop;
use alloc::{boxed::Box, fmt::Debug, string::ToString, sync::Arc, vec::Vec};
use jinux_console::{AnyConsoleDevice, ConsoleCallback};
use jinux_frame::{config::PAGE_SIZE, io_mem::IoMem, sync::SpinLock, trap::TrapFrame};
use jinux_util::safe_ptr::SafePtr;
use aster_console::{AnyConsoleDevice, ConsoleCallback};
use aster_frame::{config::PAGE_SIZE, io_mem::IoMem, sync::SpinLock, trap::TrapFrame};
use aster_util::safe_ptr::SafePtr;
use log::debug;
use crate::{
@ -130,14 +130,14 @@ impl ConsoleDevice {
.unwrap();
device.transport.finish_init();
jinux_console::register_device(DEVICE_NAME.to_string(), Arc::new(device));
aster_console::register_device(DEVICE_NAME.to_string(), Arc::new(device));
Ok(())
}
}
fn handle_console_input(_: &TrapFrame) {
jinux_console::get_device(DEVICE_NAME).unwrap().handle_irq();
aster_console::get_device(DEVICE_NAME).unwrap().handle_irq();
}
fn config_space_change(_: &TrapFrame) {

View File

@ -7,9 +7,9 @@ use alloc::{
sync::Arc,
vec::Vec,
};
use aster_frame::{io_mem::IoMem, offset_of, sync::SpinLock, trap::TrapFrame};
use aster_util::{field_ptr, safe_ptr::SafePtr};
use bitflags::bitflags;
use jinux_frame::{io_mem::IoMem, offset_of, sync::SpinLock, trap::TrapFrame};
use jinux_util::{field_ptr, safe_ptr::SafePtr};
use log::{debug, info};
use pod::Pod;
use virtio_input_decoder::{DecodeType, Decoder};
@ -112,7 +112,7 @@ impl InputDevice {
fn handle_input(_: &TrapFrame) {
debug!("Handle Virtio input interrupt");
let device = jinux_input::get_device(super::DEVICE_NAME).unwrap();
let device = aster_input::get_device(super::DEVICE_NAME).unwrap();
device.handle_irq().unwrap();
}
@ -131,7 +131,7 @@ impl InputDevice {
device.transport.finish_init();
jinux_input::register_device(super::DEVICE_NAME.to_string(), Arc::new(device));
aster_input::register_device(super::DEVICE_NAME.to_string(), Arc::new(device));
Ok(())
}
@ -183,7 +183,7 @@ impl InputDevice {
}
}
impl jinux_input::InputDevice for InputDevice {
impl aster_input::InputDevice for InputDevice {
fn handle_irq(&self) -> Option<()> {
// one interrupt may contains serval input, so it should loop
loop {

View File

@ -26,8 +26,8 @@
pub mod device;
use crate::transport::VirtioTransport;
use jinux_frame::io_mem::IoMem;
use jinux_util::safe_ptr::SafePtr;
use aster_frame::io_mem::IoMem;
use aster_util::safe_ptr::SafePtr;
use pod::Pod;
pub static DEVICE_NAME: &str = "Virtio-Input";

View File

@ -1,7 +1,7 @@
use aster_frame::io_mem::IoMem;
use aster_network::EthernetAddr;
use aster_util::safe_ptr::SafePtr;
use bitflags::bitflags;
use jinux_frame::io_mem::IoMem;
use jinux_network::EthernetAddr;
use jinux_util::safe_ptr::SafePtr;
use pod::Pod;
use crate::transport::VirtioTransport;

View File

@ -1,12 +1,12 @@
use core::{fmt::Debug, hint::spin_loop, mem::size_of};
use alloc::{boxed::Box, string::ToString, sync::Arc, vec::Vec};
use jinux_frame::{offset_of, sync::SpinLock, trap::TrapFrame};
use jinux_network::{
use aster_frame::{offset_of, sync::SpinLock, trap::TrapFrame};
use aster_network::{
buffer::{RxBuffer, TxBuffer},
AnyNetworkDevice, EthernetAddr, NetDeviceIrqHandler, VirtioNetError,
};
use jinux_util::{field_ptr, slot_vec::SlotVec};
use aster_util::{field_ptr, slot_vec::SlotVec};
use log::debug;
use pod::Pod;
use smoltcp::phy::{DeviceCapabilities, Medium};
@ -87,7 +87,7 @@ impl NetworkDevice {
/// Interrupt handler if network device receives some packet
fn handle_network_event(_: &TrapFrame) {
jinux_network::handle_recv_irq(super::DEVICE_NAME);
aster_network::handle_recv_irq(super::DEVICE_NAME);
}
device
@ -99,7 +99,7 @@ impl NetworkDevice {
.register_queue_callback(QUEUE_RECV, Box::new(handle_network_event), false)
.unwrap();
jinux_network::register_device(
aster_network::register_device(
super::DEVICE_NAME.to_string(),
Arc::new(SpinLock::new(Box::new(device))),
);

View File

@ -3,18 +3,18 @@
use crate::transport::VirtioTransport;
use alloc::vec::Vec;
use aster_frame::{
io_mem::IoMem,
offset_of,
vm::{DmaCoherent, VmAllocOptions},
};
use aster_rights::{Dup, TRightSet, TRights, Write};
use aster_util::{field_ptr, safe_ptr::SafePtr};
use bitflags::bitflags;
use core::{
mem::size_of,
sync::atomic::{fence, Ordering},
};
use jinux_frame::{
io_mem::IoMem,
offset_of,
vm::{DmaCoherent, VmAllocOptions},
};
use jinux_rights::{Dup, TRightSet, TRights, Write};
use jinux_util::{field_ptr, safe_ptr::SafePtr};
use log::debug;
use pod::Pod;
@ -372,7 +372,7 @@ fn set_buf(ptr: &SafePtr<Descriptor, &DmaCoherent, TRightSet<TRights![Dup, Write
// FIXME: use `DmaSteam` for buf. Now because the upper device driver lacks the
// ability to safely construct DmaStream from slice, slice is still used here.
let va = buf.as_ptr() as usize;
let pa = jinux_frame::vm::vaddr_to_paddr(va).unwrap();
let pa = aster_frame::vm::vaddr_to_paddr(va).unwrap();
field_ptr!(ptr, Descriptor, addr)
.write(&(pa as u64))
.unwrap();

View File

@ -1,6 +1,5 @@
use alloc::{boxed::Box, sync::Arc};
use core::mem::size_of;
use jinux_frame::{
use aster_frame::{
bus::mmio::{
bus::MmioDevice,
device::{MmioCommonDevice, VirtioMmioVersion},
@ -12,8 +11,9 @@ use jinux_frame::{
trap::IrqCallbackFunction,
vm::DmaCoherent,
};
use jinux_rights::{ReadOp, WriteOp};
use jinux_util::{field_ptr, safe_ptr::SafePtr};
use aster_rights::{ReadOp, WriteOp};
use aster_util::{field_ptr, safe_ptr::SafePtr};
use core::mem::size_of;
use log::warn;
use crate::{
@ -33,7 +33,7 @@ pub struct VirtioMmioDevice {
pub struct VirtioMmioTransport {
layout: SafePtr<VirtioMmioLayout, IoMem>,
device: Arc<VirtioMmioDevice>,
common_device: jinux_frame::bus::mmio::device::MmioCommonDevice,
common_device: aster_frame::bus::mmio::device::MmioCommonDevice,
multiplex: Arc<RwLock<MultiplexIrq>>,
}

View File

@ -1,5 +1,5 @@
use alloc::{sync::Arc, vec::Vec};
use jinux_frame::{
use aster_frame::{
bus::{
mmio::{
bus::{MmioDevice, MmioDriver},

View File

@ -1,5 +1,5 @@
use alloc::sync::Arc;
use jinux_frame::bus::mmio::MMIO_BUS;
use aster_frame::bus::mmio::MMIO_BUS;
use spin::Once;
use self::driver::VirtioMmioDriver;

View File

@ -1,13 +1,13 @@
use core::fmt::Debug;
use alloc::{boxed::Box, sync::Arc, vec::Vec};
use jinux_frame::{
use aster_frame::{
io_mem::IoMem,
sync::RwLock,
trap::{IrqCallbackFunction, IrqLine, TrapFrame},
};
use jinux_rights::{ReadOp, TRightSet, WriteOp};
use jinux_util::safe_ptr::SafePtr;
use aster_rights::{ReadOp, TRightSet, WriteOp};
use aster_util::safe_ptr::SafePtr;
/// Multiplexing Irqs. The two interrupt types (configuration space change and queue interrupt)
/// of the virtio-mmio device share the same IRQ, so `MultiplexIrq` are used to distinguish them.

View File

@ -1,8 +1,8 @@
use core::fmt::Debug;
use alloc::boxed::Box;
use jinux_frame::{io_mem::IoMem, trap::IrqCallbackFunction, vm::DmaCoherent};
use jinux_util::safe_ptr::SafePtr;
use aster_frame::{io_mem::IoMem, trap::IrqCallbackFunction, vm::DmaCoherent};
use aster_util::safe_ptr::SafePtr;
use crate::{
queue::{AvailRing, Descriptor, UsedRing},

View File

@ -1,5 +1,5 @@
use alloc::sync::Arc;
use jinux_frame::bus::pci::{
use aster_frame::bus::pci::{
capability::vendor::CapabilityVndrData,
cfg_space::{Bar, IoBar, MemoryBar},
common_device::BarManager,

View File

@ -1,5 +1,5 @@
use jinux_frame::io_mem::IoMem;
use jinux_util::safe_ptr::SafePtr;
use aster_frame::io_mem::IoMem;
use aster_util::safe_ptr::SafePtr;
use pod::Pod;
use crate::transport::pci::capability::VirtioPciCpabilityType;

View File

@ -1,4 +1,4 @@
use jinux_frame::{
use aster_frame::{
bus::{
pci::{
bus::PciDevice, capability::CapabilityData, common_device::PciCommonDevice, PciDeviceId,
@ -12,8 +12,8 @@ use jinux_frame::{
};
use alloc::{boxed::Box, sync::Arc};
use aster_util::{field_ptr, safe_ptr::SafePtr};
use core::fmt::Debug;
use jinux_util::{field_ptr, safe_ptr::SafePtr};
use log::{info, warn};
use super::{common_cfg::VirtioPciCommonCfg, msix::VirtioMsixManager};

View File

@ -1,5 +1,5 @@
use alloc::{sync::Arc, vec::Vec};
use jinux_frame::{
use aster_frame::{
bus::{
pci::{
bus::{PciDevice, PciDriver},

View File

@ -5,7 +5,7 @@ pub mod driver;
pub(super) mod msix;
use alloc::sync::Arc;
use jinux_frame::bus::pci::PCI_BUS;
use aster_frame::bus::pci::PCI_BUS;
use spin::Once;
use self::driver::VirtioPciDriver;

View File

@ -1,5 +1,5 @@
use alloc::vec::Vec;
use jinux_frame::{bus::pci::capability::msix::CapabilityMsixData, trap::IrqLine};
use aster_frame::{bus::pci::capability::msix::CapabilityMsixData, trap::IrqLine};
pub struct VirtioMsixManager {
config_msix_vector: u16,
@ -17,7 +17,7 @@ impl VirtioMsixManager {
pub fn new(mut msix: CapabilityMsixData) -> Self {
let mut msix_vector_list: Vec<u16> = (0..msix.table_size()).collect();
for i in msix_vector_list.iter() {
let irq = jinux_frame::trap::IrqLine::alloc().unwrap();
let irq = aster_frame::trap::IrqLine::alloc().unwrap();
msix.set_interrupt_vector(irq, *i);
}
let config_msix_vector = msix_vector_list.pop().unwrap();