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