Skip to content

Conversation

nicholasbishop
Copy link
Member

All device paths start with the same header containing type, subtype, and
length. Move these fields into a struct and use the struct in the two existing
device path types, DevicePath and AcpiDevicePath.

This also fixes the missing length field in AcpiDevicePath since it uses
the header type now.

The header fields in DevicePath and AcpiDevicePath are not public
because it's generally unsafe to modify the values since they determine how
the rest of the data in the node is interpreted.

All device paths start with the same header containing type, subtype, and
length. Move these fields into a struct and use the struct in the two existing
device path types, `DevicePath` and `AcpiDevicePath`.

This also fixes the missing `length` field in `AcpiDevicePath` since it uses
the header type now.

The `header` fields in `DevicePath` and `AcpiDevicePath` are not public
because it's generally unsafe to modify the values since they determine how
the rest of the data in the node is interpreted.
Copy link
Collaborator

@GabrielMajeri GabrielMajeri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. It's a small breaking change but it seems cleaner in the long run.

@GabrielMajeri GabrielMajeri merged commit ce3b344 into rust-osdev:master Jul 31, 2021
@nicholasbishop nicholasbishop deleted the bishop-device-path-header branch July 31, 2021 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants