Home
last modified time | relevance | path

Searched refs:KObject (Results 1 – 25 of 59) sorted by relevance

123

/DragonOS/kernel/src/driver/pci/
H A Dattr.rs7 driver::base::kobject::KObject,
40 _kobj: Arc<dyn KObject>, in is_visible() argument
59 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
62 .map_err(|e: Arc<dyn KObject>| { in show()
69 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
90 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
93 .map_err(|e: Arc<dyn KObject>| { in show()
100 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
121 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
124 .map_err(|e: Arc<dyn KObject>| { in show()
[all …]
/DragonOS/kernel/src/driver/net/
H A Dsysfs.rs5 kobject::KObject,
77 _kobj: Arc<dyn KObject>, in is_visible() argument
105 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
132 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
154 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
176 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
180 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
202 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
224 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
246 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
[all …]
H A Dclass.rs5 kobject::KObject,
68 fn dev_kobj(&self) -> Option<Arc<dyn KObject>> { in dev_kobj() argument
69 Some(sys_dev_char_kset() as Arc<dyn KObject>) in dev_kobj()
72 fn set_dev_kobj(&self, _kobj: Arc<dyn KObject>) { in set_dev_kobj() argument
/DragonOS/kernel/src/filesystem/sysfs/
H A Dsymlink.rs8 use crate::{driver::base::kobject::KObject, filesystem::kernfs::KernFSInode};
25 kobj: Option<&Arc<dyn KObject>>, in create_link() argument
26 target: &Arc<dyn KObject>, in create_link() argument
41 pub fn remove_link(&self, _kobj: &Arc<dyn KObject>, _name: String) { in remove_link() argument
47 kobj: Option<&Arc<dyn KObject>>, in do_create_link() argument
48 target: &Arc<dyn KObject>, in do_create_link() argument
67 target: &Arc<dyn KObject>, in do_create_link_sd() argument
99 target: &Arc<dyn KObject>, in create_link_sd() argument
H A Ddir.rs10 driver::base::kobject::KObject,
23 kobj: Weak<dyn KObject>,
28 pub fn new(kobj: Arc<dyn KObject>) -> Self { in new()
36 pub fn kobj(&self) -> Option<Arc<dyn KObject>> { in kobj() argument
57 pub fn create_dir(&self, kobj: Arc<dyn KObject>) -> Result<Arc<KernFSInode>, SystemError> { in create_dir()
118 pub fn remove_dir(&self, kobj: &Arc<dyn KObject>) { in remove_dir() argument
H A Dmod.rs10 driver::base::kobject::KObject,
112 _kobj: Arc<dyn KObject>, in is_visible() argument
133 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
137 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
147 _kobj: Arc<dyn KObject>, in write() argument
156 _kobj: Arc<dyn KObject>, in read() argument
178 kobj: Arc<dyn KObject>, in show() argument
185 kobj: Arc<dyn KObject>, in store() argument
H A Dgroup.rs8 driver::base::kobject::KObject,
23 kobj: &Arc<dyn KObject>, in create_groups() argument
31 kobj: &Arc<dyn KObject>, in do_create_groups() argument
56 kobj: &Arc<dyn KObject>, in do_create_group() argument
110 kobj: &Arc<dyn KObject>, in remove_groups() argument
131 kobj: &Arc<dyn KObject>, in remove_group() argument
170 kobj: &Arc<dyn KObject>, in group_create_files() argument
/DragonOS/kernel/src/driver/video/fbdev/base/
H A Dfbsysfs.rs6 driver::base::kobject::KObject,
41 _kobj: alloc::sync::Arc<dyn KObject>, in is_visible() argument
64 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
88 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
93 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
119 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
142 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
147 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
169 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
174 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
[all …]
/DragonOS/kernel/src/driver/base/
H A Dkobject.rs26 pub trait KObject: Any + Send + Sync + Debug + CastFromSync { interface
35 fn parent(&self) -> Option<Weak<dyn KObject>>; in parent() argument
38 fn set_parent(&self, parent: Option<Weak<dyn KObject>>); in set_parent() argument
61 impl dyn KObject { implementation
71 impl DowncastArc for dyn KObject { implementation
81 pub parent: Option<Weak<dyn KObject>>,
87 pub fn get_parent_or_clear_weak(&mut self) -> Option<Weak<dyn KObject>> { in get_parent_or_clear_weak() argument
94 fn release(&self, _kobj: Arc<dyn KObject>) {} in release() argument
144 kobj: Arc<dyn KObject>, in show() argument
161 kobj: Arc<dyn KObject>, in store() argument
[all …]
H A Dkset.rs10 DynamicKObjKType, KObjType, KObject, KObjectManager, KObjectState, LockedKObjectState,
21 kobjects: RwLock<Vec<Weak<dyn KObject>>>,
75 parent_kobj: Option<Arc<dyn KObject>>, in new_and_add() argument
109 pub fn join(&self, kobj: &Arc<dyn KObject>) { in join() argument
116 pub fn leave(&self, kobj: &Arc<dyn KObject>) { in leave() argument
140 pub fn as_kobject(&self) -> Arc<dyn KObject> { in as_kobject() argument
144 pub fn kobjects(&self) -> RwLockReadGuard<Vec<Weak<dyn KObject>>> { in kobjects() argument
149 impl KObject for KSet {
162 fn parent(&self) -> Option<Weak<dyn KObject>> { in parent() argument
166 fn set_parent(&self, parent: Option<Weak<dyn KObject>>) { in set_parent() argument
[all …]
H A Dclass.rs7 kobject::{KObjType, KObject},
61 fn dev_kobj(&self) -> Option<Arc<dyn KObject>>; in dev_kobj() argument
63 fn set_dev_kobj(&self, kobj: Arc<dyn KObject>); in set_dev_kobj() argument
127 class.set_dev_kobj(sys_dev_char_kset() as Arc<dyn KObject>); in class_register()
135 sysfs_instance().create_groups(&(subsys as Arc<dyn KObject>), class.class_groups())?; in class_register()
145 sysfs_instance().remove_groups(&(subsys.clone() as Arc<dyn KObject>), class.class_groups()); in class_unregister()
169 _kobj: Arc<dyn KObject>, in show() argument
178 _kobj: Arc<dyn KObject>, in store() argument
H A Dcpu.rs21 kobject::{KObjType, KObject, KObjectCommonData, KObjectState, LockedKObjectState},
204 impl KObject for CpuSubSystemFakeRootDevice {
217 fn parent(&self) -> Option<Weak<dyn KObject>> { in parent() argument
221 fn set_parent(&self, parent: Option<Weak<dyn KObject>>) { in set_parent() argument
274 _kobj: Arc<dyn KObject>, in is_visible() argument
297 fn show(&self, _kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
321 fn show(&self, _kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
/DragonOS/docs/kernel/filesystem/
H A Dkernfs.md12 &emsp;&emsp;这种设计使得SysFS和文件系统的基本操作解耦,KernFS作为SysFS的承载物,使得SysFS能更专注于KObject的管理,让代码更加优雅。
18 …`/sys`目录下。接着sysfs实现上层逻辑,管理KObject,每个上层的Kobject里面都需要包含KernFSInode。并且通过设置KernFSInode的PrivateData,使得K…
20 &emsp;&emsp;当发生回调时,KernFS会把回调信息、私有信息传入到回调函数中,让回调函数能够根据传入的信息,获取到对应的KObject或者sysfs的attribute,从而实现sysf…
/DragonOS/kernel/src/driver/rtc/
H A Dutils.rs4 use crate::driver::base::kobject::KObject;
9 pub fn kobj2rtc_device(kobj: Arc<dyn KObject>) -> Option<Arc<dyn RtcDevice>> { in kobj2rtc_device()
14 pub fn kobj2rtc_general_device(kobj: Arc<dyn KObject>) -> Option<Arc<RtcGeneralDevice>> { in kobj2rtc_general_device()
H A Dclass.rs13 kobject::KObject,
70 fn dev_kobj(&self) -> Option<Arc<dyn KObject>> { in dev_kobj() argument
71 Some(sys_dev_char_kset() as Arc<dyn KObject>) in dev_kobj()
74 fn set_dev_kobj(&self, _kobj: Arc<dyn KObject>) { in set_dev_kobj() argument
H A Dsysfs.rs14 kobject::{KObjType, KObject, KObjectCommonData, KObjectState, LockedKObjectState},
43 #[cast_to([sync] KObject, Device, RtcDevice)]
187 impl KObject for RtcGeneralDevice {
200 fn parent(&self) -> Option<Weak<dyn KObject>> { in parent() argument
204 fn set_parent(&self, parent: Option<Weak<dyn KObject>>) { in set_parent() argument
279 _kobj: Arc<dyn KObject>, in is_visible() argument
304 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
333 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
357 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
380 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
/DragonOS/kernel/src/exception/
H A Dsysfs.rs8 kobject::{KObjType, KObject, KObjectManager, KObjectSysFSOps},
51 fn release(&self, _kobj: Arc<dyn KObject>) { in release() argument
83 _kobj: Arc<dyn KObject>, in is_visible() argument
120 KObjectManager::add_kobj(desc.clone() as Arc<dyn KObject>, Some(kset)).unwrap_or_else(|e| { in irq_sysfs_add()
131 KObjectManager::remove_kobj(desc.clone() as Arc<dyn KObject>); in irq_sysfs_del()
151 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
182 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
208 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
239 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
265 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
[all …]
/DragonOS/kernel/src/driver/tty/
H A Dsysfs.rs12 kobject::KObject,
53 fn dev_kobj(&self) -> Option<Arc<dyn KObject>> { in dev_kobj() argument
54 Some(sys_dev_char_kset() as Arc<dyn KObject>) in dev_kobj()
57 fn set_dev_kobj(&self, _kobj: Arc<dyn KObject>) { in set_dev_kobj() argument
/DragonOS/kernel/src/driver/base/device/
H A Dmod.rs42 KObjType, KObject, KObjectCommonData, KObjectManager, KObjectState, LockedKObjectState,
135 pub trait Device: KObject {
420 fn release(&self, kobj: Arc<dyn KObject>) { in release() argument
452 kobj: Arc<dyn KObject>, in store() argument
461 kobj: Arc<dyn KObject>, in show() argument
521 KObjectManager::add_kobj(device.clone() as Arc<dyn KObject>, None).map_err(|e| { in add_device()
570 kobject_parent: Arc<dyn KObject>, in class_dir_create_and_add() argument
571 ) -> Arc<dyn KObject> { in class_dir_create_and_add() argument
588 KObjectManager::add_kobj(class_dir.clone() as Arc<dyn KObject>, None) in class_dir_create_and_add()
612 ) -> Result<Option<Arc<dyn KObject>>, SystemError> { in get_device_parent() argument
[all …]
H A Dinit.rs9 kobject::KObject,
34 let parent = devices_kset.clone() as Arc<dyn KObject>; in devices_init()
57 let parent = dev_kset.clone() as Arc<dyn KObject>; in devices_init()
72 let parent = dev_kset.clone() as Arc<dyn KObject>; in devices_init()
H A Ddriver.rs8 kobject::KObject,
56 pub trait Driver: Sync + Send + Debug + KObject {
240 let driver_kobj = dev.driver().unwrap() as Arc<dyn KObject>; in driver_sysfs_add()
241 let device_kobj = dev.clone() as Arc<dyn KObject>; in driver_sysfs_add()
273 let kobj = driver.clone() as Arc<dyn KObject>; in add_groups()
278 let kobj = driver.clone() as Arc<dyn KObject>; in remove_groups()
293 let kobj = driver.clone() as Arc<dyn KObject>; in create_attr_file()
306 let kobj = driver.clone() as Arc<dyn KObject>; in remove_attr_file()
H A Dbus.rs8 kobject::{KObjType, KObject, KObjectManager},
275 let dev_kobj = dev.clone() as Arc<dyn KObject>; in add_device()
303 let kobj = driver.clone() as Arc<dyn KObject>; in add_driver()
410 let bus_kobj = bus.subsystem().subsys() as Arc<dyn KObject>; in create_file()
415 let bus_kobj = bus.subsystem().subsys() as Arc<dyn KObject>; in remove_file()
425 let bus_kobj = bus.subsystem().subsys() as Arc<dyn KObject>; in add_groups()
542 let parent = sys_devices_kset() as Arc<dyn KObject>; in buses_init()
610 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store() argument
648 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store() argument
668 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
[all …]
/DragonOS/kernel/src/driver/pci/test/
H A Dpt_device.rs14 kobject::{KObjType, KObject, KObjectCommonData, KObjectState, LockedKObjectState},
169 impl KObject for TestDevice {
182 fn parent(&self) -> Option<Weak<dyn KObject>> { in parent() argument
186 fn set_parent(&self, parent: Option<Weak<dyn KObject>>) { in set_parent() argument
241 _kobj: Arc<dyn KObject>, in is_visible() argument
259 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
263 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
/DragonOS/kernel/src/driver/base/map/
H A Dmod.rs5 kobject::KObject,
22 struct Probe(Arc<dyn KObject>);
28 pub fn new(data: Arc<dyn KObject>) -> Self { in new()
63 data: Arc<dyn KObject>, in kobj_map() argument
106 pub fn kobj_lookup(domain: Arc<LockedKObjMap>, dev_t: DeviceNumber) -> Option<Arc<dyn KObject>> { in kobj_lookup() argument
/DragonOS/kernel/src/driver/video/fbdev/base/fbcon/
H A Dmod.rs17 kobject::{KObjType, KObject, KObjectCommonData, KObjectState, LockedKObjectState},
125 impl KObject for FbConsoleDevice {
138 fn parent(&self) -> Option<Weak<dyn KObject>> { in parent() argument
142 fn set_parent(&self, parent: Option<Weak<dyn KObject>>) { in set_parent() argument
265 _kobj: Arc<dyn KObject>, in is_visible() argument
289 fn show(&self, _kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
295 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
318 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument
341 fn show(&self, _kobj: Arc<dyn KObject>, _buf: &mut [u8]) -> Result<usize, SystemError> { in show() argument
345 fn store(&self, _kobj: Arc<dyn KObject>, _buf: &[u8]) -> Result<usize, SystemError> { in store() argument

123