Skip to content

Commit

Permalink
software/litepcie_util: Add zero-copy support to dma_test.
Browse files Browse the repository at this point in the history
  • Loading branch information
enjoy-digital committed Dec 9, 2021
1 parent e0adab5 commit f73761d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion litepcie/software/user/litepcie_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@

static char litepcie_device[1024];
static int litepcie_device_num;
static uint8_t litepcie_device_zero_copy;

sig_atomic_t keep_running = 1;

Expand Down Expand Up @@ -383,6 +384,7 @@ static void help(void)
"options:\n"
"-h Help\n"
"-c device_num Select the device (default = 0)\n"
"-z Enable zero-copy DMA mode\n"
"\n"
"available commands:\n"
"info Board information\n"
Expand All @@ -407,10 +409,11 @@ int main(int argc, char **argv)
int c;

litepcie_device_num = 0;
litepcie_device_zero_copy = 0;

/* parameters */
for (;;) {
c = getopt(argc, argv, "hfc:");
c = getopt(argc, argv, "hc:z");
if (c == -1)
break;
switch(c) {
Expand All @@ -420,6 +423,9 @@ int main(int argc, char **argv)
case 'c':
litepcie_device_num = atoi(optarg);
break;
case 'z':
litepcie_device_zero_copy = 1;
break;
default:
exit(1);
}
Expand Down

0 comments on commit f73761d

Please sign in to comment.