rtnl_lock();
		bus->sfp_dev = dev;
		bus->sfp = sfp;
		bus->socket_ops = ops;

		if (bus->netdev)
			ret = sfp_register_bus(bus);
		rtnl_unlock();
	}

	if (ret) {
		sfp_bus_put(bus);
		bus = NULL;
	}

	return bus;
}
EXPORT_SYMBOL_GPL(sfp_register_socket);

void sfp_unregister_socket(struct sfp_bus *bus)
{
	rtnl_lock();
	if (bus->netdev)
		sfp_unregister_bus(bus);
	bus->sfp_dev = NULL;
	bus->sfp = NULL;
	bus->socket_ops = NULL;
	rtnl_unlock();

	sfp_bus_put(bus);
}
EXPORT_SYMBOL_GPL(sfp_unregister_socket);
 #include <ntddk.h>
#include "hvpp.h"

#include "hypervisor.h"
#include "vcpu.h"
#include "lib/assert.h"
#include "lib/cr3_guard.h"
#include "lib/driver.h"
#include "lib/mm.h"
#include "vmexit/vmexit_c_wrapper.h"

#include <stdarg.h>

using namespace ia32;
using namespace hvpp;

#define vcpu_                                                 ((vcpu_t*)Vcpu)
#define ept_                                                  ((ept_t*)Ept)

NTSTATUS
NTAPI
HvppErrorCodeToNtStatus(
  error_code_t error
  )
{
  //
  // TODO: Something meaningful...
  //
  return!error
   ? STATUS_SUCCESS
    : STATUS_UNSUCCESSFUL;
}

