Lines Matching refs:buf_size
41 static void mem_flush(unsigned char *buf, size_t buf_size) in mem_flush() argument
46 buf_size = buf_size / CL_SIZE; /* mem size in cache lines */ in mem_flush()
48 for (i = 0; i < buf_size; i++) in mem_flush()
54 static void *malloc_and_init_memory(size_t buf_size) in malloc_and_init_memory() argument
61 ret = posix_memalign(&p, PAGE_SIZE, buf_size); in malloc_and_init_memory()
66 s64 = buf_size / sizeof(uint64_t); in malloc_and_init_memory()
77 static int fill_one_span_read(unsigned char *buf, size_t buf_size) in fill_one_span_read() argument
79 unsigned char *end_ptr = buf + buf_size; in fill_one_span_read()
92 static void fill_one_span_write(unsigned char *buf, size_t buf_size) in fill_one_span_write() argument
94 unsigned char *end_ptr = buf + buf_size; in fill_one_span_write()
104 static int fill_cache_read(unsigned char *buf, size_t buf_size, bool once) in fill_cache_read() argument
110 ret = fill_one_span_read(buf, buf_size); in fill_cache_read()
127 static int fill_cache_write(unsigned char *buf, size_t buf_size, bool once) in fill_cache_write() argument
130 fill_one_span_write(buf, buf_size); in fill_cache_write()
138 static int fill_cache(size_t buf_size, int memflush, int op, bool once) in fill_cache() argument
143 buf = malloc_and_init_memory(buf_size); in fill_cache()
149 mem_flush(buf, buf_size); in fill_cache()
152 ret = fill_cache_read(buf, buf_size, once); in fill_cache()
154 ret = fill_cache_write(buf, buf_size, once); in fill_cache()