/DragonOS/kernel/src/libs/lib_ui/font/ |
H A D | mod.rs | 9 pub struct BitmapFont<'a> { 11 bitmap: RawBitMap<'a>, 14 glyph_mapping: &'a dyn GlyphMapping, 23 impl<'a> BitmapFont<'a> { 25 bitmap: RawBitMap<'a>, in new() argument 26 glyph_mapping: &'a dyn GlyphMapping, in new() 47 pub fn char_map(&self, character: char) -> &'a [u8] { in char_map() 69 pub struct RawBitMap<'a> { 70 pub data: &'a [u8],
|
/DragonOS/kernel/crates/rust-slabmalloc/src/ |
H A D | pages.rs | 285 pub struct ObjectPage<'a> { 291 next: Rawlink<ObjectPage<'a>>, 293 prev: Rawlink<ObjectPage<'a>>, 299 impl<'a> ObjectPage<'a> { 300 pub fn new() -> Box<ObjectPage<'a>> { in new() 306 unsafe impl<'a> Send for ObjectPage<'a> {} 307 unsafe impl<'a> Sync for ObjectPage<'a> {} 309 impl<'a> AllocablePage for ObjectPage<'a> { 328 impl<'a> Default for ObjectPage<'a> { 329 fn default() -> ObjectPage<'a> { in default() [all …]
|
H A D | zone.rs | 40 pub struct ZoneAllocator<'a> { 41 small_slabs: [SCAllocator<'a, ObjectPage<'a>>; ZoneAllocator::MAX_BASE_SIZE_CLASSES], 45 impl<'a> Default for ZoneAllocator<'a> { 46 fn default() -> ZoneAllocator<'a> { in default() 56 impl<'a> ZoneAllocator<'a> { 66 pub const fn new() -> ZoneAllocator<'a> { in new() 71 pub fn new() -> ZoneAllocator<'a> { in new() 157 unsafe impl<'a> crate::Allocator<'a> for ZoneAllocator<'a> { 192 new_page: &'a mut ObjectPage<'a>, in refill() argument
|
H A D | sc.rs | 18 const fn cmin(a: usize, b: usize) -> usize { in cmin() 19 [a, b][(a > b) as usize] in cmin() 24 fn cmin(a: usize, b: usize) -> usize { in cmin() 25 core::cmp::min(a, b) in cmin() 49 pub struct SCAllocator<'a, P: AllocablePage> { 57 pub(crate) empty_slabs: PageList<'a, P>, 59 pub(crate) slabs: PageList<'a, P>, 61 pub(crate) full_slabs: PageList<'a, P>, 87 impl<'a, P: AllocablePage> SCAllocator<'a, P> { 92 pub const fn new(size: usize) -> SCAllocator<'a, P> { in new() argument [all …]
|
H A D | lib.rs | 66 pub unsafe trait Allocator<'a> { 82 new_page: &'a mut ObjectPage<'a>, in refill() argument
|
/DragonOS/tools/debugging/logmonitor/src/ |
H A D | app.rs | 11 pub struct App<'a> { 13 pub title: &'a str, 22 pub tabs: TabsState<'a>, 27 pub stateful_logs: StatefulList<(&'a str, &'a str)>, 32 impl<'a> App<'a> { 34 pub fn new(title: &'a str) -> Self { in new() 107 pub struct TabsState<'a> { 108 pub titles: Vec<&'a str>, 112 impl<'a> TabsState<'a> { 113 pub fn new(titles: Vec<&'a str>) -> TabsState { in new()
|
/DragonOS/kernel/src/libs/ |
H A D | rbtree.rs | 434 impl<'a, K: Ord + Debug, V: Debug> Index<&'a K> for RBTree<K, V> { 473 pub struct Keys<'a, K: Ord + Debug + 'a, V: Debug + 'a> { 474 inner: Iter<'a, K, V>, 477 impl<'a, K: Ord + Debug, V: Debug> Clone for Keys<'a, K, V> { 478 fn clone(&self) -> Keys<'a, K, V> { in clone() argument 485 impl<'a, K: Ord + Debug, V: Debug> fmt::Debug for Keys<'a, K, V> { 491 impl<'a, K: Ord + Debug, V: Debug> Iterator for Keys<'a, K, V> { 492 type Item = &'a K; 495 fn next(&mut self) -> Option<&'a K> { in next() 518 pub struct Values<'a, K: Ord + Debug, V: Debug> { [all …]
|
H A D | spinlock.rs | 27 pub struct SpinLockGuard<'a, T: 'a> { 28 lock: &'a SpinLock<T>, 34 impl<'a, T: 'a> SpinLockGuard<'a, T> { 44 pub unsafe fn leak(this: Self) -> &'a mut T { in leak()
|
/DragonOS/kernel/crates/rbpf/src/ |
H A D | lib.rs | 116 pub struct EbpfVmMbuff<'a> { 117 prog: Option<&'a [u8]>, 120 jit: Option<jit::JitMemory<'a>>, 126 impl<'a> EbpfVmMbuff<'a> { 142 pub fn new(prog: Option<&'a [u8]>) -> Result<EbpfVmMbuff<'a>, Error> { in new() argument 177 pub fn set_program(&mut self, prog: &'a [u8]) -> Result<(), Error> { in set_program() 390 mbuff: &'a mut [u8], in execute_program_jit() 501 mbuff: &'a mut [u8], in execute_program_cranelift() 594 pub struct EbpfVmFixedMbuff<'a> { 595 parent: EbpfVmMbuff<'a>, [all …]
|
/DragonOS/.github/ |
H A D | issue-checker.yml | 21 regexes: '[Ff]eat(?:\([a-zA-Z]*/?[a-zA-Z]*\))?[\:\.\,]' 29 regexes: '[Ff]ix(?:\([a-zA-Z]*/?[a-zA-Z]*\))?[\:\.\,]' 37 regexes: '[Dd]ocs(?:\([a-zA-Z]*/?[a-zA-Z]*\))?[\:\.\,]' 45 regexes: '[Tt]est(?:\([a-zA-Z]*/?[a-zA-Z]*\))?[\:\.\,]' 54 …regexes: '^(?!(?:build|chore|ci|docs?|feat|fix|perf|refactor|rft|style|test)(?:\([a-zA-Z]*\))?[\:\…
|
/DragonOS/kernel/crates/ida/src/ |
H A D | lib.rs | 15 struct EmptyIdaItemRef<'a> { 16 _marker: PhantomData<&'a EmptyIdaItem>, 19 impl<'a> Deref for EmptyIdaItemRef<'a> { 30 type Ref<'a> = EmptyIdaItemRef<'a> where Self: 'a; 40 unsafe fn raw_as_ref<'a>(_raw: *const ()) -> Self::Ref<'a> { in raw_as_ref() argument
|
/DragonOS/kernel/crates/intertrait/ |
H A D | README.md | 10 This library provides direct casting among trait objects implemented by a type. 12 In Rust, a trait object for a sub-trait of [`std::any::Any`] can be downcast to a concrete type at … 14 of the backing value) is possible (even no coercion from a trait object for a trait to that for its… 16 With this crate, any trait object for a sub-trait of [`CastFrom`] can be cast directly to a trait o… 65 The trait implemented is designated as a target trait. 135 from an object for a sub-trait of [`CastFrom`]. 137 And the macros provided by `intertrait` generates trampoline functions for downcasting a trait obje… 138 for [`std::any::Any`] back to its concrete type and then creating a trait object for the target tra… 140 Those trampoline functions are aggregated into a global registry 142 life-before-main trick. The registry is keyed with a pair of [`TypeId`]s, which are those of the co… [all …]
|
/DragonOS/kernel/crates/rbpf/ |
H A D | README.md | 31 This crate contains a virtual machine for eBPF program execution. BPF, as in 35 where it evolved into eBPF (_extended_ BPF), a faster version with more 39 a disassembler. 50 should work out of the box by adding it as a dependency in your `Cargo.toml` 87 tests](../../tree/main/tests) should also prove helpful. Here is a summary of 92 1. Create a virtual machine. There are several kinds of machines, we will come 97 3. If you want a JIT-compiled program, compile it. 102 in the Linux kernel, such as kprobes, but this is not covered by rbpf). As a 104 performed on a memory area representing the packet data. However, in the Linux 106 it has access to a C `struct sk_buff` instead, which is a buffer containing [all …]
|
/DragonOS/kernel/crates/intertrait/tests/ |
H A D | on-trait-impl-assoc-type2.rs | 14 fn concat(&self, a: Self::I1, b: Self::I2) -> String; in concat() 22 fn concat(&self, a: Self::I1, b: Self::I2) -> String { in concat() 23 format!("Data: {} - {}", a, b) in concat()
|
H A D | on-trait-impl-assoc-type3.rs | 14 fn concat(&self, prefix: T, a: Self::I1, b: Self::I2) -> String; in concat() 22 fn concat(&self, prefix: String, a: Self::I1, b: Self::I2) -> String { in concat() 23 format!("{}: {} - {}", prefix, a, b) in concat()
|
/DragonOS/kernel/src/driver/firmware/efi/ |
H A D | memmap.rs | 59 pub struct EFIMemoryDescIter<'a> { 60 inner: &'a EFIMemoryMapInfo, 64 impl<'a> EFIMemoryDescIter<'a> { 65 fn new(inner: &'a EFIMemoryMapInfo) -> Self { in new() 70 impl<'a> Iterator for EFIMemoryDescIter<'a> {
|
/DragonOS/kernel/src/filesystem/kernfs/ |
H A D | callback.rs | 36 pub struct KernCallbackData<'a> { 38 private_data: SpinLockGuard<'a, Option<KernInodePrivateData>>, 42 impl<'a> KernCallbackData<'a> { 45 private_data: SpinLockGuard<'a, Option<KernInodePrivateData>>, in new() argument
|
/DragonOS/kernel/src/filesystem/ |
H A D | mbr.rs | 161 pub struct MbrPartitionIter<'a> { 162 table: &'a MbrDiskPartionTable, 166 impl<'a> MbrPartitionIter<'a> { 167 fn new(table: &'a MbrDiskPartionTable) -> Self { in new() 172 impl<'a> Iterator for MbrPartitionIter<'a> {
|
/DragonOS/ |
H A D | LICENSE | 33 For example, if you distribute copies of such a program, whether 34 gratis or for a fee, you must give the recipients all the rights that 51 patents. We wish to avoid the danger that redistributors of a free 63 a notice placed by the copyright holder saying it may be distributed 65 refers to any such program or work, and a "work based on the Program" 67 that is to say, a work containing the Program or a portion of it, 75 is covered only if its contents constitute a work based on the 84 and give any other recipients of the Program a copy of this License 87 You may charge a fee for the physical act of transferring a copy, and 88 you may at your option offer warranty protection in exchange for a fee. [all …]
|
/DragonOS/kernel/src/syscall/ |
H A D | user_access.rs | 153 pub struct UserBufferWriter<'a> { 154 buffer: &'a mut [u8], 158 pub struct UserBufferReader<'a> { 159 buffer: &'a [u8], 163 impl<'a> UserBufferReader<'a> { 272 impl<'a> UserBufferWriter<'a> { 299 &'a mut self, in copy_to_user() 315 &'a mut self, in copy_one_to_user() 324 pub fn buffer<T>(&'a mut self, offset: usize) -> Result<&mut [T], SystemError> { in buffer()
|
/DragonOS/kernel/src/bpf/prog/ |
H A D | verifier.rs | 19 pub struct BpfProgVerifier<'a> { 22 _log_buf: &'a mut [u8], 25 impl<'a> BpfProgVerifier<'a> { 26 pub fn new(prog: BpfProg, log_level: VerifierLogLevel, log_buf: &'a mut [u8]) -> Self { in new()
|
/DragonOS/docs/kernel/locking/ |
H A D | rwlock.md | 36 pub struct RwLockReadGuard<'a, T: 'a> { 38 lock: &'a AtomicU32, 44 pub struct RwLockUpgradableGuard<'a, T: 'a> { 46 inner: &'a RwLock<T>, 52 pub struct RwLockWriteGuard<'a, T: 'a> { 54 inner: &'a RwLock<T>,
|
/DragonOS/kernel/src/driver/video/fbdev/base/ |
H A D | render_helper.rs | 3 pub struct BitIter<'a> { 8 src: Iter<'a, u8>, 19 impl<'a> BitIter<'a> { 26 src: Iter<'a, u8>, in new() argument
|
/DragonOS/kernel/crates/intertrait/macros/ |
H A D | LICENSE-APACHE | 31 transformation or translation of a Source form, including but 36 Object form, made available under the License, as indicated by a 43 represent, as a whole, an original work of authorship. For the purposes 60 designated in writing by the copyright owner as "Not a Contribution." 63 on behalf of whom a Contribution has been received by Licensor and 67 this License, each Contributor hereby grants to You a perpetual, 74 this License, each Contributor hereby grants to You a perpetual, 82 institute patent litigation against any entity (including a 83 cross-claim or counterclaim in a lawsuit) alleging that the Work 84 or a Contribution incorporated within the Work constitutes direct [all …]
|
/DragonOS/kernel/src/perf/ |
H A D | util.rs | 114 pub struct PerfSample<'a> { 116 pub value: &'a [u8], 119 impl<'a> PerfSample<'a> {
|