fix error for unaligned accesses

This commit is contained in:
rjkm 2021-01-13 14:56:22 +01:00
parent 46c42c6ef0
commit e413baeab9
1 changed files with 2 additions and 2 deletions

View File

@ -139,8 +139,8 @@ void gtlcpyfrom(struct ddb *dev, u8 *buf, u32 adr, long count)
u32 a = p & 3;
if (a) {
val = ddbreadl(dev, p) >> (8 * a);
while (p & 3 && count) {
val = ddbreadl(dev, p & ~3) >> (8 * a);
while ((p & 3) && count) {
*buf = val & 0xff;
val >>= 8;
p++;