Index: diag.cxx =================================================================== RCS file: /cvs/ecos/ecos/packages/infra/current/src/diag.cxx,v retrieving revision 1.9 diff -u -p -r1.9 diag.cxx --- diag.cxx 2001/09/12 04:21:15 1.9 +++ diag.cxx 2001/10/17 13:55:19 @@ -51,6 +51,7 @@ #include // architectural stuff for... #include // interrupt control #include // diagnostic output routines +#include // io read/write to memory #include #include @@ -596,6 +597,57 @@ diag_dump_buf(void *p, CYG_ADDRWORD s) { diag_dump_buf_with_offset((cyg_uint8 *)p, s, 0); } + +void +diag_dump_buf_with_offset_long(cyg_uint32 *p, + CYG_ADDRWORD s, + cyg_uint32 *base) +{ + int i, c; + if ((CYG_ADDRWORD)s > (CYG_ADDRWORD)p) { + s = (CYG_ADDRWORD)s - (CYG_ADDRWORD)p; + } + while ((int)s > 0) { + if (base) { + diag_printf("%08X: ", (CYG_ADDRWORD)p - (CYG_ADDRWORD)base); + } else { + diag_printf("%08X: ", p); + } + for (i = 0; i < 4; i++) { + if (i < (int)s/4) { + diag_printf("%08X ", p[i] ); + } else { + diag_printf(" "); + } + } + diag_printf("\n"); + s -= 16; + p += 4; + } +} + +externC void +diag_dump_buf_long(void *p, CYG_ADDRWORD s) +{ + diag_dump_buf_with_offset_long((cyg_uint32 *)p, s, 0); +} + +externC void +diag_edit(void *p, unsigned long x, unsigned long s) +{ + switch(s) { + case 1: + HAL_WRITE_UINT8(p,(unsigned char) x); + break; + case 2: + HAL_WRITE_UINT16(p,(unsigned short) x); + break; + case 4: + HAL_WRITE_UINT32(p,(unsigned long) x); + break; + } +} + /*-----------------------------------------------------------------------*/ /* EOF infra/diag.c */