Home
last modified time | relevance | path

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

123

/rust/macros/
A Dquote.rs53 tokens = ::std::vec::Vec::new();
61 let mut ts = ::proc_macro::TokenStream::new();
68 let mut ts = ::proc_macro::TokenStream::new();
76 let mut tokens = ::std::vec::Vec::<::proc_macro::TokenTree>::new();
78 $v.push(::proc_macro::TokenTree::Group(::proc_macro::Group::new(
85 let mut tokens = ::std::vec::Vec::new();
87 $v.push(::proc_macro::TokenTree::Group(::proc_macro::Group::new(
94 let mut tokens = ::std::vec::Vec::new();
96 $v.push(::proc_macro::TokenTree::Group(::proc_macro::Group::new(
104 ::proc_macro::Punct::new(':', ::proc_macro::Spacing::Joint)
[all …]
A Dkunit.rs43 let mut tests = Vec::new(); in kunit_tests()
64 TokenTree::Group(Group::new(Delimiter::None, config_kunit)), in kunit_tests()
174 let mut final_body = TokenStream::new(); in kunit_tests()
179 tokens.push(TokenTree::Group(Group::new(Delimiter::Brace, final_body))); in kunit_tests()
A Dmodule.rs10 let mut values = Vec::new(); in expect_string_array()
32 fn new(module: &'a str) -> Self { in new() method
36 buffer: String::new(), in new()
117 let mut seen_keys = Vec::new(); in parse()
156 let mut ordered_keys: Vec<&str> = Vec::new(); in parse()
178 let mut modinfo = ModInfoBuilder::new(ident.as_ref()); in module()
A Dvtable.rs30 let mut functions = Vec::new(); in vtable()
31 let mut consts = HashSet::new(); in vtable()
94 tokens.push(TokenTree::Group(Group::new(Delimiter::Brace, new_body))); in vtable()
/rust/kernel/sync/
A Drcu.rs21 pub fn new() -> Self { in new() method
36 Self::new() in default()
51 Guard::new() in read_lock()
A Dpoll.rs19 $crate::sync::poll::PollCondVar::new(
76 pub fn new(name: &'static CStr, key: Pin<&'static LockClassKey>) -> impl PinInit<Self> { in new() method
78 inner <- CondVar::new(name, key), in new()
A Dlock.rs130 pub fn new(t: T, name: &'static CStr, key: Pin<&'static LockClassKey>) -> impl PinInit<Self> { in new() method
132 data: UnsafeCell::new(t), in new()
172 unsafe { Guard::new(self, state) } in lock()
183 unsafe { B::try_lock(self.state.get()).map(|state| Guard::new(self, state)) } in try_lock()
237 let _relock = ScopeGuard::new(|| in do_unlocked()
274 pub unsafe fn new(lock: &'a Lock<T, B>, state: B::GuardState) -> Self { in new() method
A Darc.rs160 let refcount_layout = Layout::new::<bindings::refcount_t>(); in container_of()
237 let inner = KBox::new(value, flags)?; in new()
305 unsafe { ArcBorrow::new(self.ptr) } in as_arc_borrow()
349 let me = ManuallyDrop::new(self); in into_unique_or_drop()
385 ManuallyDrop::new(self).ptr.as_ptr().cast() in into_foreign()
406 unsafe { ArcBorrow::new(inner) } in borrow()
593 unsafe fn new(inner: NonNull<ArcInner<T>>) -> Self { in new() method
619 unsafe { Self::new(ptr) } in from_raw()
628 ManuallyDrop::new(unsafe { Arc::from_inner(b.inner) }) in from()
769 inner: Arc::new(value, flags)?, in new()
[all …]
A Dlocked_by.rs102 pub fn new<B: Backend>(owner: &Lock<U, B>, data: T) -> Self { in new() method
109 data: UnsafeCell::new(data), in new()
/rust/pin-init/examples/
A Dstatic_init.rs37 pub const fn new(init: I) -> Self { in new() method
39 cell: UnsafeCell::new(MaybeUninit::uninit()), in new()
40 init: Cell::new(Some(init)), in new()
41 lock: SpinLock::new(), in new()
42 present: Cell::new(false), in new()
79 let init = CMutex::new(0); in __pinned_init()
85 pub static COUNT: StaticInit<CMutex<usize>, CountInit> = StaticInit::new(CountInit);
90 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
97 Builder::new() in main()
A Dmutex.rs50 pub const fn new() -> Self { in new() method
52 inner: AtomicBool::new(false), in new()
78 pub fn new(val: impl PinInit<T>) -> impl PinInit<Self> { in new() method
80 wait_list <- ListHead::new(), in new()
81 spin_lock: SpinLock::new(), in new()
82 locked: Cell::new(false), in new()
196 let mtx: Pin<Arc<CMutex<usize>>> = Arc::pin_init(CMutex::new(0)).unwrap(); in main()
203 Builder::new() in main()
A Dbig_struct_in_place.rs23 pub fn new() -> impl Init<Self> { in new() method
38 managed_buf <- ManagedBuf::new(), in main()
/rust/kernel/io/
A Dmem.rs31 pub(crate) unsafe fn new(device: &'a Device<Bound>, resource: &'a Resource) -> Self { in new() method
78 IoMem::new(self) in iomap_sized()
90 ExclusiveIoMem::new(self) in iomap_exclusive_sized()
189 pub fn new<'a>(io_request: IoRequest<'a>) -> impl PinInit<Devres<Self>, Error> + 'a { in new() method
193 Devres::new(dev, Self::ioremap(res)) in new()
250 let io = IoRaw::new(addr as usize, size)?; in ioremap()
257 pub fn new<'a>(io_request: IoRequest<'a>) -> impl PinInit<Devres<Self>, Error> + 'a { in new() method
261 Devres::new(dev, Self::ioremap(res)) in new()
A Dresource.rs121 resource: NonNull::new(region)?, in request_region()
215 pub const IORESOURCE_IO: Flags = Flags::new(bindings::IORESOURCE_IO);
218 pub const IORESOURCE_MUXED: Flags = Flags::new(bindings::IORESOURCE_MUXED);
221 pub const IORESOURCE_MEM: Flags = Flags::new(bindings::IORESOURCE_MEM);
224 pub const IORESOURCE_MEM_NONPOSTED: Flags = Flags::new(bindings::IORESOURCE_MEM_NONPOSTED);
226 const fn new(value: u32) -> Self { in new() method
/rust/kernel/
A Dxarray.rs89 pub fn new(kind: AllocKind) -> impl PinInit<Self> { in new() method
118 .map_while(|ptr| NonNull::new(ptr.cast())) in iter()
187 let ptr = NonNull::new(ptr.cast())?; in load()
237 let new = value.into_foreign(); in store()
240 let new = new.cast(); in store()
246 unsafe { bindings::__xa_store(self.xa.xa.get(), index, new, gfp.as_raw()) } in store()
255 let value = unsafe { T::from_foreign(new) }; in store()
A Dtypes.rs239 pub fn new(cleanup: impl FnOnce()) -> ScopeGuard<(), impl FnOnce(())> { in new() method
334 pub const fn new(value: T) -> Self { in new() method
336 value: UnsafeCell::new(MaybeUninit::new(value)), in new()
344 value: UnsafeCell::new(MaybeUninit::uninit()), in uninit()
352 value: UnsafeCell::new(MaybeUninit::zeroed()), in zeroed()
A Drevocable.rs85 pub fn new<E>(data: impl PinInit<T, E>) -> impl PinInit<Self, E> { in new() method
87 is_available: AtomicBool::new(true), in new()
104 Some(RevocableGuard::new(self.data.get(), guard)) in try_access()
246 fn new(data_ref: *const T, rcu_guard: rcu::Guard) -> Self { in new() method
A Dfaux.rs27 pub fn new(name: &CStr, parent: Option<&device::Device>) -> Result<Self> { in new() method
45 Ok(Self(NonNull::new(dev).ok_or(ENODEV)?)) in new()
A Dcpumask.rs235 NonNull::new(ptr.cast()).ok_or(AllocError)? in new_zero()
249 pub unsafe fn new(_flags: Flags) -> Result<Self, AllocError> { in new() method
260 NonNull::new(ptr.cast()).ok_or(AllocError)? in new()
298 let mut cpumask_var = unsafe { Self::new(GFP_KERNEL) }?; in try_clone()
A Dof.rs36 pub const fn new(compatible: &'static CStr) -> Self { in new() method
61 > = $crate::device_id::IdArray::new($table_data);
A Dacpi.rs39 pub const fn new(id: &'static CStr) -> Self { in new() method
66 > = $crate::device_id::IdArray::new($table_data);
A Dcpufreq.rs91 fn new(val: u32) -> Result<Self> { in new() method
181 pub unsafe fn new(index: usize) -> Self { in new() method
296 entries: Pin::new(entries), in new()
359 pub fn new() -> Self { in new() method
361 entries: KVec::new(), in new()
383 TableBox::new(self.entries) in to_table()
1036 pub fn new() -> Result<Self> { in new() method
1039 let mut drv = KBox::new(UnsafeCell::new(Self::VTABLE), GFP_KERNEL)?; in new()
1055 devres::register(dev, Self::new()?, GFP_KERNEL) in new_foreign_owned()
1233 let index = unsafe { TableIndex::new(index as usize) }; in target_index_callback()
[all …]
/rust/pin-init/internal/src/
A Dpin_data.rs27 let mut errs = TokenStream::new(); in pin_data()
40 res.push(TokenTree::Punct(Punct::new(':', Spacing::Joint))); in pin_data()
41 res.push(TokenTree::Punct(Punct::new(':', Spacing::Alone))); in pin_data()
42 res.push(TokenTree::Punct(Punct::new('<', Spacing::Alone))); in pin_data()
44 res.push(TokenTree::Punct(Punct::new('>', Spacing::Alone))); in pin_data()
124 TokenTree::Group(g) => vec![TokenTree::Group(Group::new( in replace_self_and_deny_type_defs()
/rust/kernel/sync/lock/
A Dglobal.rs47 pub const unsafe fn new(data: B::Item) -> Self { in new() method
51 data: UnsafeCell::new(data), in new()
145 pub fn new(val: T) -> Self { in new() method
147 value: UnsafeCell::new(val), in new()
287 unsafe { $crate::sync::lock::GlobalLock::new(init) }
/rust/kernel/block/mq/
A Draw_writer.rs20 fn new(buffer: &'a mut [u8]) -> Result<RawWriter<'a>> { in new() method
30 Self::new(

Completed in 40 milliseconds

123