kvm: qemu: fix pci_enable_capabilities to set the CAP feature in pci::status
[kvm-userspace.git] / qemu / target-ia64 / firmware.h
blobc1707ac8d7ad2670e34c179cca54fe4b753c424c
1 /*
2 * firmwar.h: Firmware build logic head file
4 * Copyright (c) 2007, Intel Corporation.
5 * Zhang Xiantao <xiantao.zhang@intel.com>
7 * This program is free software; you can redistribute it and/or modify it
8 * under the terms and conditions of the GNU General Public License,
9 * version 2, as published by the Free Software Foundation.
11 * This program is distributed in the hope it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * more details.
16 * You should have received a copy of the GNU General Public License along with
17 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
18 * Place - Suite 330, Boston, MA 02111-1307 USA.
20 #ifndef __FIRM_WARE_H
21 #define __FIRM_WARE_
22 #include "cpu.h"
24 #include <sys/types.h>
25 #include <sys/stat.h>
26 #include <fcntl.h>
28 #include <zlib.h>
30 #define GFW_SIZE (16UL<<20)
31 #define GFW_START ((4UL<<30) - GFW_SIZE)
33 #define HOB_SIGNATURE 0x3436474953424f48 // "HOBSIG64"
34 #define GFW_HOB_START ((4UL<<30) - (14UL<<20)) // 4G - 14M
35 #define GFW_HOB_SIZE (1UL<<20) // 1M
36 #define HOB_OFFSET (GFW_HOB_START-GFW_START)
38 #define Hob_Output(s) fprintf(stderr, s)
40 #define NVRAM_START (GFW_START + NVRAM_OFFSET)
41 #define NVRAM_OFFSET (10 * (1UL << 20))
42 #define NVRAM_SIZE (64 * (1UL << 10))
43 #define NVRAM_VALID_SIG 0x4650494e45584948 /* "HIXENIPF" */
44 #define VALIDATE_NVRAM_FD(x) ((1UL<<(sizeof(x)*8 - 1)) | x)
45 #define IS_VALID_NVRAM_FD(x) ((uint64_t)x >> (sizeof(x)*8 - 1))
46 #define READ_FROM_NVRAM 0
47 #define WRITE_TO_NVRAM 1
49 struct nvram_save_addr {
50 unsigned long addr;
51 unsigned long signature;
54 extern const char *nvram;
55 extern uint8_t *g_fw_start;
56 extern int kvm_ia64_build_hob(unsigned long memsize, unsigned long vcpus,
57 uint8_t *fw_start, unsigned long nvram_addr);
58 extern char *read_image(const char *filename, unsigned long *size);
60 extern int kvm_ia64_copy_from_GFW_to_nvram(void);
61 extern int kvm_ia64_nvram_init(unsigned long type);
62 extern int kvm_ia64_copy_from_nvram_to_GFW(unsigned long nvram_fd,
63 const uint8_t *fw_start);
64 #endif //__FIRM_WARE_