summaryrefslogtreecommitdiff
path: root/xen/net.c
diff options
context:
space:
mode:
authorSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-29 13:17:46 +0200
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2020-03-29 13:21:25 +0200
commit86156357706b3c741c6b5feda1d36d8687c660de (patch)
tree35fa025a58f2489827d1afb275a632465fbb7daf /xen/net.c
parent1e90662dd80c64de27b432c9d6911fad937da804 (diff)
64bit: fix warnings
* device/net_io.h (net_set_filter, ethernet_priority): Add prototypes. * device/subrs.h: Include <device/if_hdr.h>. (if_init_queues): Add prototype. * i386/i386/model_dep.h (machine_relax): Add prototype. * i386/i386/trap.c (i386_astintr): Move mycpu variable definition to where it is used. * i386/i386at/model_dep.c (i386at_init): Likewise for nb_direct, addr, delta. * i386/xen/xen.c (return_to_iret): Change type to char[]. * xen/console.c: Include <i386at/kd.h>. * xen/evt.c (hyp_evt_handler): Cast NEVNT to int. * xen/grant.c: Include <model_dep.h>. (hyp_grant_takeback, hyp_grant_init): Fix print format. * xen/net.c: Include <device/subrs.h>. (paranoia): Remove variable. (hyp_net_init, device_close, device_open): Cast nd - vif_data to int. Fix print format. * xen/store.c (store_put): Cast sizeof to int. * xen/time.c: Include "xen.h". * xen/xen.h (hypclock_machine_intr): Add prototype.
Diffstat (limited to 'xen/net.c')
-rw-r--r--xen/net.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/xen/net.c b/xen/net.c
index 11121387..1dc2209e 100644
--- a/xen/net.c
+++ b/xen/net.c
@@ -30,6 +30,7 @@
#include <device/device_reply.user.h>
#include <device/device_emul.h>
#include <device/ds_routines.h>
+#include <device/subrs.h>
#include <intel/pmap.h>
#include <xen/public/io/netif.h>
#include <xen/public/memory.h>
@@ -48,9 +49,6 @@
#define ADDRESS_SIZE 6
#define WINDOW __RING_SIZE((netif_rx_sring_t*)0, PAGE_SIZE)
-/* Are we paranoid enough to not leak anything to backend? */
-static const int paranoia = 0;
-
struct net_data {
struct device device;
struct ifnet ifnet;
@@ -458,7 +456,7 @@ void hyp_net_init(void) {
c = hyp_store_write(0, hyp_store_state_connected, 5, VIF_PATH, "/", nd->vif, "/", "state");
if (!c)
- panic("couldn't store state for eth%d (%s)", nd - vif_data, hyp_store_error);
+ panic("couldn't store state for eth%d (%s)", (int) (nd - vif_data), hyp_store_error);
kfree((vm_offset_t) c, strlen(c)+1);
while(1) {
@@ -478,7 +476,7 @@ void hyp_net_init(void) {
nd->rx_buf_pfn[i] = atop(addr);
if (!nd->rx_copy) {
if (hyp_do_update_va_mapping(kvtolin(nd->rx_buf[i]), 0, UVMF_INVLPG|UVMF_ALL))
- panic("eth: couldn't clear rx kv buf %d at %p", i, addr);
+ panic("eth: couldn't clear rx kv buf %d at %lx", i, addr);
}
/* and enqueue it to backend. */
enqueue_rx_buf(nd, i);
@@ -526,8 +524,8 @@ device_close(void *devp)
{
struct net_data *nd = devp;
if (--nd->open_count < 0)
- panic("too many closes on eth%d", nd - vif_data);
- printf("close, eth%d count %d\n",nd-vif_data,nd->open_count);
+ panic("too many closes on eth%d", (int) (nd - vif_data));
+ printf("close, eth%d count %d\n", (int) (nd - vif_data), nd->open_count);
if (nd->open_count)
return 0;
ipc_kobject_set(nd->port, IKO_NULL, IKOT_NONE);
@@ -560,12 +558,12 @@ device_open (ipc_port_t reply_port, mach_msg_type_name_t reply_port_type,
if (nd->open_count >= 0) {
*devp = &nd->device ;
nd->open_count++ ;
- printf("re-open, eth%d count %d\n",nd-vif_data,nd->open_count);
+ printf("re-open, eth%d count %d\n", (int) (nd - vif_data), nd->open_count);
return D_SUCCESS;
}
nd->open_count = 1;
- printf("eth%d count %d\n",nd-vif_data,nd->open_count);
+ printf("eth%d count %d\n", (int) (nd - vif_data), nd->open_count);
port = ipc_port_alloc_kernel();
if (port == IP_NULL) {