rust-osdev / x86_64

Library to program x86_64 hardware.
https://docs.rs/x86_64
Apache License 2.0
797 stars 132 forks source link

Allow the GDT to be of any length #360

Closed josephlr closed 2 years ago

josephlr commented 2 years ago

This uses a const generic MAX parameter to specify the length. This is arguably a breaking change as it bumps the MSRV to 1.59 though its use of default const generics. It also can make some function call require additional type annotations:

// Before
let gdt = GlobalDescriptorTable::from_raw_slice(slice);
// After
let gdt = GlobalDescriptorTable::<8>::from_raw_slice(slice);

Fixes #333

Signed-off-by: Joe Richey joerichey@google.com

josephlr commented 2 years ago

@Freax13 I updated the comments and messages. I think even with @phil-opp's approval I also need yours to merge this.