diff options
Diffstat (limited to 'arch/x86/boot/compressed')
| -rw-r--r-- | arch/x86/boot/compressed/Makefile | 5 | ||||
| -rw-r--r-- | arch/x86/boot/compressed/eboot.c | 47 | 
2 files changed, 49 insertions, 3 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile index 8a84501acb1..5ef205c5f37 100644 --- a/arch/x86/boot/compressed/Makefile +++ b/arch/x86/boot/compressed/Makefile @@ -4,7 +4,7 @@  # create a compressed vmlinux image from the original vmlinux  # -targets := vmlinux.lds vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo head_$(BITS).o misc.o string.o cmdline.o early_serial_console.o piggy.o +targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma vmlinux.bin.xz vmlinux.bin.lzo  KBUILD_CFLAGS := -m$(BITS) -D__KERNEL__ $(LINUX_INCLUDE) -O2  KBUILD_CFLAGS += -fno-strict-aliasing -fPIC @@ -29,7 +29,6 @@ VMLINUX_OBJS = $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \  	$(obj)/piggy.o  $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone -$(obj)/efi_stub_$(BITS).o: KBUILD_CLFAGS += -fshort-wchar -mno-red-zone  ifeq ($(CONFIG_EFI_STUB), y)  	VMLINUX_OBJS += $(obj)/eboot.o $(obj)/efi_stub_$(BITS).o @@ -43,7 +42,7 @@ OBJCOPYFLAGS_vmlinux.bin :=  -R .comment -S  $(obj)/vmlinux.bin: vmlinux FORCE  	$(call if_changed,objcopy) -targets += vmlinux.bin.all vmlinux.relocs +targets += $(patsubst $(obj)/%,%,$(VMLINUX_OBJS)) vmlinux.bin.all vmlinux.relocs  CMD_RELOCS = arch/x86/tools/relocs  quiet_cmd_relocs = RELOCS  $@ diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c index c205035a6b9..8615f758182 100644 --- a/arch/x86/boot/compressed/eboot.c +++ b/arch/x86/boot/compressed/eboot.c @@ -251,6 +251,51 @@ static void find_bits(unsigned long mask, u8 *pos, u8 *size)  	*size = len;  } +static efi_status_t setup_efi_vars(struct boot_params *params) +{ +	struct setup_data *data; +	struct efi_var_bootdata *efidata; +	u64 store_size, remaining_size, var_size; +	efi_status_t status; + +	if (!sys_table->runtime->query_variable_info) +		return EFI_UNSUPPORTED; + +	data = (struct setup_data *)(unsigned long)params->hdr.setup_data; + +	while (data && data->next) +		data = (struct setup_data *)(unsigned long)data->next; + +	status = efi_call_phys4(sys_table->runtime->query_variable_info, +				EFI_VARIABLE_NON_VOLATILE | +				EFI_VARIABLE_BOOTSERVICE_ACCESS | +				EFI_VARIABLE_RUNTIME_ACCESS, &store_size, +				&remaining_size, &var_size); + +	if (status != EFI_SUCCESS) +		return status; + +	status = efi_call_phys3(sys_table->boottime->allocate_pool, +				EFI_LOADER_DATA, sizeof(*efidata), &efidata); + +	if (status != EFI_SUCCESS) +		return status; + +	efidata->data.type = SETUP_EFI_VARS; +	efidata->data.len = sizeof(struct efi_var_bootdata) - +		sizeof(struct setup_data); +	efidata->data.next = 0; +	efidata->store_size = store_size; +	efidata->remaining_size = remaining_size; +	efidata->max_var_size = var_size; + +	if (data) +		data->next = (unsigned long)efidata; +	else +		params->hdr.setup_data = (unsigned long)efidata; + +} +  static efi_status_t setup_efi_pci(struct boot_params *params)  {  	efi_pci_io_protocol *pci; @@ -1157,6 +1202,8 @@ struct boot_params *efi_main(void *handle, efi_system_table_t *_table,  	setup_graphics(boot_params); +	setup_efi_vars(boot_params); +  	setup_efi_pci(boot_params);  	status = efi_call_phys3(sys_table->boottime->allocate_pool,  |