Skip to content
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

Replace win64 with efiapi #44

Merged
merged 1 commit into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 13 additions & 13 deletions src/fde.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ pub const HII_STRING_PROTOCOL_GUID: Guid = Guid(0xfd96974, 0x23aa, 0x4cdc, [0xb9

#[repr(C)]
pub struct HiiStringProtocol {
pub NewString: extern "win64" fn(), //TODO
pub GetString: extern "win64" fn(
pub NewString: extern "efiapi" fn(), //TODO
pub GetString: extern "efiapi" fn(
&HiiStringProtocol,
Language: *const u8,
PackageList: HiiHandle,
Expand All @@ -38,9 +38,9 @@ pub struct HiiStringProtocol {
StringSize: &mut usize,
StringFontInfo: usize, // TODO
) -> Status,
pub SetString: extern "win64" fn(), //TODO
pub GetLanguages: extern "win64" fn(), //TODO
pub GetSecondaryLanguages: extern "win64" fn(), //TODO
pub SetString: extern "efiapi" fn(), //TODO
pub GetLanguages: extern "efiapi" fn(), //TODO
pub GetSecondaryLanguages: extern "efiapi" fn(), //TODO
}

impl HiiStringProtocol {
Expand Down Expand Up @@ -214,14 +214,14 @@ pub struct StatementErrorInfo {
pub TimeOut: u8,
}

pub type ValidateQuestion = extern "win64" fn (
pub type ValidateQuestion = extern "efiapi" fn (
Form: &Form,
Statement: &Statement,
Value: &HiiValue,
ErrorInfo: &mut StatementErrorInfo,
) -> u32;

pub type PasswordCheck = extern "win64" fn(
pub type PasswordCheck = extern "efiapi" fn(
Form: &Form,
Statement: &Statement,
PasswordString: *const u16
Expand Down Expand Up @@ -312,9 +312,9 @@ pub struct UserInput {
#[repr(C)]
#[allow(non_snake_case)]
pub struct Fde {
pub FormDisplay: extern "win64" fn(FormData: &Form, UserInputData: &mut UserInput) -> Status,
pub ExitDisplay: extern "win64" fn(),
pub ConfirmDataChange: extern "win64" fn() -> usize,
pub FormDisplay: extern "efiapi" fn(FormData: &Form, UserInputData: &mut UserInput) -> Status,
pub ExitDisplay: extern "efiapi" fn(),
pub ConfirmDataChange: extern "efiapi" fn() -> usize,
}

static mut DISPLAY: *mut Display = ptr::null_mut();
Expand Down Expand Up @@ -1029,18 +1029,18 @@ fn form_display_inner(form: &Form, user_input: &mut UserInput) -> Result<()> {
Ok(())
}

extern "win64" fn form_display(form: &Form, user_input: &mut UserInput) -> Status {
extern "efiapi" fn form_display(form: &Form, user_input: &mut UserInput) -> Status {
match form_display_inner(form, user_input) {
Ok(()) => Status::from_output(0),
Err(err) => Status::from_residual(err),
}
}

extern "win64" fn exit_display() {
extern "efiapi" fn exit_display() {
debugln!("exit_display");
}

extern "win64" fn confirm_data_change() -> usize {
extern "efiapi" fn confirm_data_change() -> usize {
debugln!("confirm_data_change");
0
}
Expand Down
4 changes: 2 additions & 2 deletions src/rng.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,12 @@ impl Protocol<RngProtocol> for Rng {

#[repr(C)]
pub struct RngProtocol {
pub GetInfo: extern "win64" fn(
pub GetInfo: extern "efiapi" fn(
&RngProtocol,
RNGAlgorithmListSize: &mut usize,
RNGAlgorithmList: *mut Guid,
) -> Status,
pub GetRNG: extern "win64" fn(
pub GetRNG: extern "efiapi" fn(
&RngProtocol,
RNGAlgorithm: *const Guid,
RNGValueLength: usize,
Expand Down
4 changes: 2 additions & 2 deletions src/security.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ fn confirm(display: &mut Display) -> Result<()> {
}
}

extern "win64" fn run() -> bool {
extern "efiapi" fn run() -> bool {
let access = match unsafe { AccessLpcDirect::new(UefiTimeout::new(100_000)) } {
Ok(ok) => ok,
Err(err) => {
Expand Down Expand Up @@ -328,7 +328,7 @@ extern "win64" fn run() -> bool {

pub const SYSTEM76_SECURITY_PROTOCOL_GUID: Guid = Guid(0x764247c4, 0xa859, 0x4a6b, [0xb5, 0x00, 0xed, 0x5d, 0x7a, 0x70, 0x7d, 0xd4]);
pub struct System76SecurityProtocol {
pub Run: extern "win64" fn() -> bool,
pub Run: extern "efiapi" fn() -> bool,
}

pub fn install() -> Result<()> {
Expand Down