static char sccsid
[] = "@(#)hylog.c 4.2 (Berkeley) 7/8/83";
static char origsccsid
[] = "@(#)hylog.c 1.2 Hyperchannel Log Printer 82/11/29";
#define ok(x) (((int)(x)) & 0x7fffffff)
#include <vaxif/if_hyreg.h>
register unsigned char *p
, *ep
;
if ((mem
= open("/dev/kmem", 0)) < 0)
done("Can't oper /dev/kmem\n");
lseek(mem
, (long)nl
[0].n_value
, 0);
read(mem
, &hy_log
, sizeof(hy_log
));
if (ok(hy_log
.hyl_self
) != ok(nl
[0].n_value
))
done("hy_log.hyl_self not self referencing (namelist mismatch?)\n");
ep
= &hy_log
.hyl_buf
[ok(hy_log
.hyl_ptr
) -
ok(& ( (struct hy_log
*) (nl
[0].n_value
) )->hyl_buf
[0])];
printf("%d bytes in log buffer\n", ep
- p
);
printf(" %s %08lx", name, *(unsigned long *)p); \
p += sizeof(unsigned long);
printf(" %s %02x%02x%02x%02x", name, p[0], p[1], p[2], p[3]); \
p += sizeof(unsigned long);
printf(" %s %02x%02x", name, p[0], p[1]); \
p += sizeof(unsigned short);
printf(" %s %04x", name, *(unsigned short *)p); \
p += sizeof(unsigned short);
#define pbyte(name) printf(" %s %02x", name, *p++);
case HYL_UP
: /* no data */
if (*p
!= sizeof(struct hy_stat
))
pnlong("msgcnt"); pnlong("dbcnt");
pnlong("tbusy"); pnlong("hwret");
pnlong("crcbad"); pnlong("mcret"); pnlong("tdabort");
if (*p
!= (sizeof(struct hy_hdr
) + sizeof(short)))
if (*p
!= (sizeof(struct hy_hdr
) + sizeof(short)))
printf("unknown %d -", *p
);