diff options
author | Timo Dritschler <timo.dritschler@kit.edu> | 2014-04-28 19:24:44 +0200 |
---|---|---|
committer | Timo Dritschler <timo.dritschler@kit.edu> | 2014-04-28 19:28:23 +0200 |
commit | 6b28a07e6bba885b3f33e7b81d3e76544f18ce07 (patch) | |
tree | 16b114536cd35b79545c098a747700dedcaebe3e /test.c | |
parent | 3405180e97cd6b4d4bef6fed2a7e666eb8126906 (diff) | |
download | kiro-6b28a07e6bba885b3f33e7b81d3e76544f18ce07.tar.gz kiro-6b28a07e6bba885b3f33e7b81d3e76544f18ce07.tar.bz2 kiro-6b28a07e6bba885b3f33e7b81d3e76544f18ce07.tar.xz kiro-6b28a07e6bba885b3f33e7b81d3e76544f18ce07.zip |
Added new function 'kiro_trb_dma_push' that allows the user to directly
write a new element into the buffers memory
Changed the name of 'kiro_trb_ingest' to 'kiro_trb_adopt'
Added new function 'kiro_trb_clone' that copies the pointed memory
before 'adopting' it.
Started to add documentation
Diffstat (limited to 'test.c')
-rw-r--r-- | test.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -31,16 +31,16 @@ int main(void) void *buffer = kiro_trb_get_raw_buffer(rb); uint64_t foo = 0xAFFED00F; uint64_t bar = 0x1337BEEF; - kiro_trb_push(rb, &foo); - kiro_trb_push(rb, &foo); - kiro_trb_push(rb, &foo); + memcpy(kiro_trb_dma_push(rb), &foo, sizeof(foo)); + memcpy(kiro_trb_dma_push(rb), &foo, sizeof(foo)); + memcpy(kiro_trb_dma_push(rb), &foo, sizeof(foo)); kiro_trb_push(rb, &bar); kiro_trb_push(rb, &foo); kiro_trb_push(rb, &foo); uint64_t *maman = kiro_trb_get_element(rb, 3); printf("Stored in old: %x\n", *maman); KiroTrb *rb2 = g_object_new(KIRO_TYPE_TRB, NULL); - kiro_trb_ingest(rb2, kiro_trb_get_raw_buffer(rb)); + kiro_trb_clone(rb2, kiro_trb_get_raw_buffer(rb)); maman = kiro_trb_get_element(rb2, 3); printf("Stored in New: %x\n", *maman); sleep(1); |