Skip to content

Commit 4e419f5

Browse files
authored
Merge pull request #11 from sy-c/master
options
2 parents a2d7a40 + f2e223d commit 4e419f5

File tree

2 files changed

+22
-4
lines changed

2 files changed

+22
-4
lines changed

arch/linux_x86_uio/dma_buffer_inc.c

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -864,10 +864,15 @@ DMABuffer_free
864864

865865
if(munlock(buffer->map, buffer->length) != 0)
866866
{
867-
// report, but continue with release procedure even if unlock fails
868-
//ERROR_EXIT( errno, exit, "Buffer unlocking failed!\n" );
869-
ERROR( errno, "Buffer unlocking failed!\n" );
870-
}
867+
#ifdef PDA_SKIP_UNLOCK_FAILURE
868+
#pragma message "*** Compiling with PDA_SKIP_UNLOCK_FAILURE"
869+
// report, but continue with release procedure even if unlock fails
870+
ERROR( errno, "Buffer unlocking failed! (but releasing)\n" );
871+
if(0) { goto exit; } // fake use of exit label to avoid compiler warning
872+
#else
873+
ERROR_EXIT( errno, exit, "Buffer unlocking failed!\n" );
874+
#endif
875+
}
871876

872877
buffer->map = MAP_FAILED;
873878
persistant = PDA_DELETE;

configure

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ MODPROBE_MODE="#define MODPROBE_MODE"
6262
PREFIX="/usr"
6363
DEBUG=""
6464
NUMA="true"
65+
EXTRA_DEFINES=""
6566

6667

6768
help()
@@ -73,6 +74,7 @@ help()
7374
echo " --debug=<true|false>"
7475
echo " --numa=<true|false>"
7576
echo " --modprobe=<true|false>"
77+
echo " --extra=<additional defines, comma separated>"
7678
}
7779

7880

@@ -120,6 +122,11 @@ do
120122
continue
121123
;;
122124

125+
"--extra" )
126+
EXTRA_DEFINES=$VALUE
127+
continue
128+
;;
129+
123130
* )
124131
echo "Unknown parameter $PARAMETER!"
125132
exit -1
@@ -233,6 +240,12 @@ gen_config()
233240
echo "$KMOD_AVAIL" >> $BUILD_PATH/src/config.h
234241
echo "$NUMA_AVAIL" >> $BUILD_PATH/src/config.h
235242
echo "$MODPROBE_MODE" >> $BUILD_PATH/src/config.h
243+
244+
for DEF in ${EXTRA_DEFINES//,/ }
245+
do
246+
echo "#define $DEF" >> $BUILD_PATH/src/config.h
247+
done
248+
236249
echo "#endif /* CONFIG_H */" >> $BUILD_PATH/src/config.h
237250
}
238251

0 commit comments

Comments
 (0)