Extracted from firmware/pcbios/bios.c