No empty .Rs/.Re
[netbsd-mini2440.git] / sys / arch / mvme68k / stand / prtvid / prtvid.c
blob342356b6cfd16fbf90423106ce7c4094ad283974
1 /* $NetBSD: prtvid.c,v 1.2 2002/05/04 22:05:30 scw Exp $ */
3 #include <stdio.h>
4 #define __DBINTERFACE_PRIVATE
5 #include <db.h>
6 #include <machine/disklabel.h>
8 int
9 main(int argc, char *argv[])
11 struct cpu_disklabel *cdl;
13 cdl = malloc(sizeof (struct cpu_disklabel));
15 fread(cdl, sizeof(struct cpu_disklabel), 1, stdin);
17 if (BYTE_ORDER != BIG_ENDIAN)
18 swabvid(cdl);
20 printf("vid_id %s %x\n", cdl->vid_id,
21 (char *)&(cdl->vid_id[4]) - (char *)cdl);
22 printf("vid_oss %x %x\n", cdl->vid_oss,
23 (char *)&(cdl->vid_oss) - (char *)cdl);
24 printf("vid_osl %x %x\n", cdl->vid_osl,
25 (char *)&(cdl->vid_osl) - (char *)cdl);
26 printf("vid_osa_u %x %x\n", cdl->vid_osa_u,
27 (char *)&(cdl->vid_osa_u) - (char *)cdl);
28 printf("vid_osa_l %x %x\n", cdl->vid_osa_l,
29 (char *)&(cdl->vid_osa_l) - (char *)cdl);
30 printf("vid_vd %x\n",
31 (char *)&(cdl->vid_vd) - (char *)cdl);
32 printf("vid_cas %x %x\n", cdl->vid_cas,
33 (char *)&(cdl->vid_cas) - (char *)cdl);
34 printf("vid_cal %x %x\n", cdl->vid_cal,
35 (char *)&(cdl->vid_cal) - (char *)cdl);
36 printf("vid_moto %s %x\n", cdl->vid_mot,
37 (char *)&(cdl->vid_mot[0]) - (char *)cdl);
39 if (BYTE_ORDER != BIG_ENDIAN)
40 swabcfg(cdl);
42 printf("cfg_atm %x %x\n", cdl->cfg_atm,
43 (char *)&(cdl->cfg_atm) - (char *)(cdl));
44 printf("cfg_prm %x %x\n", cdl->cfg_prm,
45 (char *)&(cdl->cfg_prm) - (char *)(cdl));
46 printf("cfg_atw %x %x\n", cdl->cfg_atw,
47 (char *)&(cdl->cfg_atw) - (char *)(cdl));
48 printf("cfg_rec %x %x\n",(long)cdl->cfg_rec,
49 (char *)&(cdl->cfg_rec) - (char *)(cdl));
50 printf("cfg_spt %x %x\n", cdl->cfg_spt,
51 (char *)&(cdl->cfg_spt) - (char *)(cdl));
52 printf("cfg_hds %x %x\n", cdl->cfg_hds,
53 (char *)&(cdl->cfg_hds) - (char *)(cdl));
54 printf("cfg_trk %x %x\n", cdl->cfg_trk,
55 (char *)&(cdl->cfg_trk) - (char *)(cdl));
56 printf("cfg_ilv %x %x\n", cdl->cfg_ilv,
57 (char *)&(cdl->cfg_ilv) - (char *)(cdl));
58 printf("cfg_sof %x %x\n", cdl->cfg_sof,
59 (char *)&(cdl->cfg_sof) - (char *)(cdl));
60 printf("cfg_psm %x %x\n", cdl->cfg_psm,
61 (char *)&(cdl->cfg_psm) - (char *)(cdl));
62 printf("cfg_shd %x %x\n", cdl->cfg_shd,
63 (char *)&(cdl->cfg_shd) - (char *)(cdl));
64 printf("cfg_pcom %x %x\n", cdl->cfg_pcom,
65 (char *)&(cdl->cfg_pcom) - (char *)(cdl));
66 printf("cfg_ssr %x %x\n", cdl->cfg_ssr,
67 (char *)&(cdl->cfg_ssr) - (char *)(cdl));
68 printf("cfg_rwcc %x %x\n", cdl->cfg_rwcc,
69 (char *)&(cdl->cfg_rwcc) - (char *)(cdl));
70 printf("cfg_ecc %x %x\n", cdl->cfg_ecc,
71 (char *)&(cdl->cfg_ecc) - (char *)(cdl));
72 printf("cfg_eatm %x %x\n", cdl->cfg_eatm,
73 (char *)&(cdl->cfg_eatm) - (char *)(cdl));
74 printf("cfg_eprm %x %x\n", cdl->cfg_eprm,
75 (char *)&(cdl->cfg_eprm) - (char *)(cdl));
76 printf("cfg_eatw %x %x\n", cdl->cfg_eatw,
77 (char *)&(cdl->cfg_eatw) - (char *)(cdl));
78 printf("cfg_gpb1 %x %x\n", cdl->cfg_gpb1,
79 (char *)&(cdl->cfg_gpb1) - (char *)(cdl));
80 printf("cfg_gpb2 %x %x\n", cdl->cfg_gpb2,
81 (char *)&(cdl->cfg_gpb2) - (char *)(cdl));
82 printf("cfg_gpb3 %x %x\n", cdl->cfg_gpb3,
83 (char *)&(cdl->cfg_gpb3) - (char *)(cdl));
84 printf("cfg_gpb4 %x %x\n", cdl->cfg_gpb4,
85 (char *)&(cdl->cfg_gpb4) - (char *)(cdl));
86 printf("cfg_ssc %x %x\n", cdl->cfg_ssc,
87 (char *)&(cdl->cfg_ssc) - (char *)(cdl));
88 printf("cfg_runit %x %x\n", cdl->cfg_runit,
89 (char *)&(cdl->cfg_runit) - (char *)(cdl));
90 printf("cfg_rsvc1 %x %x\n", cdl->cfg_rsvc1,
91 (char *)&(cdl->cfg_rsvc1) - (char *)(cdl));
92 printf("cfg_rsvc2 %x %x\n", cdl->cfg_rsvc2,
93 (char *)&(cdl->cfg_rsvc2) - (char *)(cdl));
96 swabvid(struct cpu_disklabel *cdl)
99 M_32_SWAP(cdl->vid_oss);
100 M_16_SWAP(cdl->vid_osl);
101 M_16_SWAP(cdl->vid_osa_u);
102 M_16_SWAP(cdl->vid_osa_l);
103 M_32_SWAP(cdl->vid_cas);
106 swabcfg(struct cpu_disklabel *cdl)
109 printf("swapping cfg\n");
111 M_16_SWAP(cdl->cfg_atm);
112 M_16_SWAP(cdl->cfg_prm);
113 M_16_SWAP(cdl->cfg_atm);
114 M_16_SWAP(cdl->cfg_rec);
115 M_16_SWAP(cdl->cfg_trk);
116 M_16_SWAP(cdl->cfg_psm);
117 M_16_SWAP(cdl->cfg_shd);
118 M_16_SWAP(cdl->cfg_pcom);
119 M_16_SWAP(cdl->cfg_rwcc);
120 M_16_SWAP(cdl->cfg_ecc);
121 M_16_SWAP(cdl->cfg_eatm);
122 M_16_SWAP(cdl->cfg_eprm);
123 M_16_SWAP(cdl->cfg_eatw);
124 M_16_SWAP(cdl->cfg_rsvc1);
125 M_16_SWAP(cdl->cfg_rsvc2);