buf = map_sysmem(addr, bytes);
while (count-- > 0) {
if (size == 4)
- *((ulong *)buf) = (ulong)writeval;
+ *((u32 *)buf) = (u32)writeval;
else if (size == 2)
- *((ushort *)buf) = (ushort)writeval;
+ *((u16 *)buf) = (u16)writeval;
else
- *((u_char *)buf) = (u_char)writeval;
+ *((u8 *)buf) = (u8)writeval;
buf += size;
}
unmap_sysmem(buf);
for (ngood = 0; ngood < count; ++ngood) {
ulong word1, word2;
if (size == 4) {
- word1 = *(ulong *)buf1;
- word2 = *(ulong *)buf2;
+ word1 = *(u32 *)buf1;
+ word2 = *(u32 *)buf2;
} else if (size == 2) {
- word1 = *(ushort *)buf1;
- word2 = *(ushort *)buf2;
+ word1 = *(u16 *)buf1;
+ word2 = *(u16 *)buf2;
} else {
- word1 = *(u_char *)buf1;
- word2 = *(u_char *)buf2;
+ word1 = *(u8 *)buf1;
+ word2 = *(u8 *)buf2;
}
if (word1 != word2) {
ulong offset = buf1 - base;
src = map_sysmem(addr, bytes);
while (count-- > 0) {
if (size == 4)
- *((ulong *)buf) = *((ulong *)src);
+ *((u32 *)buf) = *((u32 *)src);
else if (size == 2)
- *((ushort *)buf) = *((ushort *)src);
+ *((u16 *)buf) = *((u16 *)src);
else
- *((u_char *)buf) = *((u_char *)src);
+ *((u8 *)buf) = *((u8 *)src);
src += size;
buf += size;
{
ulong addr, length, i, bytes;
int size;
- volatile uint *longp;
- volatile ushort *shortp;
- volatile u_char *cp;
+ volatile u32 *longp;
+ volatile u16 *shortp;
+ volatile u8 *cp;
const void *buf;
if (argc < 3)
*/
if (length == 1) {
if (size == 4) {
- longp = (uint *)buf;
+ longp = (u32 *)buf;
for (;;)
i = *longp;
}
if (size == 2) {
- shortp = (ushort *)buf;
+ shortp = (u16 *)buf;
for (;;)
i = *shortp;
}
- cp = (u_char *)buf;
+ cp = (u8 *)buf;
for (;;)
i = *cp;
}
if (size == 4) {
for (;;) {
- longp = (uint *)buf;
+ longp = (u32 *)buf;
i = length;
while (i-- > 0)
*longp++;
}
if (size == 2) {
for (;;) {
- shortp = (ushort *)buf;
+ shortp = (u16 *)buf;
i = length;
while (i-- > 0)
*shortp++;
}
}
for (;;) {
- cp = (u_char *)buf;
+ cp = (u8 *)buf;
i = length;
while (i-- > 0)
*cp++;
{
ulong addr, length, i, data, bytes;
int size;
- volatile uint *longp;
- volatile ushort *shortp;
- volatile u_char *cp;
+ volatile u32 *longp;
+ volatile u16 *shortp;
+ volatile u8 *cp;
void *buf;
if (argc < 4)
*/
if (length == 1) {
if (size == 4) {
- longp = (uint *)buf;
+ longp = (u32 *)buf;
for (;;)
*longp = data;
}
if (size == 2) {
- shortp = (ushort *)buf;
+ shortp = (u16 *)buf;
for (;;)
*shortp = data;
}
- cp = (u_char *)buf;
+ cp = (u8 *)buf;
for (;;)
*cp = data;
}
if (size == 4) {
for (;;) {
- longp = (uint *)buf;
+ longp = (u32 *)buf;
i = length;
while (i-- > 0)
*longp++ = data;
}
if (size == 2) {
for (;;) {
- shortp = (ushort *)buf;
+ shortp = (u16 *)buf;
i = length;
while (i-- > 0)
*shortp++ = data;
}
}
for (;;) {
- cp = (u_char *)buf;
+ cp = (u8 *)buf;
i = length;
while (i-- > 0)
*cp++ = data;
ptr = map_sysmem(addr, size);
printf("%08lx:", addr);
if (size == 4)
- printf(" %08x", *((uint *)ptr));
+ printf(" %08x", *((u32 *)ptr));
else if (size == 2)
- printf(" %04x", *((ushort *)ptr));
+ printf(" %04x", *((u16 *)ptr));
else
- printf(" %02x", *((u_char *)ptr));
+ printf(" %02x", *((u8 *)ptr));
nbytes = readline (" ? ");
if (nbytes == 0 || (nbytes == 1 && console_buffer[0] == '-')) {
reset_cmd_timeout();
#endif
if (size == 4)
- *((uint *)ptr) = i;
+ *((u32 *)ptr) = i;
else if (size == 2)
- *((ushort *)ptr) = i;
+ *((u16 *)ptr) = i;
else
- *((u_char *)ptr) = i;
+ *((u8 *)ptr) = i;
if (incrflag)
addr += size;
}