diff options
author | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-04-12 13:27:23 +0000 |
---|---|---|
committer | drath <drath@b42882b7-edfa-0310-969c-e2dbd0fdcd60> | 2007-04-12 13:27:23 +0000 |
commit | 999f86b92b8efe89976e8196a19350a9822e0ca7 (patch) | |
tree | b10c374534c0a0331a27752d1a6e05daafebeb4d /src/helper | |
parent | a48a5e6d94dc98cf69d15be133ae7b8283126bbe (diff) | |
download | riscv-openocd-999f86b92b8efe89976e8196a19350a9822e0ca7.zip riscv-openocd-999f86b92b8efe89976e8196a19350a9822e0ca7.tar.gz riscv-openocd-999f86b92b8efe89976e8196a19350a9822e0ca7.tar.bz2 |
- correctly mask out bits that aren't part of a copied buffer
- fixed arm926ej-s CP15 register access handling
- correctly identify SYSCLK source in LPC3180 NAND flash controller driver
git-svn-id: svn://svn.berlios.de/openocd/trunk@139 b42882b7-edfa-0310-969c-e2dbd0fdcd60
Diffstat (limited to 'src/helper')
-rw-r--r-- | src/helper/binarybuffer.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/helper/binarybuffer.c b/src/helper/binarybuffer.c index 7d41dc7..acc8237 100644 --- a/src/helper/binarybuffer.c +++ b/src/helper/binarybuffer.c @@ -101,6 +101,12 @@ u8* buf_cpy(u8 *from, u8 *to, int size) for (i = 0; i < num_bytes; i++) to[i] = from[i]; + + /* mask out bits that don't belong to the buffer */ + if (size % 8) + { + to[size / 8] &= (0xff >> (8 - (size % 8))); + } return to; } |