X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Finclude%2Fpalacios%2Fvmm.h;h=af932dfdff93eeb0b74c2e4d0ebf5c245eafe172;hb=bffd966ae9620b33f5fcb3a9b421766f84fff2d1;hp=9fae52eb1f7cb1419303a7a2801ac98ff24cb3d5;hpb=362391accc505b29d938e9d0a21bf6a28a8cee34;p=palacios.git diff --git a/palacios/include/palacios/vmm.h b/palacios/include/palacios/vmm.h index 9fae52e..af932df 100644 --- a/palacios/include/palacios/vmm.h +++ b/palacios/include/palacios/vmm.h @@ -23,6 +23,8 @@ #include #include +#include +#include #ifdef __V3VEE__ @@ -195,7 +197,26 @@ } while(0) \ - +#define V3_REGISTER_PKT_DELIVERY(x) \ + ({\ + int ret = 0;\ + extern struct v3_os_hooks * os_hooks; \ + if ((os_hooks) && (os_hooks)->register_pkt_delivery) { \ + ret = (os_hooks)->register_pkt_delivery(x); \ + }\ + ret; \ + } ) + +#define V3_SEND_PKT(x, y) \ + ({\ + int ret=0; \ + extern struct v3_os_hooks * os_hooks; \ + if ((os_hooks) && (os_hooks)->ne2k_send_packet) { \ + ret = (os_hooks)->ne2k_send_packet(x, y); \ + }\ + ret; \ + }) + #define VMM_INVALID_CPU 0 #define VMM_VMX_CPU 1 @@ -244,6 +265,10 @@ struct v3_os_hooks { void (*yield_cpu)(void); + //function by network card driver + int (*register_pkt_delivery)(int (*rcvd_fn)(uchar_t *packet, uint_t size)); + int (*ne2k_send_packet)(uchar_t *packet, uint_t size); + };