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 /driver/sysfs.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 'driver/sysfs.c')
-rw-r--r-- | driver/sysfs.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/driver/sysfs.c b/driver/sysfs.c index be6f7d9..37cf362 100644 --- a/driver/sysfs.c +++ b/driver/sysfs.c @@ -101,9 +101,10 @@ static SYSFS_GET_FUNCTION(pcidriver_show_kmem_entry) int id = simple_strtol(attr->attr.name + strlen("kbuf"), NULL, 10); pcidriver_kmem_entry_t *entry = pcidriver_kmem_find_entry_id(privdata, id); if (entry) - if (entry->size >= 16) + if (entry->size >= 16) { + pcidriver_kmem_sync_entry(privdata, entry, PCILIB_KMEM_SYNC_FROMDEVICE); return snprintf(buf, PAGE_SIZE, "buffer: %d\ntype: %lx\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\ndata: %8x %8x %8x %8x\n", id, entry->type, entry->use, entry->item, entry->size, entry->refs&KMEM_REF_COUNT, (entry->refs&KMEM_REF_HW)?1:0, entry->mode, *(u32*)(entry->cpua), *(u32*)(entry->cpua + 4), *(u32*)(entry->cpua + 8), *(u32*)(entry->cpua + 12)); - else + } else return snprintf(buf, PAGE_SIZE, "buffer: %d\ntype: %lx\nuse: 0x%lx\nitem: %lu\nsize: %lu\nrefs: %lu\nhw ref: %i\nmode: 0x%lx\n", id, entry->type, entry->use, entry->item, entry->size, entry->refs&KMEM_REF_COUNT, (entry->refs&KMEM_REF_HW)?1:0, entry->mode); else return snprintf(buf, PAGE_SIZE, "I am in the kmem_entry show function for buffer %d\n", id); |