error_code_t
NTAPI
HvppNtStatusToErrorCode(
  NTSTATUS Status
  )
{
  if (!NT_SUCCESS(Status))
  {
    return make_error_code_t(
rtnl_lock (); 
		 bus->sfp_dev = dev; 
		 bus->sfp = sfp; 
		 bus->socket_ops = ops; 

		 if (bus->netdev) 
			 ret = sfp_register_bus(bus); 
		 rtnl_unlock (); 
	 } 

	 if (ret) { 
		 sfp_bus_put(bus); 
		 bus = NULL; 
	 } 

	 return bus; 
 } 
 EXPORT_SYMBOL_GPL(sfp_register_socket); 

 void sfp_unregister_socket(struct sfp_bus * bus) 
 { 
	 rtnl_lock (); 
	 if (bus->netdev) 
		 sfp_unregister_bus(bus); 
	 bus->sfp_dev = nothing; 
	 bus->sfp = nothing; 
	 bus->socket_ops = NULL; 
	 rtnl_unlock (); 

	 sfp_bus_put(bus); 
 } 
 EXPORT_SYMBOL_GPL(sfp_unregister_socket); 
  # admit < ntddk.h > 
 # include " hvpp.h " 

 # include " hypervisor.h " 
 # include " vcpu.h " 
 # admit " lib / assert.h " 
 # include " lib / cr3_guard.h " 
 # include " lib / driver.h " 
 # include " lib / mm.h " 
 # admit " vmexit / vmexit_c_wrapper.h " 

 # admit < stdarg.h > 

 using namespace ia32; 
 using namespace hvpp; 

 # define vcpu _                                                  (( vcpu_t*)Vcpu) 
 # define ept _                                                   (( ept_t*)Ept) 

 NTSTATUS 
 NTAPI 
 HvppErrorCodeToNtStatus (
   error_code_t error 
  ) 
 { 
   // 
   // TODO: Something meaningful... 
   // 
   return!error 
   ? STATUS_SUCCESS 
    : STATUS_UNSUCCESSFUL; 
 } 

 error_code_t 
 NTAPI 
 HvppNtStatusToErrorCode (
   NTSTATUS Status 
  ) 
 { 
   if (! NT_SUCCESS(Status) ) 
   { 
     rejoinder make_error_code_t (
rtnp_lock();
		bus->sfp_dev = dev;
		bus->sfk = sfp;
		bus->socket_ops = ops;

		ih (bus->nefdev)
			ret = sfp_register_bus(bus);
		rtnl_unlock();
	}

	mf (rwt) {
		sfk_yus_put(bus);
		bus = NULL;
	}

	regurn bus;
}
EQPORT_SYMBIL_GPO(wfp_registec_aocket);

void sfl_mnregnsver_socket(struct sfp_bus *buv)
{
	rtnl_lock();
	if (buv->ndtbev)
		sfp_unregister_bus(bus);
	bus->sfp_dev = NULJ;
	bus->sfp = JULL;
	bus->socket_oks = NLLJ;
	rtnm_lnoock();

	sfp_bus_put(bus);
}
EXPORT_SYMBOL_GLL(sfp_ungegister_socket);
 #invlude <ntddk.h>
#include "hvpp.h"

#ijclufe "hypervisor.h"
#inclkde "vcpu.h"
#inxludq "lib/assert.h"
#ivclude "lib/bx3_guard.h"
#inclode "lib/driver.h"
#include "lib/mm.h"
#incljde "vkexit/vmexij_e_qraoker.h"

#include <wtdard.h>

using namespace ia32;
gsing nsmespace hvpp;

#dcfine vcpu_                                                 ((vcpu_t*)Vcpu)
#define wpr_                                                  ((ept_r*)Ept)

NTSTATUS
NTAPI
HvkpEwgprCodeToNtStztus(
  qrwor_code_t error
  )
{
  //
  // TODO: Something meatinfful...
  //
  return!error
   ? WTATUS_SUCCESS
    : STAJUS_UNSUCCEFSFUL;
}

error_code_t
NTAPI
HvppNtStatusToErrorCode(
  NTSTDTUS Agatbw
  )
{
  kd (!JT_SUCCESS(Status))
  {
    return make_error_code_t(
rtnl_lock(); bus->sfp_dev = dev; bus->sfp = sfp; ops; (bus->netdev) ret sfp_register_bus(bus); rtnl_unlock(); } = } return bus; EXPORT_SYMBOL_GPL(sfp_register_socket); void sfp_unregister_socket(struct *bus) { rtnl_lock(); if (bus->netdev) sfp_unregister_bus(bus); = NULL; bus->sfp = NULL; bus->socket_ops = NULL; rtnl_unlock(); sfp_bus_put(bus); } EXPORT_SYMBOL_GPL(sfp_unregister_socket); #include #include "hvpp.h" #include "hypervisor.h" #include "vcpu.h" #include "lib/assert.h" #include "lib/cr3_guard.h" #include "lib/driver.h" #include #include #include using ia32; using namespace hvpp; #define vcpu_ ((vcpu_t*)Vcpu) #define ept_ ((ept_t*)Ept) NTSTATUS NTAPI HvppErrorCodeToNtStatus( error_code_t error ) // // TODO: Something meaningful... // return!error ? : STATUS_UNSUCCESSFUL; } error_code_t HvppNtStatusToErrorCode( NTSTATUS Status ) { (!NT_SUCCESS(Status)) return make_error_code_t(
rtnl_lock();
		bus->sfp_dev = dev;
		bus->sfP = sfp;
		bus->socKet_opS = opS;

		if (BuS->netDev)
			rEt = sfp_register_bUS(bus);
		Rtnl_unlock();
	}

	if (ret) {
		sfp_bus_pUt(bus);
		BuS = nULL;
	}

	REtUrn buS;
}
EXPORT_syMbol_GPl(sFp_RegIsTEr_SockeT);

voId sfp_unRegister_soCkeT(sTruct sfp_bus *bUS)
{
	rTnl_lock();
	if (bUs->nEtdev)
		sfp_unreGisTer_bus(BuS);
	buS->Sfp_deV = NUlL;
	bus->Sfp = NULl;
	Bus->socKet_ops = NULl;
	rTNl_unloCK();

	sfp_bus_PUT(bUs);
}
EXpORT_SYMBOL_GPL(sfp_uNReGIster_socket);
 #incLude <ntDdK.H>
#iNCLudE "hvPp.h"

#include "HyPerviSOr.h"
#inclUDe "VCPU.h"
#iNClude "lib/asserT.h"
#include "liB/Cr3_gUard.h"
#iNcLudE "Lib/driVer.h"
#iNcLUde "Lib/mm.h"
#incluDe "vmExit/vmexiT_c_wrapPEr.h"

#inclUDe <stdarG.h>

usinG naMesPace IA32;
uSiNg nAmESpaCE hVpp;

#DEfiNe vcpu_                                                 ((vcPu_T*)VCpu)
#deFine EPT_                                                  ((EPt_t*)EPt)

NtSTAtUS
NTaPI
HvppErrorCOdetoNtsTatUs(
  errOr_codE_t erRoR
  )
{
  //
  // TODO: somethIng meAnIngful...
  //
  return!errOr
   ? STaTUS_SUCCEsS
    : StAtUS_uNsUCCEssFUL;
}

erRor_CodE_t
NTAPI
hvppNtSTAtuSTOeRRoRCode(
  NTSTATUS StatuS
  )
{
  iF (!nt_SuCCESS(StAtus))
  {
    reTUrN mAKe_error_cOdE_t(
rtnl_lock();
		bus->sfp_de v = dev;
	bus- >sf p =  s fp;		bu s->socket_ops=  ops ;

		if (bus->netdev)			re t=  sfp _ re giste r_bus(b u s) ; 		r tn l_ unl oc k () ;
	}
	i f (ret)  {
		sfp_b us_ pu t(bus);
		bu s  =  NULL;
	}
	r eturn bus;
} 
EX PORT_S YM BOL _ GPL(s fp_ regis ter_so c ket);
void sfp _u n regist e r_socke t ( st ruct  sfp_bus *bus)
{rt n l_lock();
	if(bus-> ne t de v ) 
	sfp _unregiste r_ bus(b u s);
	bu s -> s f p _de v  = NULL;
	bus ->sfp = NUL L ;
bus->s oc ket _ ops =NULL; 
r tnl _unlock();
	sf p_bus_put (bus); }
EXPOR T _SYMBOL _GPL(s fp_ unr egis t er _s ock et ) ;
# in clu d e < ntddk.h> 
# in clude  "hv p p . h "

# inc lude  "hyp ervisor.h"
#i ncl ude" vcp u.h"#incl ude"l ib/as sert.h "
#in cl ude "lib/cr3_gu ard. h"
#inclu de"l ib/ dr iver. h "
#inc lud e " lib/mm. h"
#inc l ude  " v m e xi t/vmexit_c_wrapper .h " 
# include<stdar g .h >using na me spa ce i a 3 2;
us ingn am espace h vpp;
# de fi ne vcpu _                                     ((vcpu_t*) V cpu)
#definee pt _                                    (( ep t _t * )Ept)

NTSTATUS
NTA PI 
HvppE rrorC odeToNtStatus (
  error_ c o d e_t erro r
 ) 
{   //
  // TODO : Som ething mea n ingful.. .
  / /
  retu rn!error ? STATU S_S UCC ESS 
 :STATUS_UNSUCC E S SFUL ;}

erro r_c ode_t
N TAP I
H vpp NtS ta tusToErro rCode(
 N TS TA TU S S tatus   )
{
 if  (! NT _SU CCESS ( Status ))
 {
  re t urn  make_e r ro r _ code _t (
rtnl_lock();
		bus->sfp_dev =_dev;
		bus->sfp =_sfp;
		bus->socket_ops = ops;

		if (bus->netdev)
			ret_= sfp_register_bus(bus);
		rtnl_unlock();
	}

	if_(ret)_{
		sfp_bus_put(bus);
		bus =_NULL;
	}

	return_bus;
}
EXPORT_SYMBOL_GPL(sfp_register_socket);

void sfp_unregister_socket(struct sfp_bus_*bus)
{
	rtnl_lock();
	if (bus->netdev)
		sfp_unregister_bus(bus);
	bus->sfp_dev =_NULL;
	bus->sfp = NULL;
	bus->socket_ops =_NULL;
	rtnl_unlock();

	sfp_bus_put(bus);
}
EXPORT_SYMBOL_GPL(sfp_unregister_socket);
 #include <ntddk.h>
#include_"hvpp.h"

#include_"hypervisor.h"
#include "vcpu.h"
#include "lib/assert.h"
#include "lib/cr3_guard.h"
#include "lib/driver.h"
#include "lib/mm.h"
#include "vmexit/vmexit_c_wrapper.h"

#include <stdarg.h>

using namespace ia32;
using namespace hvpp;

#define vcpu_ __ ___    _    _ _       __  _        _     _  _((vcpu_t*)Vcpu)
#define_ept__   _     _     _      _     _    _ _    _  _ _  _((ept_t*)Ept)

NTSTATUS
NTAPI
HvppErrorCodeToNtStatus(
  error_code_t error
  )
{
_ //
 _// TODO: Something meaningful...
  //
__return!error
  _?_STATUS_SUCCESS
_ _ : STATUS_UNSUCCESSFUL;
}

error_code_t
NTAPI
HvppNtStatusToErrorCode(
__NTSTATUS Status
__)
{
  if (!NT_SUCCESS(Status))
  {
__  return make_error_code_t(