diff options
author | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-14 00:29:21 +0100 |
---|---|---|
committer | Suren A. Chilingaryan <csa@dside.dyndns.org> | 2011-12-14 00:29:21 +0100 |
commit | c4c9ad7708ddd3114f78c5f860ebfeb92cfb79c3 (patch) | |
tree | 19063034154415a9a0076b18d7b626dad50bc2ea /kmem.c | |
parent | a7cd579fbd12fdfc84ac5eff32dd5af093d78631 (diff) | |
download | ipecamera-c4c9ad7708ddd3114f78c5f860ebfeb92cfb79c3.tar.gz ipecamera-c4c9ad7708ddd3114f78c5f860ebfeb92cfb79c3.tar.bz2 ipecamera-c4c9ad7708ddd3114f78c5f860ebfeb92cfb79c3.tar.xz ipecamera-c4c9ad7708ddd3114f78c5f860ebfeb92cfb79c3.zip |
Synchronize kernel buffers during the read-kernel-memory and while accessing via sysfs
Diffstat (limited to 'kmem.c')
-rw-r--r-- | kmem.c | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -229,18 +229,13 @@ void pcilib_free_kernel_memory(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_km } /* -int pcilib_sync_kernel_memory(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_kmem_sync_direction_t dir) { +int pcilib_kmem_sync(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_kmem_sync_direction_t dir) { int i; int ret; - kmem_sync_t ks; pcilib_kmem_list_t *kbuf = (pcilib_kmem_list_t*)k; - ks.dir = dir; - for (i = 0; i < kbuf->buf.n_blocks; i++) { - ks.handle.handle_id = kbuf->buf.blocks[i].handle_id; - ks.handle.pa = kbuf->buf.blocks[i].pa; - ret = ioctl(ctx->handle, PCIDRIVER_IOC_KMEM_SYNC, &ks); + ret = pcilib_kmem_sync_block(ctx, k, dir, i); if (ret) { pcilib_error("PCIDRIVER_IOC_KMEM_SYNC ioctl have failed"); return PCILIB_ERROR_FAILED; @@ -249,7 +244,6 @@ int pcilib_sync_kernel_memory(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_kme return 0; } - */ int pcilib_kmem_sync_block(pcilib_t *ctx, pcilib_kmem_handle_t *k, pcilib_kmem_sync_direction_t dir, size_t block) { |