diff options
Diffstat (limited to 'xen')
-rw-r--r-- | xen/block.c | 15 | ||||
-rw-r--r-- | xen/console.c | 2 | ||||
-rw-r--r-- | xen/console.h | 10 | ||||
-rw-r--r-- | xen/grant.c | 2 | ||||
-rw-r--r-- | xen/net.c | 9 | ||||
-rw-r--r-- | xen/time.c | 7 |
6 files changed, 28 insertions, 17 deletions
diff --git a/xen/block.c b/xen/block.c index 4253ef04..d98b31e2 100644 --- a/xen/block.c +++ b/xen/block.c @@ -214,10 +214,10 @@ void hyp_block_init(void) { continue; } if (partition) - sprintf(device_name, "%s%us%u", prefix, disk, partition); + sprintf(device_name, "%s%ds%d", prefix, disk, partition); else - sprintf(device_name, "%s%u", prefix, disk); - bd->name = (char*) kalloc(strlen(device_name)); + sprintf(device_name, "%s%d", prefix, disk); + bd->name = (char*) kalloc(strlen(device_name) + 1); strcpy(bd->name, device_name); /* Get domain id of backend driver. */ @@ -238,7 +238,7 @@ void hyp_block_init(void) { grant = hyp_grant_give(domid, atop(addr), 0); /* and give it to backend. */ - i = sprintf(port_name, "%u", grant); + i = sprintf(port_name, "%d", grant); c = hyp_store_write(t, port_name, 5, VBD_PATH, "/", vbds[n], "/", "ring-ref"); if (!c) panic("%s: couldn't store ring reference (%s)", device_name, hyp_store_error); @@ -382,8 +382,8 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, port = ipc_port_alloc_kernel(); if (port == IP_NULL) { - err = KERN_RESOURCE_SHORTAGE; - goto out; + device_close(bd); + return KERN_RESOURCE_SHORTAGE; } bd->port = port; @@ -396,7 +396,6 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, ipc_port_nsrequest (bd->port, 1, notify, ¬ify); assert (notify == IP_NULL); -out: if (IP_VALID (reply_port)) ds_device_open_reply (reply_port, reply_port_type, D_SUCCESS, port); else @@ -670,7 +669,7 @@ device_write(void *d, ipc_port_t reply_port, hyp_grant_takeback(gref[j]); if (err) { - printf("error writing %d bytes at sector %d\n", count, bn); + printf("error writing %u bytes at sector %d\n", count, bn); break; } } diff --git a/xen/console.c b/xen/console.c index 884376ff..313b9342 100644 --- a/xen/console.c +++ b/xen/console.c @@ -47,7 +47,7 @@ int hypputc(int c) hyp_console_io(CONSOLEIO_write, 1, kvtolin(&d)); } else { spl_t spl = splhigh(); - int complain; + static int complain; simple_lock(&outlock); while (hyp_ring_smash(console->out, console->out_prod, console->out_cons)) { if (!complain) { diff --git a/xen/console.h b/xen/console.h index ad171a47..061ba281 100644 --- a/xen/console.h +++ b/xen/console.h @@ -21,7 +21,9 @@ #include <machine/xen.h> #include <string.h> +#include <mach/port.h> #include <device/cons.h> +#include <device/io_req.h> #define hyp_console_write(str, len) hyp_console_io (CONSOLEIO_write, (len), kvtolin(str)) @@ -37,4 +39,12 @@ extern int hypcngetc(dev_t dev, int wait); extern int hypcnprobe(struct consdev *cp); extern int hypcninit(struct consdev *cp); +extern int hypcnopen(dev_t dev, int flag, io_req_t ior); +extern int hypcnread(int dev, io_req_t ior); +extern int hypcnwrite(int dev, io_req_t ior); +extern int hypcnclose(int dev, int flag); +extern io_return_t hypcngetstat(dev_t dev, int flavor, int *data, unsigned int *count); +extern io_return_t hypcnsetstat(dev_t dev, int flavor, int *data, unsigned int count); +extern int hypcnportdeath(dev_t dev, mach_port_t port); + #endif /* XEN_CONSOLE_H */ diff --git a/xen/grant.c b/xen/grant.c index 3d5c3fe7..ae3a7bfc 100644 --- a/xen/grant.c +++ b/xen/grant.c @@ -25,7 +25,7 @@ #include "grant.h" #define NR_RESERVED_ENTRIES 8 -#define NR_GRANT_PAGES 4 +#define NR_GRANT_PAGES 8 decl_simple_lock_data(static,lock); static struct grant_entry *grants; @@ -366,7 +366,7 @@ void hyp_net_init(void) { grant = hyp_grant_give(domid, atop(addr), 0); /* and give it to backend. */ - i = sprintf(port_name, "%u", grant); + i = sprintf(port_name, "%d", grant); c = hyp_store_write(t, port_name, 5, VIF_PATH, "/", vifs[n], "/", "tx-ring-ref"); if (!c) panic("eth: couldn't store tx_ring reference for VIF %s (%s)", vifs[n], hyp_store_error); @@ -381,7 +381,7 @@ void hyp_net_init(void) { grant = hyp_grant_give(domid, atop(addr), 0); /* and give it to backend. */ - i = sprintf(port_name, "%u", grant); + i = sprintf(port_name, "%d", grant); c = hyp_store_write(t, port_name, 5, VIF_PATH, "/", vifs[n], "/", "rx-ring-ref"); if (!c) panic("eth: couldn't store rx_ring reference for VIF %s (%s)", vifs[n], hyp_store_error); @@ -568,8 +568,8 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, port = ipc_port_alloc_kernel(); if (port == IP_NULL) { - err = KERN_RESOURCE_SHORTAGE; - goto out; + device_close (nd); + return KERN_RESOURCE_SHORTAGE; } nd->port = port; @@ -582,7 +582,6 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type, ipc_port_nsrequest (nd->port, 1, notify, ¬ify); assert (notify == IP_NULL); -out: if (IP_VALID (reply_port)) ds_device_open_reply (reply_port, reply_port_type, D_SUCCESS, dev_to_port(nd)); else @@ -34,6 +34,7 @@ static unsigned64_t lastnsec; static unsigned64_t hyp_get_stime(void) { unsigned32_t version; unsigned64_t cpu_clock, last_cpu_clock, delta, system_time; + unsigned64_t delta_high, delta_low; unsigned32_t mul; signed8_t shift; volatile struct vcpu_time_info *time = &hyp_shared_info.vcpu_info[0].time; @@ -54,7 +55,10 @@ static unsigned64_t hyp_get_stime(void) { delta >>= -shift; else delta <<= shift; - return system_time + ((delta * (unsigned64_t) mul) >> 32); + delta_high = delta >> 32; + delta_low = (unsigned32_t) delta; + return system_time + ((delta_low * (unsigned64_t) mul) >> 32) + + (delta_high * (unsigned64_t) mul); } unsigned64_t hyp_get_time(void) { @@ -107,7 +111,6 @@ static void hypclock_intr(int unit, int old_ipl, void *ret_addr, struct i386_int } extern struct timeval time; -extern struct timezone tz; int readtodc(tp) |