From: Simon Horman <horms@verge.net.au>
To: dyoung@redhat.com
Cc: mjg59@srcf.ucam.org, kexec@lists.infradead.org,
vgoyal@redhat.com, James.Bottomley@HansenPartnership.com,
bp@alien8.de, ebiederm@xmission.com, hpa@zytor.com,
kexec@lists.fedoraproject.org
Subject: Re: [patch 1/4] Add function get_bootparam
Date: Mon, 28 Oct 2013 09:38:00 +0900 [thread overview]
Message-ID: <20131028003800.GG849@verge.net.au> (raw)
In-Reply-To: <20131027041230.864225266@dhcp-16-126.nay.redhat.com>
On Sun, Oct 27, 2013 at 12:04:38PM +0800, dyoung@redhat.com wrote:
> Not only setup_subarch will get data from debugfs file
> boot_params/data, later code for adding efi_info will
> also need do same thing. Thus add a common function here
> for later use.
>
> Signed-off-by: Dave Young <dyoung@redhat.com>
> ---
> kexec/arch/i386/x86-linux-setup.c | 14 ++++++++++----
> 1 file changed, 10 insertions(+), 4 deletions(-)
>
> --- kexec-tools.orig/kexec/arch/i386/x86-linux-setup.c
> +++ kexec-tools/kexec/arch/i386/x86-linux-setup.c
> @@ -436,10 +436,9 @@ char *find_mnt_by_fsname(char *fsname)
> return mntdir;
> }
>
> -void setup_subarch(struct x86_linux_param_header *real_mode)
> +void get_bootparam(void *buf, off_t offset, size_t size)
> {
> int data_file;
> - const off_t offset = offsetof(typeof(*real_mode), hardware_subarch);
> char *debugfs_mnt;
> char filename[PATH_MAX];
>
> @@ -447,7 +446,7 @@ void setup_subarch(struct x86_linux_para
> if (!debugfs_mnt)
> return;
> snprintf(filename, PATH_MAX, "%s/%s", debugfs_mnt, "boot_params/data");
> - filename[PATH_MAX-1] = 0;
> + filename[PATH_MAX - 1] = 0;
> free(debugfs_mnt);
This change appears to be unrelated to the rest of the patch.
>
> data_file = open(filename, O_RDONLY);
> @@ -455,11 +454,18 @@ void setup_subarch(struct x86_linux_para
> return;
> if (lseek(data_file, offset, SEEK_SET) < 0)
> goto close;
> - read(data_file, &real_mode->hardware_subarch, sizeof(uint32_t));
> + read(data_file, buf, size);
> close:
> close(data_file);
> }
>
> +void setup_subarch(struct x86_linux_param_header *real_mode)
> +{
> + off_t offset = offsetof(typeof(*real_mode), hardware_subarch);
> +
> + get_bootparam(&real_mode->hardware_subarch, offset, sizeof(uint32_t));
> +}
> +
> void setup_linux_system_parameters(struct kexec_info *info,
> struct x86_linux_param_header *real_mode)
> {
>
>
> _______________________________________________
> kexec mailing list
> kexec@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/kexec
>
_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec
next prev parent reply other threads:[~2013-10-28 0:38 UTC|newest]
Thread overview: 38+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-27 4:04 [patch 0/4] kexec-tools: efi runtime support on kexec kernel dyoung
2013-10-27 4:04 ` [patch 1/4] Add function get_bootparam dyoung
2013-10-28 0:38 ` Simon Horman [this message]
2013-10-28 1:13 ` Dave Young
2013-10-28 2:30 ` Dave Young
2013-10-28 4:20 ` Simon Horman
2013-10-28 5:06 ` Dave Young
2013-10-28 6:08 ` Simon Horman
2013-10-27 4:04 ` [patch 2/4] remove extra acpi_rsdp command line for efi dyoung
2013-10-28 0:39 ` Simon Horman
2013-10-28 1:39 ` Dave Young
2013-10-28 9:42 ` Matthew Garrett
2013-10-28 9:54 ` Dave Young
2013-10-28 10:12 ` Matthew Garrett
2013-10-28 10:34 ` Dave Young
2013-10-28 10:39 ` Matthew Garrett
2013-10-28 10:45 ` Dave Young
2013-10-28 10:51 ` Matthew Garrett
2013-10-28 10:53 ` Dave Young
2013-10-29 3:05 ` Dave Young
2013-10-29 3:34 ` Dave Young
2013-10-29 8:50 ` Dave Young
2013-10-29 14:57 ` H. Peter Anvin
2013-10-28 16:10 ` Vivek Goyal
2013-10-29 2:04 ` Simon Horman
2013-10-29 2:36 ` Dave Young
2013-10-29 3:18 ` Dave Young
2013-10-30 0:45 ` Simon Horman
2013-10-29 13:27 ` Vivek Goyal
2013-10-27 4:04 ` [patch 3/4] Add efi_info in x86 setup header dyoung
2013-10-27 4:04 ` [patch 4/4] Passing efi related data via setup_data dyoung
2013-10-28 0:37 ` Simon Horman
2013-10-28 1:12 ` Dave Young
2013-10-28 3:02 ` Dave Young
2013-10-28 4:16 ` Simon Horman
2013-10-28 1:28 ` Dave Young
2013-10-28 10:41 ` H. Peter Anvin
2013-10-28 11:21 ` Dave Young
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20131028003800.GG849@verge.net.au \
--to=horms@verge.net.au \
--cc=James.Bottomley@HansenPartnership.com \
--cc=bp@alien8.de \
--cc=dyoung@redhat.com \
--cc=ebiederm@xmission.com \
--cc=hpa@zytor.com \
--cc=kexec@lists.fedoraproject.org \
--cc=kexec@lists.infradead.org \
--cc=mjg59@srcf.ucam.org \
--cc=vgoyal@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox