Runji Wang 5 жил өмнө
parent
commit
dfa70e1425
2 өөрчлөгдсөн 20 нэмэгдсэн , 0 устгасан
  1. 10 0
      src/gpu.rs
  2. 10 0
      src/net.rs

+ 10 - 0
src/gpu.rs

@@ -64,6 +64,16 @@ impl VirtIOGpu<'_> {
         })
     }
 
+    /// Acknowledge interrupt.
+    pub fn ack_interrupt(&mut self) -> bool {
+        self.header.ack_interrupt()
+    }
+
+    /// Get the resolution (width, height).
+    pub fn resolution(&self) -> (u32, u32) {
+        (self.rect.width, self.rect.height)
+    }
+
     /// Setup framebuffer
     pub fn setup_framebuffer(&mut self) -> Result<&mut [u8]> {
         // get display info

+ 10 - 0
src/net.rs

@@ -48,6 +48,16 @@ impl VirtIONet<'_> {
         })
     }
 
+    /// Acknowledge interrupt.
+    pub fn ack_interrupt(&mut self) -> bool {
+        self.header.ack_interrupt()
+    }
+
+    /// Get MAC address.
+    pub fn mac(&self) -> EthernetAddress {
+        self.mac
+    }
+
     /// Whether can send packet.
     pub fn can_send(&self) -> bool {
         self.send_queue.available_desc() >= 2