disk: Limit size of fastest_xfer_size on UEFI

This commit is contained in:
mintsuki 2022-01-06 11:03:12 +01:00
parent a494a1d47a
commit 17c59eebd4

View File

@ -14,6 +14,9 @@
#include <mm/pmm.h>
#include <sys/cpu.h>
#define DEFAULT_FASTEST_XFER_SIZE 64
#define MAX_FASTEST_XFER_SIZE 512
#define MAX_VOLUMES 64
#if bios == 1
@ -443,7 +446,9 @@ void disk_create_index(void) {
}
if (block->fastest_xfer_size == 0) {
block->fastest_xfer_size = 64;
block->fastest_xfer_size = DEFAULT_FASTEST_XFER_SIZE;
} else if (block->fastest_xfer_size >= MAX_FASTEST_XFER_SIZE) {
block->fastest_xfer_size = MAX_FASTEST_XFER_SIZE;
}
if (gpt_get_guid(&block->guid, block)) {