/* * Copyright (C) 2016 Linaro Ltd; <ard.biesheuvel@linaro.org> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software Foundation. * */#include <linux/efi.h>#include <asm/efi.h>#include "efistub.h"structefi_rng_protocol{efi_status_t(*get_info)(structefi_rng_protocol*,unsignedlong*,efi_guid_t*);efi_status_t(*get_rng)(structefi_rng_protocol*,efi_guid_t*,unsignedlong,u8*out);};efi_status_tefi_get_random_bytes(efi_system_table_t*sys_table_arg,unsignedlongsize,u8*out){efi_guid_trng_proto=EFI_RNG_PROTOCOL_GUID;efi_status_tstatus;structefi_rng_protocol*rng;status=efi_call_early(locate_protocol,&rng_proto,NULL,(void**)&rng);if(status!=EFI_SUCCESS)returnstatus;returnrng->get_rng(rng,NULL,size,out);}