/* @ram_start: start address of a RAM memory area @ram_end: end address of a RAM memory area @ram_top: max address to be used as conventional memory Return: status code  */
efi_status_t efi_add_conventional_memory_map(u64 ram_start, u64 ram_end, u64 ram_top)
/* @ram_start: start address of a RAM memory area @ram_end: end address of a RAM memory area @ram_top: max address to be used as conventional memory Return: status code  */
efi_status_t efi_add_conventional_memory_map(u64 ram_start, u64 ram_end, u64 ram_top)
{
	u64 pages;
	ram_end &= ~EFI_PAGE_MASK;
	ram_start = (ram_start + EFI_PAGE_MASK) & ~EFI_PAGE_MASK;
	if (ram_end <= ram_start) {
		return EFI_INVALID_PARAMETER;
	}
	pages = (ram_end - ram_start) >> EFI_PAGE_SHIFT;
	efi_add_memory_map(ram_start, pages,
			   EFI_CONVENTIONAL_MEMORY, false);
	if (ram_top < ram_start) {
		efi_add_memory_map(ram_start, pages,
				   EFI_BOOT_SERVICES_DATA, true);
	} else if ((ram_top >= ram_start) && (ram_top < ram_end)) {
		pages = (ram_end - ram_top) >> EFI_PAGE_SHIFT;
		efi_add_memory_map(ram_top, pages,
				   EFI_BOOT_SERVICES_DATA, true);
	}
	return EFI_SUCCESS;
}