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

Prepare new version of acpi #197

Merged
merged 10 commits into from
Sep 13, 2023
Merged

Conversation

IsaacWoods
Copy link
Member

@IsaacWoods IsaacWoods commented Sep 2, 2023

⚠️ This makes breaking changes to acpi , and so must not be merged without a major version bump ⚠️

This PR prepares to publish a new version of acpi. Mainly, it tidies up the edges around the allocator_api feature by adding a new alloc feature that just uses the globally-set allocator; this will be the behaviour the majority of users want.

It's also an opportunity to round off any rough edges that only comes around occasionally, which is why it's taken so long for me to get around to. Apologies for the inordinately long time this has seemed to take though, everyone - it's one of those things that has slipped again and again, and now looks like an embarrassingly small diff.

That being said - if there's any changes anyone would like to see made before another version of acpi is released, now is the chance - it will likely be a similarly long delay to me publishing the next one ;)

  • Add alloc feature + relevant new methods
  • Review documentation
  • Review README
  • Move functionality of rsdp back into acpi
  • Publish new version of acpi
  • Publish new version of rsdp (with readme note marking deprecation)

Rearranging the imported names was necessary to add the `alloc` feature
anyways, and I thought this looked a little neater while I was here.
Most people won't care much about the "new" `allocator_api` work, so add
`new` methods that just use the globally-set allocator too.
This is apparently better practice.
`aml` should also be moved to the 2021 edition at some point
@IsaacWoods
Copy link
Member Author

IsaacWoods commented Sep 2, 2023

A thought that's emerged from doing this is, of course, that we no longer really require the rsdp crate to be separate from acpi - the initial intention here was that rsdp contained just enough code to be useful in a bootloader, without requiring alloc, because at the time it didn't seem worth it to rewrite the crate to divide alloc and non-alloc code (I think this would've been pre-allocator_api). Now, of course, that has already been done, so rebalances that trade-off.

We could move all of the functionality of rsdp back into acpi in a backwards-compatible way, so this doesn't need to be decided now, but a potential idea would be to deprecate the rsdp crate in favour of using a slimmed-down acpi with allocator_api and alloc disabled in those environments. Not sure if there are any potential downsides, but considerable upside is getting rid of one of the crates...

Edit: actually this wouldn't be backwards-compatible, because types created manually from rsdp would no longer be interoperable with acpi code. This therefore seems like a good time to consider doing this.

Now `acpi` can be used from an allocator-less environment, the original
motivation of the `rsdp` crate has been removed. We can therefore move
towards deprecating it, and maintaining one less crate!
@IsaacWoods
Copy link
Member Author

@alnyan this PR now moves AcpiHandler back into acpi, which is a breaking change. This gives us a good opportunity to consider whether, in the future, you'd want more methods on the trait to tie into your acpi_system work (if you imagine wanting to utilise a shared AcpiHandler to avoid the duplication of them, but this is obviously up to you).

No hurry at all but just giving you a heads up in case you have a good idea of additions that may need to be made - this could be done before this release to avoid another breaking change in the future.

@IsaacWoods
Copy link
Member Author

🚀 acpi v5.0.0 has been published, and the rsdp has been deprecated.

This has been a long time coming, and will hopefully be the last major version needed for acpi for a while. These changes will need to be publicised in the rust-osdev newsletter, and then remaining traces of the rsdp crate (readme links etc.) can be removed in due course.

@IsaacWoods IsaacWoods merged commit bb664d0 into rust-osdev:main Sep 13, 2023
1 check passed
@IsaacWoods IsaacWoods deleted the new_version branch September 13, 2023 01:05
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.

1 participant