From 3629d4f36d5fb635329f4b60f31dc5e7ea77f40e Mon Sep 17 00:00:00 2001 From: Gil Mendes Date: 2018年9月22日 10:03:43 +0100 Subject: [PATCH] Implement set_watchdog_timer --- src/table/boot.rs | 7 ++++++- uefi-test-runner/src/boot/misc.rs | 10 ++++++++++ uefi-test-runner/src/boot/mod.rs | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 uefi-test-runner/src/boot/misc.rs diff --git a/src/table/boot.rs b/src/table/boot.rs index 6b5a78afe..c894640fa 100644 --- a/src/table/boot.rs +++ b/src/table/boot.rs @@ -50,7 +50,7 @@ pub struct BootServices { // Misc services get_next_monotonic_count: usize, stall: extern "C" fn(usize) -> Status, - set_watchdog_timer: usize, + set_watchdog_timer: extern "C" fn(timeout: usize, watchdog_code: u64, data_size: usize, watchdog_data: *mut u16) -> Status, // Driver support services connect_controller: usize, @@ -236,6 +236,11 @@ impl BootServices { assert_eq!((self.stall)(time), Status::Success); } + /// Set the watchdog timer. + pub fn set_watchdog_timer(&self, timeout: usize, watchdog_code: u64, data_size: usize, watchdog_data: *mut u16) { + assert_eq!((self.set_watchdog_timer)(timeout, watchdog_code, data_size, watchdog_data), Status::Success); + } + /// Copies memory from source to destination. The buffers can overlap. pub fn memmove(&self, dest: *mut u8, src: *const u8, size: usize) { (self.copy_mem)(dest, src, size); diff --git a/uefi-test-runner/src/boot/misc.rs b/uefi-test-runner/src/boot/misc.rs new file mode 100644 index 000000000..e9a8e5511 --- /dev/null +++ b/uefi-test-runner/src/boot/misc.rs @@ -0,0 +1,10 @@ +use uefi::table::boot::BootServices; +use core::ptr; + +pub fn test(bt: &BootServices) { + test_watchdog(bt); +} + +fn test_watchdog(bt: &BootServices) { + bt.set_watchdog_timer(0, 0, 0, ptr::null_mut()); +} diff --git a/uefi-test-runner/src/boot/mod.rs b/uefi-test-runner/src/boot/mod.rs index 9e637b18e..624d13f50 100644 --- a/uefi-test-runner/src/boot/mod.rs +++ b/uefi-test-runner/src/boot/mod.rs @@ -2,6 +2,8 @@ use uefi::table::boot::BootServices; pub fn test(bt: &BootServices) { memory::test(bt); + misc::test(bt); } mod memory; +mod misc;

AltStyle によって変換されたページ (->オリジナル) /