search for: foreignownable

Displaying 5 results from an estimated 5 matches for "foreignownable".

2023 Apr 05
3
[PATCH v2 0/2] rust: virtio: add virtio support
This used to be a single patch, but I split it into two with the addition of struct Scatterlist. Again a bit new with Rust submissions. I was told by Gary Guo to rebase on top of rust-next, but it seems *very* behind? The first patch does not build on its own due to a dead_code warning. It is hard to not have dead code when one is adding infrastructure to be used by others at a later
2024 Jun 18
1
[PATCH v2 3/8] rust: drm: add driver abstractions
...00..cd594a32f9e4 --- /dev/null +++ b/rust/kernel/drm/drv.rs @@ -0,0 +1,141 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT + +//! DRM driver core. +//! +//! C header: [`include/linux/drm/drm_drv.h`](srctree/include/linux/drm/drm_drv.h) + +use crate::{bindings, drm, private::Sealed, str::CStr, types::ForeignOwnable}; +use macros::vtable; + +/// Driver use the GEM memory manager. This should be set for all modern drivers. +pub const FEAT_GEM: u32 = bindings::drm_driver_feature_DRIVER_GEM; +/// Driver supports mode setting interfaces (KMS). +pub const FEAT_MODESET: u32 = bindings::drm_driver_feature_DRIVER_MODE...
2024 Sep 02
2
[PATCH v2 3/8] rust: drm: add driver abstractions
...t/kernel/drm/drv.rs > @@ -0,0 +1,141 @@ > +// SPDX-License-Identifier: GPL-2.0 OR MIT > + > +//! DRM driver core. > +//! > +//! C header: [`include/linux/drm/drm_drv.h`](srctree/include/linux/drm/drm_drv.h) > + > +use crate::{bindings, drm, private::Sealed, str::CStr, types::ForeignOwnable}; > +use macros::vtable; > + > +/// Driver use the GEM memory manager. This should be set for all modern drivers. > +pub const FEAT_GEM: u32 = bindings::drm_driver_feature_DRIVER_GEM; > +/// Driver supports mode setting interfaces (KMS). > +pub const FEAT_MODESET: u32 = bindings::...
2023 Apr 07
0
[PATCH v2 2/2] rust: virtio: add virtio support
...data.into_foreign() as _, > + gfp, > + ) > + }; > + Note the comment here: > + // SAFETY: if there is a buffer token, it came from > + // `into_foreign()` as called in `add_sgs()`. > + <T::PrivateData as ForeignOwnable>::from_foreign(buf) To be honest, I tried coming up with something clever to solve this, but couldn't. Ideally this should happen when this function is called: > + extern "C" fn remove_callback(virtio_device: *mut bindings::virtio_device) { But I did not find a way to it...
2024 Jun 11
0
[RFC PATCH 3/8] rust: drm: Add Device and Driver abstractions
...+use crate::{ > >> + alloc::flags::*, > >> + bindings, device, drm, > >> + error::code::*, > >> + error::{Error, Result}, > >> + prelude::*, > >> + private::Sealed, > >> + str::CStr, > >> + types::{ARef, ForeignOwnable}, > >> + ThisModule, > >> +}; > >> +use core::{ > >> + marker::{PhantomData, PhantomPinned}, > >> + pin::Pin, > >> +}; > >> +use macros::vtable; > >> + > >> +/// Driver use the GEM memory manager. This should...