Lines Matching full:resource
15 /// Resource Size type.
21 /// A region allocated from a parent [`Resource`].
25 /// - `self.0` points to a valid `bindings::resource` that was obtained through
28 /// The resource returned when the region was requested.
29 resource: NonNull<bindings::resource>, field
36 type Target = Resource;
40 unsafe { Resource::from_raw(self.resource.as_ptr()) } in deref()
62 // SAFETY: `Region` only holds a pointer to a C `struct resource`, which is safe to be used from
66 // SAFETY: `Region` only holds a pointer to a C `struct resource`, references to which are
70 /// A resource abstraction.
74 /// [`Resource`] is a transparent wrapper around a valid `bindings::resource`.
76 pub struct Resource(Opaque<bindings::resource>); struct
78 impl Resource { impl
79 /// Creates a reference to a [`Resource`] from a valid pointer.
84 /// point at a valid `bindings::resource`.
86 /// The caller must also ensure that the [`Resource`] is only accessed via the
88 pub(crate) const unsafe fn from_raw<'a>(ptr: *mut bindings::resource) -> &'a Self { in from_raw()
89 // SAFETY: Self is a transparent wrapper around `Opaque<bindings::resource>`. in from_raw()
93 /// Requests a resource region.
106 // - Safe as per the invariant of `Resource`. in request_region()
121 resource: NonNull::new(region)?, in request_region()
126 /// Returns the size of the resource.
129 // SAFETY: Safe as per the invariants of `Resource`. in size()
133 /// Returns the start address of the resource.
136 // SAFETY: Safe as per the invariants of `Resource`. in start()
140 /// Returns the name of the resource.
144 // SAFETY: Safe as per the invariants of `Resource`. in name()
151 // SAFETY: In the C code, `resource::name` either contains a null in name()
158 /// Returns the flags associated with the resource.
161 // SAFETY: Safe as per the invariants of `Resource`. in flags()
168 // SAFETY: `Resource` only holds a pointer to a C `struct resource`, which is
170 unsafe impl Send for Resource {} implementation
172 // SAFETY: `Resource` only holds a pointer to a C `struct resource`, references
174 unsafe impl Sync for Resource {} implementation
176 /// Resource flags as stored in the C `struct resource::flags` field.
217 /// Resource is software muxed.
220 /// Resource represents a memory region.
223 /// Resource represents a memory region that must be ioremaped using `ioremap_np`.