option('comm_opt', type : 'string', value : 'ip')
-option('resv_mem_size', type : 'string', value : '512M')
+option('resv_mem_size', type : 'string', value : '0')
option('working_dir', type : 'string', value : '/tmp/')
option('log_dir', type : 'string', value : '/tmp/')
option('enable_test_mode', type : 'boolean', value : true)
sscanf (resv_mem_size, "%" SCNu64 "%c", &val, &unit);
- if (val > 0) {
- if (unit != '\x00') {
- if (unit == 'K' || unit == 'k') {
- val *= 1024;
- } else if (unit == 'M' || unit == 'm') {
- val *= 1024 * 1024;
- } else if (unit == 'G' || unit == 'g') {
- val *= 1024 * 1024 * 1024;
- } else
- fprintf (stderr, "Unknown unit for memory size: %c\n", unit);
- }
- c->reserved_mem_size = val;
- } else
- fprintf (stderr, "Cannot parse 'resv_mem_size': %s\n", resv_mem_size);
+ if (unit != '\x00') {
+ if (unit == 'K' || unit == 'k') {
+ val *= 1024;
+ } else if (unit == 'M' || unit == 'm') {
+ val *= 1024 * 1024;
+ } else if (unit == 'G' || unit == 'g') {
+ val *= 1024 * 1024 * 1024;
+ } else
+ fprintf (stderr, "Unknown unit for memory size: %c\n", unit);
+ }
+
+ /** zero size is now allowed to indicate the KERNEL_CMA mode */
+ c->reserved_mem_size = val;
}
if (working_dir && strlen(working_dir) < MAX_DIR_LEN) {
return false;
assert (size_in <= size_out);
-
size = size_out;
- priv->cma.handle = handle;
/** destory old gem buffer */
gem_destroy (mpriv.fd, priv->cma.handle);
+
+ priv->cma.handle = handle;
}
mpriv.used_size -= hwmem->size;