1 // Copyright 2016 The Fuchsia Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #pragma once
6 
7 #include <stddef.h>
8 #include <stdint.h>
9 #include <zircon/compiler.h>
10 
11 __BEGIN_CDECLS;
12 
13 /* do a hex dump against stdout 32bits and 8bits at a time */
14 void hexdump_ex(const void* ptr, size_t len, uint64_t disp_addr);
15 void hexdump8_ex(const void* ptr, size_t len, uint64_t disp_addr);
16 
hexdump(const void * ptr,size_t len)17 static inline void hexdump(const void* ptr, size_t len) {
18     hexdump_ex(ptr, len, (uint64_t)((uintptr_t)ptr));
19 }
20 
hexdump8(const void * ptr,size_t len)21 static inline void hexdump8(const void* ptr, size_t len) {
22     hexdump8_ex(ptr, len, (uint64_t)((uintptr_t)ptr));
23 }
24 
25 __END_CDECLS;
26