Skip to content

Commit 821e832

Browse files
committed
uefi-raw: use new Boolean type
Use the new type introduced in ec6e0e6
1 parent 2273da4 commit 821e832

File tree

20 files changed

+72
-110
lines changed

20 files changed

+72
-110
lines changed

uefi-raw/CHANGELOG.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@ Details at <https://github.com/rust-osdev/uefi-rs/issues/1470>.
4242

4343
- Added `PAGE_SIZE` constant.
4444

45-
4645
# uefi-raw - 0.7.0 (2024-08-20)
4746

4847
## Added

uefi-raw/src/lib.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,12 @@ pub mod time;
3333

3434
mod status;
3535

36-
use core::ffi::c_void;
37-
use core::fmt::{self, Debug, Formatter};
3836
pub use status::Status;
3937
pub use uguid::{guid, Guid};
4038

39+
use core::ffi::c_void;
40+
use core::fmt::{self, Debug, Formatter};
41+
4142
/// Handle to an event structure.
4243
pub type Event = *mut c_void;
4344

uefi-raw/src/protocol/block.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Guid, Status};
3+
use crate::{guid, Boolean, Guid, Status};
44
use core::ffi::c_void;
55

66
/// Logical block address.
@@ -11,11 +11,11 @@ pub type Lba = u64;
1111
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
1212
pub struct BlockIoMedia {
1313
pub media_id: u32,
14-
pub removable_media: bool,
15-
pub media_present: bool,
16-
pub logical_partition: bool,
17-
pub read_only: bool,
18-
pub write_caching: bool,
14+
pub removable_media: Boolean,
15+
pub media_present: Boolean,
16+
pub logical_partition: Boolean,
17+
pub read_only: Boolean,
18+
pub write_caching: Boolean,
1919
pub block_size: u32,
2020
pub io_align: u32,
2121
pub last_block: Lba,
@@ -33,7 +33,7 @@ pub struct BlockIoMedia {
3333
pub struct BlockIoProtocol {
3434
pub revision: u64,
3535
pub media: *const BlockIoMedia,
36-
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: bool) -> Status,
36+
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: Boolean) -> Status,
3737
pub read_blocks: unsafe extern "efiapi" fn(
3838
this: *const Self,
3939
media_id: u32,

uefi-raw/src/protocol/console.rs

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
pub mod serial;
44

5-
use crate::{guid, Char16, Event, Guid, PhysicalAddress, Status};
5+
use crate::{guid, Boolean, Char16, Event, Guid, PhysicalAddress, Status};
66
use bitflags::bitflags;
77
use core::ptr;
88

@@ -44,7 +44,7 @@ pub struct AbsolutePointerState {
4444
#[derive(Debug)]
4545
#[repr(C)]
4646
pub struct AbsolutePointerProtocol {
47-
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: u8) -> Status,
47+
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: Boolean) -> Status,
4848
pub get_state:
4949
unsafe extern "efiapi" fn(this: *const Self, state: *mut AbsolutePointerState) -> Status,
5050
pub wait_for_input: Event,
@@ -65,7 +65,7 @@ pub struct InputKey {
6565
#[derive(Debug)]
6666
#[repr(C)]
6767
pub struct SimpleTextInputProtocol {
68-
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: bool) -> Status,
68+
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended_verification: Boolean) -> Status,
6969
pub read_key_stroke: unsafe extern "efiapi" fn(this: *mut Self, key: *mut InputKey) -> Status,
7070
pub wait_for_key: Event,
7171
}
@@ -82,13 +82,13 @@ pub struct SimpleTextOutputMode {
8282
pub attribute: i32,
8383
pub cursor_column: i32,
8484
pub cursor_row: i32,
85-
pub cursor_visible: bool,
85+
pub cursor_visible: Boolean,
8686
}
8787

8888
#[derive(Debug)]
8989
#[repr(C)]
9090
pub struct SimpleTextOutputProtocol {
91-
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended: bool) -> Status,
91+
pub reset: unsafe extern "efiapi" fn(this: *mut Self, extended: Boolean) -> Status,
9292
pub output_string: unsafe extern "efiapi" fn(this: *mut Self, string: *const Char16) -> Status,
9393
pub test_string: unsafe extern "efiapi" fn(this: *mut Self, string: *const Char16) -> Status,
9494
pub query_mode: unsafe extern "efiapi" fn(
@@ -102,7 +102,7 @@ pub struct SimpleTextOutputProtocol {
102102
pub clear_screen: unsafe extern "efiapi" fn(this: *mut Self) -> Status,
103103
pub set_cursor_position:
104104
unsafe extern "efiapi" fn(this: *mut Self, column: usize, row: usize) -> Status,
105-
pub enable_cursor: unsafe extern "efiapi" fn(this: *mut Self, visible: bool) -> Status,
105+
pub enable_cursor: unsafe extern "efiapi" fn(this: *mut Self, visible: Boolean) -> Status,
106106
pub mode: *mut SimpleTextOutputMode,
107107
}
108108

@@ -126,16 +126,16 @@ pub struct SimplePointerState {
126126
pub relative_movement_x: i32,
127127
pub relative_movement_y: i32,
128128
pub relative_movement_z: i32,
129-
pub left_button: u8,
130-
pub right_button: u8,
129+
pub left_button: Boolean,
130+
pub right_button: Boolean,
131131
}
132132

133133
#[derive(Debug)]
134134
#[repr(C)]
135135
pub struct SimplePointerProtocol {
136136
pub reset: unsafe extern "efiapi" fn(
137137
this: *mut SimplePointerProtocol,
138-
extended_verification: bool,
138+
extended_verification: Boolean,
139139
) -> Status,
140140
pub get_state: unsafe extern "efiapi" fn(
141141
this: *mut SimplePointerProtocol,

uefi-raw/src/protocol/device_path.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
mod device_path_gen;
44

5-
use crate::{guid, Char16, Guid};
5+
use crate::{guid, Boolean, Char16, Guid};
66

77
pub use device_path_gen::{acpi, bios_boot_spec, end, hardware, media, messaging};
88

@@ -189,13 +189,13 @@ impl DeviceSubType {
189189
pub struct DevicePathToTextProtocol {
190190
pub convert_device_node_to_text: unsafe extern "efiapi" fn(
191191
device_node: *const DevicePathProtocol,
192-
display_only: bool,
193-
allow_shortcuts: bool,
192+
display_only: Boolean,
193+
allow_shortcuts: Boolean,
194194
) -> *const Char16,
195195
pub convert_device_path_to_text: unsafe extern "efiapi" fn(
196196
device_path: *const DevicePathProtocol,
197-
display_only: bool,
198-
allow_shortcuts: bool,
197+
display_only: Boolean,
198+
allow_shortcuts: Boolean,
199199
) -> *const Char16,
200200
}
201201

uefi-raw/src/protocol/file_system.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::time::Time;
4-
use crate::{guid, Char16, Event, Guid, Status};
4+
use crate::{guid, Boolean, Char16, Event, Guid, Status};
55
use bitflags::bitflags;
66
use core::ffi::c_void;
77

@@ -153,7 +153,7 @@ impl FileInfo {
153153
#[repr(C)]
154154
pub struct FileSystemInfo {
155155
pub size: u64,
156-
pub read_only: u8,
156+
pub read_only: Boolean,
157157
pub volume_size: u64,
158158
pub free_space: u64,
159159
pub block_size: u32,

uefi-raw/src/protocol/media.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

33
use crate::protocol::device_path::DevicePathProtocol;
4-
use crate::{guid, Guid, Status};
4+
use crate::{guid, Boolean, Guid, Status};
55
use core::ffi::c_void;
66

77
#[derive(Debug)]
@@ -10,7 +10,7 @@ pub struct LoadFileProtocol {
1010
pub load_file: unsafe extern "efiapi" fn(
1111
this: *mut LoadFileProtocol,
1212
file_path: *const DevicePathProtocol,
13-
boot_policy: bool,
13+
boot_policy: Boolean,
1414
buffer_size: *mut usize,
1515
buffer: *mut c_void,
1616
) -> Status,
@@ -26,7 +26,7 @@ pub struct LoadFile2Protocol {
2626
pub load_file: unsafe extern "efiapi" fn(
2727
this: *mut LoadFile2Protocol,
2828
file_path: *const DevicePathProtocol,
29-
boot_policy: bool,
29+
boot_policy: Boolean,
3030
buffer_size: *mut usize,
3131
buffer: *mut c_void,
3232
) -> Status,

uefi-raw/src/protocol/network/dhcp4.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Char8, Event, Guid, Ipv4Address, MacAddress, Status};
3+
use crate::{guid, Boolean, Char8, Event, Guid, Ipv4Address, MacAddress, Status};
44
use core::ffi::c_void;
55

66
newtype_enum! {
@@ -150,7 +150,7 @@ pub struct Dhcp4Protocol {
150150
pub start: unsafe extern "efiapi" fn(this: *mut Self, completion_event: Event) -> Status,
151151
pub renew_rebind: unsafe extern "efiapi" fn(
152152
this: *mut Self,
153-
rebind_request: bool,
153+
rebind_request: Boolean,
154154
completion_event: Event,
155155
) -> Status,
156156
pub release: unsafe extern "efiapi" fn(this: *mut Self) -> Status,

uefi-raw/src/protocol/network/http.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// SPDX-License-Identifier: MIT OR Apache-2.0
22

3-
use crate::{guid, Char16, Char8, Event, Guid, Ipv4Address, Ipv6Address, Status};
3+
use crate::{guid, Boolean, Char16, Char8, Event, Guid, Ipv4Address, Ipv6Address, Status};
44
use core::ffi::c_void;
55
use core::fmt::{self, Debug, Formatter};
66
use core::ptr;
@@ -10,7 +10,7 @@ use core::ptr;
1010
pub struct HttpConfigData {
1111
pub http_version: HttpVersion,
1212
pub time_out_millisec: u32,
13-
pub local_addr_is_ipv6: bool,
13+
pub local_addr_is_ipv6: Boolean,
1414
pub access_point: HttpAccessPoint,
1515
}
1616

@@ -26,7 +26,7 @@ newtype_enum! {
2626
#[derive(Clone, Copy, Debug, Default, Eq, PartialEq, Ord, PartialOrd, Hash)]
2727
#[repr(C)]
2828
pub struct HttpV4AccessPoint {
29-
pub use_default_addr: bool,
29+
pub use_default_addr: Boolean,
3030
pub local_address: Ipv4Address,
3131
pub local_subnet: Ipv4Address,
3232
pub local_port: u16,

uefi-raw/src/table/boot.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
55
use crate::protocol::device_path::DevicePathProtocol;
66
use crate::table::Header;
7-
use crate::{Char16, Event, Guid, Handle, PhysicalAddress, Status, VirtualAddress};
7+
use crate::{Boolean, Char16, Event, Guid, Handle, PhysicalAddress, Status, VirtualAddress};
88
use bitflags::bitflags;
99
use core::ffi::c_void;
1010
use core::ops::RangeInclusive;
@@ -106,7 +106,7 @@ pub struct BootServices {
106106

107107
// Image services
108108
pub load_image: unsafe extern "efiapi" fn(
109-
boot_policy: u8,
109+
boot_policy: Boolean,
110110
parent_image_handle: Handle,
111111
device_path: *const DevicePathProtocol,
112112
source_buffer: *const u8,
@@ -143,7 +143,7 @@ pub struct BootServices {
143143
controller: Handle,
144144
driver_image: Handle,
145145
remaining_device_path: *const DevicePathProtocol,
146-
recursive: bool,
146+
recursive: Boolean,
147147
) -> Status,
148148
pub disconnect_controller: unsafe extern "efiapi" fn(
149149
controller: Handle,

0 commit comments

Comments
 (0)