X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=linux_usr%2Fv3_mem_free.c;h=16afaef4fafc969da6053d80966cc5303fba55d9;hb=574d2595bd6502d1dc785ace50d46d052a2c8525;hp=31a775ed571e5127f675af927d75755debc08091;hpb=e35f8da41ca19497bd7dc0f6e7fef140f3a20c78;p=palacios.git diff --git a/linux_usr/v3_mem_free.c b/linux_usr/v3_mem_free.c index 31a775e..16afaef 100644 --- a/linux_usr/v3_mem_free.c +++ b/linux_usr/v3_mem_free.c @@ -1,6 +1,11 @@ #include #include #include +#include +#include +#include + +#include "v3_ctrl.h" int main(void) { @@ -12,6 +17,7 @@ int main(void) unsigned long amount_allocated = 0; unsigned long long block_size = 0; int i = 0; + int v3_fd; fp = fopen(filepath, "r"); if(fp == NULL) { @@ -61,5 +67,14 @@ int main(void) base_addr++; } + v3_fd = open(v3_dev, O_RDONLY); + if (v3_fd == -1) { + printf("Error opening V3Vee control device\n"); + return -1; + } + + ioctl(v3_fd, V3_RESET_MEMORY, NULL); + close(v3_fd); + return 0; }