-
-
Notifications
You must be signed in to change notification settings - Fork 145
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
实现Ps/2鼠标驱动 #500
实现Ps/2鼠标驱动 #500
Conversation
…47742618/DragonOS into patch-serio-device-and-driver
…agonOS into patch-mouse-driver
self.inner.lock().devices.clone() | ||
} | ||
|
||
fn add_device(&self, device: Arc<dyn crate::driver::base::device::Device>) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这种带前缀的都改一下,不然将来如果这个Device
移动文件位置了,修代码很困难
} | ||
|
||
fn dev_groups(&self) -> &'static [&'static dyn crate::filesystem::sysfs::AttributeGroup] { | ||
return &[&SerioDeviceAttrGroup]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
默认属性组应该由那个SerioManager之类的东西去负责创建,而不是每个驱动都写自己有这个属性。
_char: u8, | ||
_int: u8, | ||
) -> Result<(), system_error::SystemError> { | ||
todo!() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
中断处理的地方,可以接到这里。
) -> Result<usize, SystemError> { | ||
let guard = self.inner.lock_irqsave(); | ||
if offset > 0 && offset + len < guard.buf.len() { | ||
buf.copy_from_slice(&guard.buf[offset..offset + len]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个buf我在想能否开大一点,然后通过一个index来记录它目前是正在操作第几位(或者用ringbuffer库)。我担心就是,用户程序读不过来。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
实现Ps/2鼠标驱动
No description provided.