Only require alignment of 4 bytes for rsdp

This commit is contained in:
Jeremy Soller
2020-04-19 08:49:42 -06:00
parent 315343be41
commit abf971eaee

View File

@@ -53,7 +53,7 @@ impl RSDP {
fn slice_to_rsdp(slice: &[u8]) -> Option<&RSDP> {
let ptr = slice.as_ptr() as usize;
if slice.len() >= mem::size_of::<RSDP>() && ptr & (!0x7) == ptr {
if slice.len() >= mem::size_of::<RSDP>() && ptr & (!0x3) == ptr {
let rsdp = unsafe { &*(slice.as_ptr() as *const RSDP) };
// TODO: Validate
Some(rsdp)