From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=52642 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PCvto-0003V2-Pl for qemu-devel@nongnu.org; Mon, 01 Nov 2010 11:02:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PCvtW-0000g1-Hj for qemu-devel@nongnu.org; Mon, 01 Nov 2010 11:02:05 -0400 Received: from cantor.suse.de ([195.135.220.2]:60261 helo=mx1.suse.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PCvtW-0000ey-8l for qemu-devel@nongnu.org; Mon, 01 Nov 2010 11:01:58 -0400 From: Alexander Graf Date: Mon, 1 Nov 2010 16:01:22 +0100 Message-Id: <1288623713-28062-10-git-send-email-agraf@suse.de> In-Reply-To: <1288623713-28062-1-git-send-email-agraf@suse.de> References: <1288623713-28062-1-git-send-email-agraf@suse.de> Subject: [Qemu-devel] [PATCH 09/40] xenner: kernel: Global data List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel Developers Cc: Gerd Hoffmann We need to access global variables from various points in the code. Keep them in a single file, so we know where they are. Signed-off-by: Alexander Graf --- pc-bios/xenner/xenner-data.c | 142 ++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 142 insertions(+), 0 deletions(-) create mode 100644 pc-bios/xenner/xenner-data.c diff --git a/pc-bios/xenner/xenner-data.c b/pc-bios/xenner/xenner-data.c new file mode 100644 index 0000000..cbe399c --- /dev/null +++ b/pc-bios/xenner/xenner-data.c @@ -0,0 +1,142 @@ +/* + * Copyright (C) Red Hat 2007 + * Copyright (C) Novell Inc. 2010 + * + * Author(s): Gerd Hoffmann + * Alexander Graf + * + * Xenner random data structures + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; under version 2 of the License. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, see . + */ + +#include "xenner.h" + +#ifdef CONFIG_64BIT + +struct idt_64 page_aligned xen_idt[256]; + +#else + +struct descriptor_32 page_aligned xen_idt[256]; + +page_aligned uint32_t maps_32[PTE_COUNT_32]; +page_aligned uint64_t maps_pae[PTE_COUNT_PAE]; +uint32_t maps_refcnt[MAPS_MAX]; + +#endif + +unsigned long *m2p; + +page_aligned struct vcpu_guest_context boot_ctxt; +LIST_HEAD(cpus); + +int grant_frames; +struct grant_entry_v1 page_aligned grant_table[GRANT_ENTRIES]; +struct shared_info page_aligned shared_info; +struct xenner_info page_aligned vminfo = { + .abi_version = XENNER_ABI_VERSION, +}; + +struct vmconfig vmconf; +xen_callback_t xencb[8]; +struct trap_info xentr[256]; +int wrpt; + +/* trap/fault info */ +const struct trapinfo trapinfo[32] = { + [ 0 ] = { .name = "division by zero", .ec = 0, .lvl = 1 }, + [ 1 ] = { .name = "debug interrupt", .ec = 0, .lvl = 3 }, + [ 2 ] = { .name = "NMI", .ec = 0, .lvl = 1 }, + [ 3 ] = { .name = "breakpoint", .ec = 0, .lvl = 3 }, + [ 4 ] = { .name = "overflow", .ec = 0, .lvl = 1 }, + [ 5 ] = { .name = "bound check", .ec = 0, .lvl = 1 }, + [ 6 ] = { .name = "illegal instruction", .ec = 0, .lvl = 1 }, + [ 7 ] = { .name = "device not present", .ec = 0, .lvl = 1 }, + [ 8 ] = { .name = "double fault", .ec = 1, .lvl = 0 }, + [ 9 ] = { .name = "coprocessor", .ec = 0, .lvl = 1 }, + [ 10 ] = { .name = "invalid TSS", .ec = 1, .lvl = 0 }, + [ 11 ] = { .name = "segment not pesent", .ec = 1, .lvl = 1 }, + [ 12 ] = { .name = "stack fault", .ec = 1, .lvl = 1 }, + [ 13 ] = { .name = "general protection fault", .ec = 1, .lvl = 1 }, + [ 14 ] = { .name = "page fault", .ec = 1, .lvl = 1 }, + [ 16 ] = { .name = "floating point exception", .ec = 0, .lvl = 1 }, + [ 17 ] = { .name = "alignment", .ec = 1, .lvl = 1 }, + [ 18 ] = { .name = "machine check", .ec = 0, .lvl = 1 }, + [ 19 ] = { .name = "SIMD floating point exception", .ec = 0, .lvl = 1 }, +}; + +const char *cr0_bits[32] = { + [ 0 ] = "PE", + [ 1 ] = "MP", + [ 2 ] = "EM", + [ 3 ] = "TS", + [ 4 ] = "ET", + [ 5 ] = "NE", + [ 16 ] = "WP", + [ 18 ] = "AM", + [ 29 ] = "NW", + [ 30 ] = "CD", + [ 31 ] = "PG", +}; + +const char *cr4_bits[32] = { + [ 0 ] = "VME", + [ 1 ] = "PVI", + [ 2 ] = "TSD", + [ 3 ] = "DE", + [ 4 ] = "PSE", + [ 5 ] = "PAE", + [ 6 ] = "MCE", + [ 7 ] = "PGE", + [ 8 ] = "PCE", + [ 9 ] = "OSFXSR", + [ 10 ] = "OSXMMEXCPT", +}; + +const char *pg_bits[32] = { + [ 0 ] = "present", + [ 1 ] = "write", + [ 2 ] = "user", + [ 3 ] = "pwt", + [ 4 ] = "pcd", + [ 5 ] = "access", + [ 6 ] = "dirty", + [ 7 ] = "pse", + [ 8 ] = "global", +}; + +const char *rflags_bits[32] = { + [ 0 ] = "CF", + [ 2 ] = "PF", + + [ 4 ] = "AF", + [ 6 ] = "ZF", + + [ 8 ] = "TF", + [ 9 ] = "IF", + [ 10 ] = "DF", + [ 11 ] = "OF", + + [ 12 ] = "IOPL-1", + [ 13 ] = "IOPL-2", + [ 14 ] = "NT", + + [ 16 ] = "RF", + [ 17 ] = "VM", + [ 18 ] = "AC", + [ 19 ] = "VIF", + + [ 20 ] = "VIP", + [ 21 ] = "ID", +}; -- 1.6.0.2