4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
\r
6 * Contact: Junhwan An <jh48.an@samsung.com>
\r
8 * Licensed under the Apache License, Version 2.0 (the "License");
\r
9 * you may not use this file except in compliance with the License.
\r
10 * You may obtain a copy of the License at
\r
12 * http://www.apache.org/licenses/LICENSE-2.0
\r
14 * Unless required by applicable law or agreed to in writing, software
\r
15 * distributed under the License is distributed on an "AS IS" BASIS,
\r
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
17 * See the License for the specific language governing permissions and
\r
18 * limitations under the License.
\r
26 #include "vdpram_dump.h"
\r
28 static void hex_dump(char *pad, int size, const void *data)
\r
30 char buf[255] = {0, };
\r
31 char hex[4] = {0, };
\r
36 msg("%sno data", pad);
\r
40 p = (unsigned char *)data;
\r
42 snprintf(buf, 255, "%s%04X: ", pad, 0);
\r
43 for (i = 0; i<size; i++) {
\r
44 snprintf(hex, 4, "%02X ", p[i]);
\r
47 if ((i + 1) % 8 == 0) {
\r
48 if ((i + 1) % 16 == 0) {
\r
50 memset(buf, 0, 255);
\r
51 snprintf(buf, 255, "%s%04X: ", pad, i + 1);
\r
62 void vdpram_hex_dump(int dir, unsigned short data_len, void *data)
\r
75 msg(" %s\tlen=%d\t%s", d, data_len, (char *)data);
\r
76 hex_dump(" ", data_len, data);
\r