2 * Copyright (C) 2017 Chelsio Communications. All rights reserved.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
13 * The full GNU General Public License is included in this distribution in
14 * the file called "COPYING".
18 #ifndef __CUDBG_LIB_COMMON_H__
19 #define __CUDBG_LIB_COMMON_H__
21 #define CUDBG_SIGNATURE 67856866 /* CUDB in ascii */
23 enum cudbg_dump_type
{
24 CUDBG_DUMP_TYPE_MINI
= 1,
27 enum cudbg_compression_type
{
28 CUDBG_COMPRESSION_NONE
= 1,
29 CUDBG_COMPRESSION_ZLIB
,
47 struct cudbg_entity_hdr
{
55 u8 flag
; /* bit 0 is used to indicate ext data */
57 u32 next_ext_offset
; /* pointer to next extended entity meta data */
61 struct cudbg_ver_hdr
{
79 #define CDUMP_MAX_COMP_BUF_SIZE ((64 * 1024) - 1)
80 #define CUDBG_CHUNK_SIZE ((CDUMP_MAX_COMP_BUF_SIZE / 1024) * 1024)
82 int cudbg_get_buff(struct cudbg_init
*pdbg_init
,
83 struct cudbg_buffer
*pdbg_buff
, u32 size
,
84 struct cudbg_buffer
*pin_buff
);
85 void cudbg_put_buff(struct cudbg_init
*pdbg_init
,
86 struct cudbg_buffer
*pin_buff
);
87 void cudbg_update_buff(struct cudbg_buffer
*pin_buff
,
88 struct cudbg_buffer
*pout_buff
);
89 #endif /* __CUDBG_LIB_COMMON_H__ */