Mercurial > ecos-v3_0-branch
annotate packages/redboot/current/src/dump.c @ 2729:74dbf4c3f2e1 after-copyright-change-20090129
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
| author | jlarmour |
|---|---|
| date | Thu, 29 Jan 2009 17:47:46 +0000 |
| parents | a6e5ade47511 |
| children |
| rev | line source |
|---|---|
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
1 //========================================================================== |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
2 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
3 // dump.c |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
4 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
5 // RedBoot dump support |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
6 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
7 //========================================================================== |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
8 // ####ECOSGPLCOPYRIGHTBEGIN#### |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
9 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
10 // This file is part of eCos, the Embedded Configurable Operating System. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
11 // Copyright (C) 1998, 1999, 2000, 2001, 2002 Free Software Foundation, Inc. |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
12 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
13 // eCos is free software; you can redistribute it and/or modify it under |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
14 // the terms of the GNU General Public License as published by the Free |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
15 // Software Foundation; either version 2 or (at your option) any later |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
16 // version. |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
17 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
18 // eCos is distributed in the hope that it will be useful, but WITHOUT |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
19 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
20 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
21 // for more details. |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
22 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
23 // You should have received a copy of the GNU General Public License |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
24 // along with eCos; if not, write to the Free Software Foundation, Inc., |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
25 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
26 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
27 // As a special exception, if other files instantiate templates or use |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
28 // macros or inline functions from this file, or you compile this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
29 // and link it with other works to produce a work based on this file, |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
30 // this file does not by itself cause the resulting work to be covered by |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
31 // the GNU General Public License. However the source code for this file |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
32 // must still be made available in accordance with section (3) of the GNU |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
33 // General Public License v2. |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
34 // |
|
2729
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
35 // This exception does not invalidate any other reasons why a work based |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
36 // on this file might be covered by the GNU General Public License. |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
37 // ------------------------------------------- |
|
74dbf4c3f2e1
Update all copyright banners to reflect FSF ownership; fix and improve licence text.
jlarmour
parents:
2009
diff
changeset
|
38 // ####ECOSGPLCOPYRIGHTEND#### |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
39 //========================================================================== |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
40 //#####DESCRIPTIONBEGIN#### |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
41 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
42 // Author(s): gthomas |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
43 // Contributors: gthomas |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
44 // Date: 2002-08-06 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
45 // Purpose: |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
46 // Description: |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
47 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
48 // This code is part of RedBoot (tm). |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
49 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
50 //####DESCRIPTIONEND#### |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
51 // |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
52 //========================================================================== |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
53 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
54 #include <redboot.h> |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
55 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
56 RedBoot_cmd("dump", |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
57 "Display (hex dump) a range of memory", |
| 2009 | 58 "-b <location> [-l <length>] [-s] [-1|-2|-4]", |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
59 do_dump |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
60 ); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
61 RedBoot_cmd("x", |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
62 "Display (hex dump) a range of memory", |
| 2009 | 63 "-b <location> [-l <length>] [-s] [-1|-2|-4]", |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
64 do_x |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
65 ); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
66 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
67 void |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
68 do_dump(int argc, char *argv[]) |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
69 { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
70 struct option_info opts[6]; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
71 unsigned long base, len; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
72 bool base_set, len_set; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
73 static unsigned long _base, _len; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
74 static char _size = 1; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
75 bool srec_dump, set_32bit, set_16bit, set_8bit; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
76 int i, n, off, cksum; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
77 cyg_uint8 ch; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
78 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
79 init_opts(&opts[0], 'b', true, OPTION_ARG_TYPE_NUM, |
| 1513 | 80 (void *)&base, (bool *)&base_set, "base address"); |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
81 init_opts(&opts[1], 'l', true, OPTION_ARG_TYPE_NUM, |
| 1513 | 82 (void *)&len, (bool *)&len_set, "length"); |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
83 init_opts(&opts[2], 's', false, OPTION_ARG_TYPE_FLG, |
| 1513 | 84 (void *)&srec_dump, 0, "dump data using Morotola S-records"); |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
85 init_opts(&opts[3], '4', false, OPTION_ARG_TYPE_FLG, |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
86 (void *)&set_32bit, (bool *)0, "dump 32 bit units"); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
87 init_opts(&opts[4], '2', false, OPTION_ARG_TYPE_FLG, |
| 1513 | 88 (void *)&set_16bit, (bool *)0, "dump 16 bit units"); |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
89 init_opts(&opts[5], '1', false, OPTION_ARG_TYPE_FLG, |
| 1513 | 90 (void *)&set_8bit, (bool *)0, "dump 8 bit units"); |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
91 if (!scan_opts(argc, argv, 1, opts, 6, 0, 0, "")) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
92 return; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
93 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
94 if (!base_set) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
95 if (_base == 0) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
96 diag_printf("Dump what [location]?\n"); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
97 return; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
98 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
99 base = _base; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
100 if (!len_set) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
101 len = _len; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
102 len_set = true; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
103 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
104 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
105 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
106 if (set_32bit) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
107 _size = 4; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
108 } else if (set_16bit) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
109 _size = 2; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
110 } else if (set_8bit) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
111 _size = 1; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
112 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
113 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
114 if (!len_set) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
115 len = 32; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
116 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
117 if (srec_dump) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
118 off = 0; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
119 while (off < len) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
120 n = (len > 16) ? 16 : len; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
121 cksum = n+5; |
|
1954
6beba10c1713
* src/net/net_io.c (net_init): Don't initialize the network if we
asl
parents:
1513
diff
changeset
|
122 diag_printf("S3%02X%08lX", n+5, off+base); |
|
264
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
123 for (i = 0; i < 4; i++) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
124 cksum += (((base+off)>>(i*8)) & 0xFF); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
125 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
126 for (i = 0; i < n; i++) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
127 ch = *(cyg_uint8 *)(base+off+i); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
128 diag_printf("%02X", ch); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
129 cksum += ch; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
130 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
131 diag_printf("%02X\n", ~cksum & 0xFF); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
132 off += n; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
133 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
134 } else { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
135 switch( _size ) { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
136 case 1: |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
137 diag_dump_buf((void *)base, len); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
138 break; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
139 case 2: |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
140 diag_dump_buf_16bit((void *)base, len); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
141 break; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
142 case 4: |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
143 diag_dump_buf_32bit((void *)base, len); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
144 break; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
145 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
146 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
147 _base = base + len; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
148 _len = len; |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
149 } |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
150 |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
151 // Simple alias for the dump command |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
152 void |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
153 do_x(int argc, char *argv[]) |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
154 { |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
155 do_dump(argc, argv); |
|
57f3c72256bb
Reorg CLI functions into separate files. Update CDL. Fix macros in scripts.
gthomas
parents:
diff
changeset
|
156 } |
