#define MAX_IDE_BUS 2
+#ifdef HAS_TPM
+void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
+#endif
+
static fdctrl_t *floppy_controller;
static RTCState *rtc_state;
static PITState *pit;
/* local prototypes */
-static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg);
+static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, const char *msg);
static int TPM_Receive(tpmState *s, tpmBuffer *buffer);
static uint32_t vtpm_instance_from_xenstore(void);
static void tis_poll_timer(void *opaque);
/*
* initialize TIS interface
*/
+
+void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq);
+
void tpm_tis_init(SetIRQFunc *set_irq, void *opaque, int irq)
{
LPCtpmState *d;
/*
* Send a TPM request.
*/
-static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, char *msg)
+static int TPM_Send(tpmState *s, tpmBuffer *buffer, uint8_t locty, const char *msg)
{
int len;
uint32_t size = tpm_get_size_from_buffer(buffer->buf);
unsigned int num;
uint32_t number = VTPM_BAD_INSTANCE;
int end = 0;
- char *token = "tok";
+ const char *token = "tok";
int subscribed = 0;
int ctr = 0;
fd_set readfds;
#endif
-extern int domid;
-
int read_fd;
int write_fd;
struct fd_list_entry **pprev, *next;
} fd_list_entry_t;
+int init_blktap(void);
+
#endif /*XEN_BLKTAP_H_*/
#include "boards.h"
#include "xen_backend.h"
+#ifndef CONFIG_STUBDOM
+#include <hw/xen_blktap.h>
+#endif
+
uint32_t xen_domid;
enum xen_mode xen_mode = XEN_EMULATE;
-extern void init_blktap(void);
-
static void xen_init_pv(ram_addr_t ram_size, int vga_ram_size,
- const char *boot_device, DisplayState *ds,
+ const char *boot_device,
const char *kernel_filename,
const char *kernel_cmdline,
const char *initrd_filename,
int xc_handle = -1;
char domain_name[64] = "Xen-no-name";
-int domid;
int domid_backend = 0;
/* 0 for now. If we ever have non-dom0 backend domains, this
}
}
-extern void cpu_physical_memory_rw(target_phys_addr_t addr, uint8_t *buf,
- int len, int is_write);
-
static inline void read_physical(uint64_t addr, unsigned long size, void *val)
{
return cpu_physical_memory_rw((target_phys_addr_t)addr, val, size, 0);
static void cpu_handle_ioreq(void *opaque)
{
- extern int vm_running;
extern int shutdown_requested;
CPUState *env = opaque;
ioreq_t *req = cpu_get_ioreq();
int main_loop(void)
{
- extern int vm_running;
CPUState *env = cpu_single_env;
int evtchn_fd = xce_handle == -1 ? -1 : xc_evtchn_fd(xce_handle);
char *qemu_file;
#ifndef TAPGIFNAME
char *dev;
struct stat s;
+#else
+ struct ifreq ifr;
#endif
TFR(fd = open("/dev/tap", O_RDWR));
void do_delvm(const char *name);
void do_info_snapshots(void);
+#ifdef CONFIG_PASSTHROUGH
+int pci_emulation_add(char *config_text);
+#endif
+
void qemu_announce_self(void);
void main_loop_wait(int timeout);
#include <sys/time.h>
#include <assert.h>
+#include <hw/xen_blktap.h>
-extern int init_blktap(void);
extern void qemu_aio_init(void);
extern void qemu_aio_poll(void);
extern void bdrv_init(void);
}
}
+#ifdef CONFIG_PASSTHROUGH
for (i = 0; i < nb_pci_emulation; i++) {
- if(pci_emulation_add(pci_emulation_config_text[i]) < 0) {
+ if (pci_emulation_add(pci_emulation_config_text[i]) < 0) {
fprintf(stderr, "Warning: could not add PCI device %s\n",
pci_emulation_config_text[i]);
}
}
+#endif
if (strlen(direct_pci_str) > 0)
direct_pci = direct_pci_str;
/* There is no need for multiple-inclusion protection since
* there is only one place where this file is included. */
-
+#include "sysemu.h"
/* Max number of PCI emulation */
#define MAX_PCI_EMULATION 32
}
#endif
-static int pci_emulation_add(char *config_text)
+int pci_emulation_add(char *config_text)
{
PCI_EMULATION_INFO *new;
if ((new = qemu_mallocz(sizeof(PCI_EMULATION_INFO))) == NULL) {
free(frontend_doublecheck);
}
-const char *xenstore_get_guest_uuid(void)
+static const char *xenstore_get_guest_uuid(void)
{
static char *already_computed = NULL;
return -1;
}
-void xenstore_process_logdirty_event(void)
+static void xenstore_process_logdirty_event(void)
{
char *act;
static char *active_path = NULL;
return value;
}
-char *xenstore_extended_power_mgmt_read(const char *key, unsigned int *len)
+static char *xenstore_extended_power_mgmt_read(const char *key, unsigned int *len)
{
char *path = NULL, *value = NULL;
return value;
}
-int xenstore_extended_power_mgmt_write(const char *key, const char *value)
+static int xenstore_extended_power_mgmt_write(const char *key, const char *value)
{
int ret;
char *path = NULL;
return ret;
}
-int xenstore_extended_power_mgmt_event_trigger(const char *key, const char *value)
+static int
+xenstore_extended_power_mgmt_event_trigger(const char *key, const char *value)
{
int ret;
char *path = NULL;