From patchwork Thu Jan 17 12:49:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zhijian X-Patchwork-Id: 1026625 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=cn.fujitsu.com Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43gP9J3wNQz9sBQ for ; Thu, 17 Jan 2019 23:52:04 +1100 (AEDT) Received: from localhost ([127.0.0.1]:43520 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk79O-00078L-H1 for incoming@patchwork.ozlabs.org; Thu, 17 Jan 2019 07:52:02 -0500 Received: from eggs.gnu.org ([209.51.188.92]:45788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gk779-0005lW-1n for qemu-devel@nongnu.org; Thu, 17 Jan 2019 07:49:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gk777-00020d-Pa for qemu-devel@nongnu.org; Thu, 17 Jan 2019 07:49:43 -0500 Received: from mga11.intel.com ([192.55.52.93]:36270) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gk777-0001rr-GB for qemu-devel@nongnu.org; Thu, 17 Jan 2019 07:49:41 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2019 04:49:27 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,488,1539673200"; d="scan'208";a="115392190" Received: from sunausti-mobl.ccr.corp.intel.com (HELO haswell-OptiPlex-9020.ccr.corp.intel.com) ([10.255.29.222]) by fmsmga007.fm.intel.com with ESMTP; 17 Jan 2019 04:49:25 -0800 From: Li Zhijian To: qemu-devel@nongnu.org, mst@redhat.com, peter.maydell@linaro.org Date: Thu, 17 Jan 2019 20:49:03 +0800 Message-Id: <1547729344-3895-4-git-send-email-lizhijian@cn.fujitsu.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1547729344-3895-1-git-send-email-lizhijian@cn.fujitsu.com> References: <1547729344-3895-1-git-send-email-lizhijian@cn.fujitsu.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.55.52.93 Subject: [Qemu-devel] [PATCH v6 3/4] i386: import & use bootparam.h X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: philip.li@intel.com, zhijianx.li@intel.com, philmd@redhat.com, Li Zhijian , Stefano Garzarella Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" it's from v4.20-rc5. CC: Stefano Garzarella CC: Michael S. Tsirkin Signed-off-by: Li Zhijian Reviewed-by: Michael S. Tsirkin Reviewed-by: Stefano Garzarella --- V6: Fix line over 80 characters && use double quates for all pathes (Stefano Garzarella) V5: add reviewed-by tag V4: use scirpt to import bootparam.h (Michael S. Tsirkin) V3: new patch Signed-off-by: Li Zhijian --- hw/i386/pc.c | 8 +------ include/standard-headers/asm-x86/bootparam.h | 34 ++++++++++++++++++++++++++++ scripts/update-linux-headers.sh | 6 +++++ 3 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 include/standard-headers/asm-x86/bootparam.h diff --git a/hw/i386/pc.c b/hw/i386/pc.c index 73d688f..64d23b2 100644 --- a/hw/i386/pc.c +++ b/hw/i386/pc.c @@ -75,6 +75,7 @@ #include "hw/usb.h" #include "hw/i386/intel_iommu.h" #include "hw/net/ne2000-isa.h" +#include "standard-headers/asm-x86/bootparam.h" /* debug PC/ISA interrupts */ //#define DEBUG_IRQ @@ -1046,13 +1047,6 @@ static long get_file_size(FILE *f) return size; } -/* setup_data types */ -#define SETUP_NONE 0 -#define SETUP_E820_EXT 1 -#define SETUP_DTB 2 -#define SETUP_PCI 3 -#define SETUP_EFI 4 - struct setup_data { uint64_t next; uint32_t type; diff --git a/include/standard-headers/asm-x86/bootparam.h b/include/standard-headers/asm-x86/bootparam.h new file mode 100644 index 0000000..67d4f01 --- /dev/null +++ b/include/standard-headers/asm-x86/bootparam.h @@ -0,0 +1,34 @@ +/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ +#ifndef _ASM_X86_BOOTPARAM_H +#define _ASM_X86_BOOTPARAM_H + +/* setup_data types */ +#define SETUP_NONE 0 +#define SETUP_E820_EXT 1 +#define SETUP_DTB 2 +#define SETUP_PCI 3 +#define SETUP_EFI 4 +#define SETUP_APPLE_PROPERTIES 5 +#define SETUP_JAILHOUSE 6 + +/* ram_size flags */ +#define RAMDISK_IMAGE_START_MASK 0x07FF +#define RAMDISK_PROMPT_FLAG 0x8000 +#define RAMDISK_LOAD_FLAG 0x4000 + +/* loadflags */ +#define LOADED_HIGH (1<<0) +#define KASLR_FLAG (1<<1) +#define QUIET_FLAG (1<<5) +#define KEEP_SEGMENTS (1<<6) +#define CAN_USE_HEAP (1<<7) + +/* xloadflags */ +#define XLF_KERNEL_64 (1<<0) +#define XLF_CAN_BE_LOADED_ABOVE_4G (1<<1) +#define XLF_EFI_HANDOVER_32 (1<<2) +#define XLF_EFI_HANDOVER_64 (1<<3) +#define XLF_EFI_KEXEC (1<<4) + + +#endif /* _ASM_X86_BOOTPARAM_H */ diff --git a/scripts/update-linux-headers.sh b/scripts/update-linux-headers.sh index 0a964fe..3578cfe 100755 --- a/scripts/update-linux-headers.sh +++ b/scripts/update-linux-headers.sh @@ -120,6 +120,12 @@ for arch in $ARCHLIST; do cp "$tmpdir/include/asm/unistd_x32.h" "$output/linux-headers/asm-x86/" cp "$tmpdir/include/asm/unistd_64.h" "$output/linux-headers/asm-x86/" cp_portable "$tmpdir/include/asm/kvm_para.h" "$output/include/standard-headers/asm-$arch" + # Remove everything except the macros from bootparam.h avoiding the + # unnecessary import of several video/ist/etc headers + sed -e '/__ASSEMBLY__/,/__ASSEMBLY__/d' \ + "$tmpdir/include/asm/bootparam.h" > "$tmpdir/bootparam.h" + cp_portable "$tmpdir/bootparam.h" \ + "$output/include/standard-headers/asm-$arch" fi done