Home
last modified time | relevance | path

Searched refs:kobj (Results 1 – 19 of 19) sorted by relevance

/DragonOS/kernel/src/driver/base/
H A Dkobject.rs144 kobj: Arc<dyn KObject>, in show()
148 let r = attr.show(kobj, buf).map_err(|e| { in show()
161 kobj: Arc<dyn KObject>, in store()
165 let r = attr.store(kobj, buf).map_err(|e| { in store()
182 kobj: Arc<dyn KObject>, in init_and_add_kobj()
186 Self::kobj_init(&kobj, kobj_type); in init_and_add_kobj()
187 Self::add_kobj(kobj, join_kset) in init_and_add_kobj()
190 pub fn kobj_init(kobj: &Arc<dyn KObject>, kobj_type: Option<&'static dyn KObjType>) { in kobj_init()
191 kobj.set_kobj_type(kobj_type); in kobj_init()
195 kobj: Arc<dyn KObject>, in add_kobj()
[all …]
H A Dkset.rs109 pub fn join(&self, kobj: &Arc<dyn KObject>) { in join()
110 assert!(kobj.kset().is_none()); in join()
111 kobj.set_kset(self.self_ref.upgrade()); in join()
112 self.kobjects.write().push(Arc::downgrade(kobj)); in join()
116 pub fn leave(&self, kobj: &Arc<dyn KObject>) { in leave()
121 return Arc::ptr_eq(&x, kobj); in leave()
H A Dclass.rs63 fn set_dev_kobj(&self, kobj: Arc<dyn KObject>); in set_dev_kobj()
/DragonOS/kernel/src/filesystem/sysfs/
H A Ddir.rs23 kobj: Weak<dyn KObject>, field
28 pub fn new(kobj: Arc<dyn KObject>) -> Self { in new()
31 kobj: Arc::downgrade(&kobj), in new()
36 pub fn kobj(&self) -> Option<Arc<dyn KObject>> { in kobj() method
37 self.kobj.upgrade() in kobj()
57 pub fn create_dir(&self, kobj: Arc<dyn KObject>) -> Result<Arc<KernFSInode>, SystemError> { in create_dir()
59 let parent = kobj in create_dir()
65 let sysfs_dir_priv = SysFSKernPrivateData::Dir(SysKernDirPriv::new(kobj.clone())); in create_dir()
68 kobj.name(), in create_dir()
74 kobj.set_inode(Some(dir.clone())); in create_dir()
[all …]
H A Dfile.rs30 kobj: Weak<dyn KObject>, field
35 kobj: &Arc<dyn KObject>, in new()
46 let kobj = Arc::downgrade(kobj); in new() localVariable
48 kobj, in new()
63 let kobj = self.kobj.upgrade().expect("kobj is None"); in callback_read() localVariable
64 let len = attribute.show(kobj, buf)?; in callback_read()
76 let kobj = self.kobj.upgrade().expect("kobj is None"); in callback_read() localVariable
77 return bin_attribute.read(kobj, buf, offset); in callback_read()
86 let kobj = self.kobj.upgrade().expect("kobj is None"); in callback_write() localVariable
87 return attribute.store(kobj, buf); in callback_write()
[all …]
H A Dgroup.rs23 kobj: &Arc<dyn KObject>, in create_groups()
26 return self.do_create_groups(kobj, groups, false); in create_groups()
31 kobj: &Arc<dyn KObject>, in do_create_groups()
40 if let Err(e) = self.do_create_group(kobj, group, update) { in do_create_groups()
46 self.remove_group(kobj, groups[j]).ok(); in do_create_groups()
56 kobj: &Arc<dyn KObject>, in do_create_group()
61 let kobj_inode = kobj.inode().ok_or(SystemError::EINVAL)?; in do_create_group()
78 SysKernDirPriv::new(kobj.clone()), in do_create_group()
98 if let Err(e) = self.group_create_files(parent_inode.clone(), kobj, group, update) { in do_create_group()
110 kobj: &Arc<dyn KObject>, in remove_groups()
[all …]
H A Dsymlink.rs25 kobj: Option<&Arc<dyn KObject>>, in create_link()
29 return self.do_create_link(kobj, target, name, true); in create_link()
47 kobj: Option<&Arc<dyn KObject>>, in do_create_link()
52 let parent = if let Some(kobj) = kobj { in do_create_link()
53 kobj.inode() in do_create_link()
H A Dmod.rs178 kobj: Arc<dyn KObject>, in show()
185 kobj: Arc<dyn KObject>, in store()
/DragonOS/kernel/src/driver/rtc/
H A Dutils.rs9 pub fn kobj2rtc_device(kobj: Arc<dyn KObject>) -> Option<Arc<dyn RtcDevice>> { in kobj2rtc_device()
10 kobj.arc_any().cast::<dyn RtcDevice>().ok() in kobj2rtc_device()
14 pub fn kobj2rtc_general_device(kobj: Arc<dyn KObject>) -> Option<Arc<RtcGeneralDevice>> { in kobj2rtc_general_device()
15 kobj.arc_any().downcast().ok() in kobj2rtc_general_device()
H A Dsysfs.rs304 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
305 let rtc_device = kobj in show()
333 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
335 kobj2rtc_general_device(kobj).ok_or(SystemError::EINVAL)?; in show()
357 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
358 let rtc_device = kobj2rtc_general_device(kobj).ok_or(SystemError::EINVAL)?; in show()
380 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
381 let rtc_device = kobj2rtc_general_device(kobj).ok_or(SystemError::EINVAL)?; in show()
/DragonOS/kernel/src/exception/
H A Dsysfs.rs151 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
152 let irq_desc = kobj in show()
182 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
183 let irq_desc = kobj in show()
208 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
209 let irq_desc = kobj in show()
239 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
240 let irq_desc = kobj in show()
265 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
266 let irq_desc = kobj in show()
[all …]
/DragonOS/kernel/src/driver/video/fbdev/base/
H A Dfbsysfs.rs64 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
65 let fb_dev = kobj.arc_any().downcast::<FbDevice>().unwrap(); in show()
93 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
94 let fb_dev = kobj.arc_any().downcast::<FbDevice>().unwrap(); in show()
195 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
196 let fb_dev = kobj.arc_any().downcast::<FbDevice>().unwrap(); in show()
224 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
225 let fb_dev = kobj.arc_any().downcast::<FbDevice>().unwrap(); in show()
256 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
257 let fb_dev = kobj.arc_any().downcast::<FbDevice>().unwrap(); in show()
[all …]
/DragonOS/kernel/src/driver/base/device/
H A Dbus.rs303 let kobj = driver.clone() as Arc<dyn KObject>; in add_driver() localVariable
306 kobj, in add_driver()
610 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
611 let kset: Arc<KSet> = kobj.arc_any().downcast().map_err(|_| SystemError::EINVAL)?; in store()
648 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
653 let kset: Arc<KSet> = kobj.arc_any().downcast().map_err(|_| SystemError::EINVAL)?; in store()
668 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
669 let kset: Arc<KSet> = kobj.arc_any().downcast().map_err(|_| SystemError::EINVAL)?; in show()
723 kobj: Arc<dyn KObject>, in show()
727 attr.show(kobj, buf) in show()
[all …]
H A Ddriver.rs273 let kobj = driver.clone() as Arc<dyn KObject>; in add_groups() localVariable
274 return sysfs_instance().create_groups(&kobj, groups); in add_groups()
278 let kobj = driver.clone() as Arc<dyn KObject>; in remove_groups() localVariable
279 sysfs_instance().remove_groups(&kobj, groups); in remove_groups()
293 let kobj = driver.clone() as Arc<dyn KObject>; in create_attr_file() localVariable
294 return sysfs_instance().create_file(&kobj, attr); in create_attr_file()
306 let kobj = driver.clone() as Arc<dyn KObject>; in remove_attr_file() localVariable
307 sysfs_instance().remove_file(&kobj, attr); in remove_attr_file()
H A Dmod.rs420 fn release(&self, kobj: Arc<dyn KObject>) { in release()
421 let dev = kobj.cast::<dyn Device>().unwrap(); in release()
452 kobj: Arc<dyn KObject>, in store()
456 return attr.store(kobj, buf); in store()
461 kobj: Arc<dyn KObject>, in show()
465 return attr.show(kobj, buf); in show()
508 if let Some(ref kobj) = kobject_parent { in add_device()
509 log::debug!("kobject parent: {:?}", kobj.name()); in add_device()
780 let kobj = dev.clone() as Arc<dyn KObject>; in add_groups() localVariable
781 return sysfs_instance().create_groups(&kobj, attr_groups); in add_groups()
[all …]
H A Ddd.rs601 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
602 let dev = kobj.cast::<dyn Device>().map_err(|kobj| { in show()
605 kobj.name() in show()
636 fn store(&self, kobj: Arc<dyn KObject>, buf: &[u8]) -> Result<usize, SystemError> { in store()
637 let dev = kobj.cast::<dyn Device>().map_err(|kobj| { in store()
640 kobj.name() in store()
/DragonOS/kernel/src/driver/net/
H A Dsysfs.rs105 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
106 let net_device = kobj.cast::<dyn NetDevice>().map_err(|_| { in show()
273 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
274 let net_deive = kobj.cast::<dyn NetDevice>().map_err(|_| { in show()
324 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
325 let net_device = kobj.cast::<dyn NetDevice>().map_err(|_| { in show()
375 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
376 let net_device = kobj.cast::<dyn NetDevice>().map_err(|_| { in show()
/DragonOS/kernel/src/driver/virtio/
H A Dsysfs.rs321 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
322 let dev = kobj.cast::<dyn VirtIODevice>().map_err(|_| { in show()
348 fn show(&self, kobj: Arc<dyn KObject>, buf: &mut [u8]) -> Result<usize, SystemError> { in show()
349 let dev = kobj.cast::<dyn VirtIODevice>().map_err(|_| { in show()
/DragonOS/docs/community/ChangeLog/V0.1.x/
H A DV0.1.9.md1604 完善设备驱动模型,基于kset、kobj来维护对象之间的关系 (#401)
1606 * 使用kobj和kset管理/sys文件夹下的对象
1610 * 完善设备驱动模型,基于kset、kobj来维护对象之间的关系