Home
last modified time | relevance | path

Searched refs:new (Results 1 – 25 of 282) sorted by relevance

12345678910>>...12

/DragonOS-0.1.9/kernel/src/arch/x86_64/interrupt/
Dentry.rs299 set_intr_gate(32, 0, VirtAddr::new(irq_handler32 as usize)); in arch_setup_interrupt_gate()
300 set_intr_gate(33, 0, VirtAddr::new(irq_handler33 as usize)); in arch_setup_interrupt_gate()
301 set_intr_gate(34, 0, VirtAddr::new(irq_handler34 as usize)); in arch_setup_interrupt_gate()
302 set_intr_gate(35, 0, VirtAddr::new(irq_handler35 as usize)); in arch_setup_interrupt_gate()
303 set_intr_gate(36, 0, VirtAddr::new(irq_handler36 as usize)); in arch_setup_interrupt_gate()
304 set_intr_gate(37, 0, VirtAddr::new(irq_handler37 as usize)); in arch_setup_interrupt_gate()
305 set_intr_gate(38, 0, VirtAddr::new(irq_handler38 as usize)); in arch_setup_interrupt_gate()
306 set_intr_gate(39, 0, VirtAddr::new(irq_handler39 as usize)); in arch_setup_interrupt_gate()
307 set_intr_gate(40, 0, VirtAddr::new(irq_handler40 as usize)); in arch_setup_interrupt_gate()
309 set_intr_gate(41, 0, VirtAddr::new(irq_handler41 as usize)); in arch_setup_interrupt_gate()
[all …]
Dtrap.rs39 set_intr_gate(0, 0, VirtAddr::new(trap_divide_error as usize)); in arch_trap_init()
40 set_intr_gate(1, 0, VirtAddr::new(trap_debug as usize)); in arch_trap_init()
41 set_intr_gate(2, 0, VirtAddr::new(trap_nmi as usize)); in arch_trap_init()
42 set_system_trap_gate(3, 0, VirtAddr::new(trap_int3 as usize)); in arch_trap_init()
43 set_system_trap_gate(4, 0, VirtAddr::new(trap_overflow as usize)); in arch_trap_init()
44 set_system_trap_gate(5, 0, VirtAddr::new(trap_bounds as usize)); in arch_trap_init()
45 set_intr_gate(6, 0, VirtAddr::new(trap_undefined_opcode as usize)); in arch_trap_init()
46 set_intr_gate(7, 0, VirtAddr::new(trap_dev_not_avaliable as usize)); in arch_trap_init()
47 set_intr_gate(8, 0, VirtAddr::new(trap_double_fault as usize)); in arch_trap_init()
51 VirtAddr::new(trap_coprocessor_segment_overrun as usize), in arch_trap_init()
[all …]
/DragonOS-0.1.9/kernel/src/driver/base/device/
Ddevice_number.rs10 pub const UNNAMED_MAJOR: Self = Self::new(0);
12 pub const IDE0_MAJOR: Self = Self::new(3);
13 pub const TTY_MAJOR: Self = Self::new(4);
14 pub const TTYAUX_MAJOR: Self = Self::new(5);
17 pub const INPUT_MAJOR: Self = Self::new(13);
19 pub const FB_MAJOR: Self = Self::new(29);
21 pub const fn new(x: u32) -> Self { in new() method
38 pub const fn new(major: Major, minor: u32) -> Self { in new() method
45 Major::new(self.data >> Self::MINOR_BITS) in major()
59 Self::new(Major::UNNAMED_MAJOR, 0) in default()
/DragonOS-0.1.9/kernel/src/arch/x86_64/process/
Dtable.rs10 pub const KERNEL_CS: SegmentSelector = SegmentSelector::new(1, Ring::Ring0);
12 pub const KERNEL_DS: SegmentSelector = SegmentSelector::new(2, Ring::Ring0);
14 pub const USER_DS: SegmentSelector = SegmentSelector::new(5, Ring::Ring3);
17 pub const USER_CS: SegmentSelector = SegmentSelector::new(6, Ring::Ring3);
19 static mut TSS_MANAGER: TSSManager = TSSManager::new();
39 const fn new() -> Self { in new() method
41 tss: [TaskStateSegment::new(); PerCpu::MAX_CPU_NUM as usize], in new()
53 let selector = SegmentSelector::new(index, Ring::Ring0); in load_tr()
57 VirtAddr::new(Self::current_tss() as *mut TaskStateSegment as usize), in load_tr()
64 let gdt_vaddr = VirtAddr::new(&GDT_Table as *const _ as usize); in set_tss_descriptor()
/DragonOS-0.1.9/kernel/src/libs/lib_ui/
Dtextui_no_alloc.rs16 pub static TRUE_LINE_NUM: AtomicI32 = AtomicI32::new(0);
17 pub static CHAR_PER_LINE: AtomicI32 = AtomicI32::new(0);
19 pub static NO_ALLOC_OPERATIONS_LINE: AtomicI32 = AtomicI32::new(0);
20 pub static NO_ALLOC_OPERATIONS_INDEX: AtomicI32 = AtomicI32::new(0);
61 let char = TextuiCharChromatic::new(Some(' '), frcolor, bkcolor); in no_init_textui_putchar_window()
67 LineId::new(NO_ALLOC_OPERATIONS_LINE.load(Ordering::SeqCst)), in no_init_textui_putchar_window()
68 LineIndex::new(NO_ALLOC_OPERATIONS_INDEX.load(Ordering::SeqCst)), in no_init_textui_putchar_window()
82 let char = TextuiCharChromatic::new(Some(' '), frcolor, bkcolor); in no_init_textui_putchar_window()
84 LineId::new(NO_ALLOC_OPERATIONS_LINE.load(Ordering::SeqCst)), in no_init_textui_putchar_window()
85 LineIndex::new(NO_ALLOC_OPERATIONS_INDEX.load(Ordering::SeqCst)), in no_init_textui_putchar_window()
[all …]
Dtextui.rs42 static ENABLE_PUT_TO_WINDOW: AtomicBool = AtomicBool::new(false);
76 let metadata = ScmUiFrameworkMetadata::new("TextUI".to_string(), ScmFramworkType::Text); in textui_framwork_init()
83 let initial_window = TextuiWindow::new( in textui_framwork_init()
89 let current_window: Arc<SpinLock<TextuiWindow>> = Arc::new(SpinLock::new(initial_window)); in textui_framwork_init()
95 Arc::new(SpinLock::new(LinkedList::new())); in textui_framwork_init()
99 __TEXTUI_FRAMEWORK = Some(Arc::new(TextUiFramework::new( in textui_framwork_init()
136 pub fn new(num: i32) -> Self { in new() method
151 LineId::new(self.0 + rhs) in add()
158 LineId::new(self.0 - rhs) in sub()
193 pub fn new(num: i32) -> Self { in new() method
[all …]
/DragonOS-0.1.9/tools/debugging/logmonitor/src/backend/
Dmod.rs27 pub fn new(command_line_args: CommandLineArgs, sender: mpsc::Sender<Event>) -> Arc<Self> { in new() method
28 let r = Arc::new(Self { in new()
31 data: Arc::new(Mutex::new(BackendData::new())), in new()
32 main_thread: RwLock::new(None), in new()
33 threads: Mutex::new(Vec::new()), in new()
44 let mut backend = BackendThread::new(cmdargs, sd, Arc::downgrade(&instance), dt); in new()
63 pub fn new() -> Self { in new() method
80 fn new( in new() method
107 let mm_monitor = monitor::mm::MMLogMonitor::new(self.shared_data.clone()); in run_mm_monitor()
Dloader.rs18 BackendError::new( in load()
23 let mut result = KernelMetadata::new(kernel.clone()); in load()
43 pub fn new(kernel: PathBuf) -> Self { in new() method
46 sym_collection: SymbolCollection::new(), in new()
69 pub fn new() -> Self { in new() method
71 symbols: Vec::new(), in new()
76 self.symbols.push(Symbol::new(sym, name)); in add_symbol()
96 pub fn new(sym: Sym, name: String) -> Self { in new() method
/DragonOS-0.1.9/kernel/src/driver/base/map/
Dmod.rs12 pub(crate) const DEV_MAJOR_MAX: Major = Major::new(512);
15 pub(crate) const DEV_MAJOR_DYN_END: Major = Major::new(234);
17 pub(crate) const DEV_MAJOR_DYN_EXT_START: Major = Major::new(511);
18 pub(crate) const DEV_MAJOR_DYN_EXT_END: Major = Major::new(384);
28 pub fn new(data: Arc<dyn KObject>) -> Self { in new() method
39 Self(SpinLock::new(KObjMap::default())) in default()
49 Self(vec![BTreeMap::new(); KOBJMAP_HASH_SIZE]) in default()
73 DeviceNumber::new(dev_t.major(), dev_t.minor() + i as u32), in kobj_map()
74 Probe::new(data.clone()), in kobj_map()
93 let rm_dev_t = &DeviceNumber::new(dev_t.major(), dev_t.minor() + i as u32); in kobj_unmap()
[all …]
/DragonOS-0.1.9/kernel/src/arch/x86_64/driver/apic/
Dx2apic.rs16 return x86::cpuid::CpuId::new() in support()
88 unsafe { ApicId::new(rdmsr(IA32_X2APIC_APICID.into()) as u32) } in id()
99 unsafe { LVT::new(reg, (rdmsr(reg.into()) & 0xffff_ffff) as u32).unwrap() } in read_lvt()
104 let cpuid = raw_cpuid::CpuId::new(); in mask_all_lvt()
106 self.set_lvt(LVT::new(LVTRegister::Timer, LVT::MASKED).unwrap()); in mask_all_lvt()
109 self.set_lvt(LVT::new(LVTRegister::Thermal, LVT::MASKED).unwrap()); in mask_all_lvt()
113 self.set_lvt(LVT::new(LVTRegister::PerformanceMonitor, LVT::MASKED).unwrap()); in mask_all_lvt()
116 self.set_lvt(LVT::new(LVTRegister::LINT0, LVT::MASKED).unwrap()); in mask_all_lvt()
117 self.set_lvt(LVT::new(LVTRegister::LINT1, LVT::MASKED).unwrap()); in mask_all_lvt()
119 self.set_lvt(LVT::new(LVTRegister::ErrorReg, LVT::MASKED).unwrap()); in mask_all_lvt()
/DragonOS-0.1.9/kernel/crates/unified-init/macros/src/
Dlib.rs65 let mut output = proc_macro2::TokenStream::new(); in do_unified_init()
84 return Err(syn::Error::new( in check_function_signature()
104 return Err(syn::Error::new( in check_function_signature()
115 return Err(syn::Error::new(tuple.span(), "Expected empty tuple")); in check_function_signature()
118 return Err(syn::Error::new(type_arg.span(), "Expected empty tuple")); in check_function_signature()
121 return Err(syn::Error::new( in check_function_signature()
137 return Err(syn::Error::new( in check_function_signature()
143 return Err(syn::Error::new( in check_function_signature()
154 Err(syn::Error::new( in check_function_signature()
174 let initializer_name_ident = syn::Ident::new(&initializer_name, function.sig.ident.span()); in generate_unified_initializer()
[all …]
/DragonOS-0.1.9/tools/debugging/logmonitor/src/
Dlogging.rs10 let mut builder = simple_logger::SimpleLogger::new().with_level(LevelFilter::Info); in init()
12 let mut result = LoggingInitResult::new(None); in init()
16 builder = builder.with_backend(Box::new(TUILoggingBackend::new(channel.0))); in init()
32 pub fn new(tui_receiver: Option<mpsc::Receiver<String>>) -> Self { in new() method
42 pub fn new(sender: mpsc::Sender<String>) -> Self { in new() method
Dmain.rs41 let mut app = App::new("DragonOS Log Monitor"); in start_headless_app()
42 let events = EventHandler::new(250); in start_headless_app()
43 let _app_backend = logmonitor::backend::AppBackend::new(cmdargs.clone(), events.sender()); in start_headless_app()
66 let mut app = App::new("DragonOS Log Monitor"); in start_tui_app()
72 let backend = CrosstermBackend::new(io::stderr()); in start_tui_app()
73 let terminal = Terminal::new(backend)?; in start_tui_app()
74 let events = EventHandler::new(250); in start_tui_app()
75 let mut tui = Tui::new(terminal, events); in start_tui_app()
77 let _app_backend = logmonitor::backend::AppBackend::new(cmdargs.clone(), tui.events.sender()); in start_tui_app()
/DragonOS-0.1.9/kernel/src/libs/
Dcpumask.rs12 pub fn new() -> Self { in new() method
13 let bmp = AllocBitmap::new(PerCpu::MAX_CPU_NUM as usize); in new()
21 .map(|index| ProcessorId::new(index as u32)) in first()
28 .map(|index| ProcessorId::new(index as u32)) in first_zero()
35 .map(|index| ProcessorId::new(index as u32)) in last()
42 .map(|index| ProcessorId::new(index as u32)) in next_index()
49 .map(|index| ProcessorId::new(index as u32)) in next_zero_index()
68 index: ProcessorId::new(0), in iter_cpu()
77 index: ProcessorId::new(0), in iter_zero_cpu()
/DragonOS-0.1.9/kernel/src/arch/riscv64/mm/
Dinit.rs27 pub(super) static mut INITIAL_PGTABLE_VALUE: PhysAddr = PhysAddr::new(0);
53 KERNEL_BEGIN_PA = PhysAddr::new(start_pa); in init_kernel_addr()
54 KERNEL_END_PA = PhysAddr::new(end_pa); in init_kernel_addr()
56 KERNEL_BEGIN_VA = VirtAddr::new(boot_text_start_pa as usize); in init_kernel_addr()
57 KERNEL_END_VA = VirtAddr::new(_end as usize); in init_kernel_addr()
73 let mut bump_allocator = BumpAllocator::<RiscV64MMArch>::new(0); in riscv_mm_init()
132 let buddy_allocator = unsafe { BuddyAllocator::<MMArch>::new(bump_allocator).unwrap() }; in riscv_mm_init()
145 let mapper = crate::mm::page::PageMapper::<MMArch, _>::new( in riscv_mm_init()
162 static FLAG: AtomicBool = AtomicBool::new(false); in set_inner_allocator()
182 let base = PhysAddr::new(info.paddr as usize); in remap_at_low_address()
[all …]
Dmod.rs25 pub(self) static mut KERNEL_BEGIN_PA: PhysAddr = PhysAddr::new(0);
27 pub(self) static mut KERNEL_END_PA: PhysAddr = PhysAddr::new(0);
29 pub(self) static mut KERNEL_BEGIN_VA: VirtAddr = VirtAddr::new(0);
31 pub(self) static mut KERNEL_END_VA: VirtAddr = VirtAddr::new(0);
33 pub(self) static INNER_ALLOCATOR: SpinLock<Option<BuddyAllocator<MMArch>>> = SpinLock::new(None);
81 const USER_END_VADDR: crate::mm::VirtAddr = VirtAddr::new(0x0000_003f_ffff_ffff);
83 const USER_BRK_START: crate::mm::VirtAddr = VirtAddr::new(0x0000_001f_ffff_ffff);
85 const USER_STACK_START: crate::mm::VirtAddr = VirtAddr::new(0x0000_001f_ffa0_0000);
88 const FIXMAP_START_VADDR: VirtAddr = VirtAddr::new(0xffff_ffff_8000_0000);
115 let ppn = PhysPageFrame::new(table).ppn(); in set_table()
[all …]
/DragonOS-0.1.9/kernel/src/ipc/
Dsyscall.rs43 let mut user_buffer = UserBufferWriter::new(fd, core::mem::size_of::<[c_int; 2]>(), true)?; in pipe2()
45 let pipe_ptr = LockedPipeInode::new(); in pipe2()
47 let mut read_file = File::new( in pipe2()
52 FilePrivateData::Pipefs(PipeFsPrivateData::new(FileMode::O_RDONLY)); in pipe2()
54 let mut write_file = File::new( in pipe2()
58 write_file.private_data = FilePrivateData::Pipefs(PipeFsPrivateData::new( in pipe2()
87 let mut info = SigInfo::new(sig, 0, SigCode::User, SigType::Kill(pid)); in kill()
125 let r = UserBufferWriter::new(act, core::mem::size_of::<Sigaction>(), from_user); in sigaction()
147 new_ka = Sigaction::new( in sigaction()
149 VirtAddr::new((*act).handler as usize) in sigaction()
[all …]
/DragonOS-0.1.9/kernel/src/arch/x86_64/include/asm/
Dcmpxchg.h35 : [new] "q"(__new) \
46 : [new] "q"(__new) \
57 : [new] "q"(__new) \
68 : [new] "q"(__new) \
80 #define arch_try_cmpxchg(ptr, old_ptr, new) \ argument
81 __raw_try_cmpxchg((ptr), (old_ptr), (new), sizeof(*ptr))
/DragonOS-0.1.9/kernel/src/net/socket/
Dmod.rs43 … pub static ref SOCKET_SET: SpinLock<SocketSet<'static >> = SpinLock::new(SocketSet::new(vec![]));
46 …atic ref HANDLE_MAP: RwLock<HashMap<SocketHandle, SocketHandleItem>> = RwLock::new(HashMap::new());
48 pub static ref PORT_MANAGER: PortManager = PortManager::new();
63 PosixSocketType::Stream => Box::new(TcpSocket::new(SocketOptions::default())), in new_socket()
64 PosixSocketType::Datagram => Box::new(UdpSocket::new(SocketOptions::default())), in new_socket()
65 PosixSocketType::Raw => Box::new(RawSocket::new(protocol, SocketOptions::default())), in new_socket()
66 PosixSocketType::SeqPacket => Box::new(SeqpacketSocket::new(SocketOptions::default())), in new_socket()
72 PosixSocketType::Stream => Box::new(TcpSocket::new(SocketOptions::default())), in new_socket()
73 PosixSocketType::Datagram => Box::new(UdpSocket::new(SocketOptions::default())), in new_socket()
74 PosixSocketType::Raw => Box::new(RawSocket::new(protocol, SocketOptions::default())), in new_socket()
[all …]
/DragonOS-0.1.9/kernel/src/driver/timers/hpet/
Dmod.rs22 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in timers_num()
29 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in counter_clock_period()
40 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in main_counter_value()
46 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in write_main_counter_value()
52 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in general_config()
57 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in write_general_config()
63 let p = NonNull::new(self as *const HpetRegisters as *mut HpetRegisters).unwrap(); in general_intr_status()
/DragonOS-0.1.9/tools/debugging/logmonitor/src/backend/monitor/
Dmm.rs33 pub(crate) fn new(shared_data: Arc<Mutex<BackendData>>) -> Arc<Self> { in new() method
56 threads: Mutex::new(Vec::new()), in new()
57 stop_child_threads: AtomicBool::new(false), in new()
58 self_ref: Weak::new(), in new()
59 mm_log_receiver: Mutex::new(mm_log_worker_mpsc.1), in new()
63 let r = Arc::new(r); in new()
79 LogSet::<usize, ObjectWrapper<AllocatorLog>>::new("mm_allocator_log".to_string(), None); in run()
125 let mut monitor_thread = MMMonitorThread::new(monitor_weak, PathBuf::from(km)); in create_threads()
146 pub fn new(mm_log_monitor: Weak<MMLogMonitor>, kmem_path: PathBuf) -> Self { in new() method
202 let mut logs = Vec::new(); in process_logs()
[all …]
/DragonOS-0.1.9/kernel/src/mm/
Dc_adapter.rs23 …OCATION_MAP: SpinLock<HashMap<VirtAddr, (VirtAddr, usize, usize)>> = SpinLock::new(HashMap::new());
29 let vaddr = VirtAddr::new(vaddr); in rs_pseudo_map_phys()
30 let paddr = PhysAddr::new(paddr); in rs_pseudo_map_phys()
31 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_pseudo_map_phys()
38 let mut vaddr = VirtAddr::new(vaddr); in rs_map_phys()
39 let mut paddr = PhysAddr::new(paddr); in rs_map_phys()
40 let count = PageFrameCount::new(page_align_up(size) / MMArch::PAGE_SIZE); in rs_map_phys()
43 let mut page_flags: PageFlags<MMArch> = PageFlags::new().set_execute(true).set_write(true); in rs_map_phys()
84 let vaddr = VirtAddr::new(ptr as usize); in do_kmalloc()
108 let vaddr = VirtAddr::new(vaddr); in kfree()
[all …]
Dno_init.rs28 SpinLock::new(EarlyIoRemapPages::new());
54 pub const fn new() -> Self { in new() method
59 bmp: StaticBitmap::new(), in new()
75 let vaddr = VirtAddr::new(p); in allocate_page()
101 pub const fn new() -> Self { in new() method
144 let flags: PageFlags<MMArch> = PageFlags::new().set_write(true); in pseudo_map_phys()
153 let flags: PageFlags<MMArch> = PageFlags::new().set_write(false).set_execute(true); in pseudo_map_phys_ro()
168 let mut pseudo_allocator = PseudoAllocator::<MMArch>::new(); in pseudo_map_phys_with_flags()
170 let mut mapper = crate::mm::page::PageMapper::<MMArch, _>::new( in pseudo_map_phys_with_flags()
196 let mut pseudo_allocator = PseudoAllocator::<MMArch>::new(); in pseudo_unmap_phys()
[all …]
/DragonOS-0.1.9/kernel/src/driver/virtio/
Dvirtio_impl.rs25 let page_num = PageFrameCount::new( in dma_alloc()
45 NonNull::new(MMArch::phys_2_virt(paddr).unwrap().data() as _).unwrap(), in dma_alloc()
57 let page_count = PageFrameCount::new( in dma_dealloc()
62 let vaddr = VirtAddr::new(vaddr.as_ptr() as *mut u8 as usize); in dma_dealloc()
71 deallocate_page_frames(PhysPageFrame::new(PhysAddr::new(paddr)), page_count); in dma_dealloc()
79 NonNull::new((0) as _).unwrap() in mmio_phys_to_virt()
88 let vaddr = VirtAddr::new(buffer.as_ptr() as *mut u8 as usize); in share()
/DragonOS-0.1.9/docs/community/ChangeLog/V0.1.x/
DV0.1.4.md34 - Spinlock: new: 新增具有守卫的自旋锁SpinLock,支持编译期对锁的使用进行检查。 (#148)
36 - Mutex: new: Rust版本的Mutex (#157)
37 - doc: new: Rust代码风格文档 (#161)
38 - WaitQueue: new: Rust版本的WaitQueue (#162)
40 - block io: new: Block IO 调度器. 当具有多核时,io调度器在核心1上运行。 (#158)
42 - smp: new: 增加kick_cpu功能,支持让某个特定核心立即运行调度器 (#158)
43 - smp: new: 增加进程在核心间迁移的功能 (#158)
44 - scheduler: new: 增加实时进程调度器(支持FIFO、RR策略) (#139)
47 - process: new: pcb中增加migrate_to字段 (#158)
157 * new: rust版本的waitqueue
[all …]

12345678910>>...12