Skip to content

acpi: fix build errors #240

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

Merged
merged 1 commit into from
Feb 1, 2025
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
3 changes: 2 additions & 1 deletion acpi/src/handler.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use core::{fmt, ops::Deref, pin::Pin, ptr::NonNull};
use core::{fmt, ops::{Deref, DerefMut}, pin::Pin, ptr::NonNull};

/// Describes a physical mapping created by `AcpiHandler::map_physical_region` and unmapped by
/// `AcpiHandler::unmap_physical_region`. The region mapped must be at least `size_of::<T>()`
Expand Down Expand Up @@ -102,6 +102,7 @@ where

impl<H, T> DerefMut for PhysicalMapping<H, T>
where
T: Unpin,
H: AcpiHandler,
{
fn deref_mut(&mut self) -> &mut T {
Expand Down
4 changes: 2 additions & 2 deletions acpi/src/madt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ pub enum MadtError {
/// This type only contains the static portion, and then uses pointer arithmetic to parse the following entries.
/// To make this sound, this type is `!Unpin` - this prevents you from getting anything other than a `Pin<&Madt>`
/// out of a `PhysicalMapping`, thereby preventing a `Madt` from being moved before [`Madt::entries`] is called.
#[repr(C)]
#[repr(C, packed)]
#[derive(Debug)]
pub struct Madt {
pub header: SdtHeader,
Expand All @@ -61,7 +61,7 @@ unsafe impl AcpiTable for Madt {
}

impl Madt {
pub fn get_mpwk_mailbox_addr(&self) -> Result<u64, AcpiError> {
pub fn get_mpwk_mailbox_addr(self: Pin<&Self>) -> Result<u64, AcpiError> {
for entry in self.entries() {
if let MadtEntry::MultiprocessorWakeup(entry) = entry {
return Ok(entry.mailbox_address);
Expand Down
2 changes: 1 addition & 1 deletion acpi/src/platform/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ where
H: AcpiHandler,
{
let madt = tables.find_table::<Madt>()?;
let mailbox_addr = madt.get_mpwk_mailbox_addr()?;
let mailbox_addr = madt.get().get_mpwk_mailbox_addr()?;
let mut mpwk_mapping = unsafe {
handler.map_physical_region::<MultiprocessorWakeupMailbox>(
mailbox_addr as usize,
Expand Down
Loading