]> git.zerfleddert.de Git - proxmark3-svn/blob - armsrc/BigBuf.h
Refactoring of BigBuf handling in order to prepare for more efficient memory allocati...
[proxmark3-svn] / armsrc / BigBuf.h
1 //-----------------------------------------------------------------------------
2 // Jonathan Westhues, Aug 2005
3 // Gerhard de Koning Gans, April 2008, May 2011
4 //
5 // This code is licensed to you under the terms of the GNU GPL, version 2 or,
6 // at your option, any later version. See the LICENSE.txt file for the text of
7 // the license.
8 //-----------------------------------------------------------------------------
9 // BigBuf and functions to allocate/free parts of it.
10 //-----------------------------------------------------------------------------
11
12 #ifndef __BIGBUF_H
13 #define __BIGBUF_H
14
15
16 #define BIGBUF_SIZE 40000
17 #define TRACE_OFFSET 0
18 #define TRACE_SIZE 3000
19 #define RECV_CMD_OFFSET (TRACE_OFFSET + TRACE_SIZE)
20 #define MAX_FRAME_SIZE 256
21 #define MAX_PARITY_SIZE ((MAX_FRAME_SIZE + 1)/ 8)
22 #define RECV_CMD_PAR_OFFSET (RECV_CMD_OFFSET + MAX_FRAME_SIZE)
23 #define RECV_RESP_OFFSET (RECV_CMD_PAR_OFFSET + MAX_PARITY_SIZE)
24 #define RECV_RESP_PAR_OFFSET (RECV_RESP_OFFSET + MAX_FRAME_SIZE)
25 #define CARD_MEMORY_OFFSET (RECV_RESP_PAR_OFFSET + MAX_PARITY_SIZE)
26 #define CARD_MEMORY_SIZE 4096
27 #define DMA_BUFFER_OFFSET CARD_MEMORY_OFFSET
28 #define DMA_BUFFER_SIZE CARD_MEMORY_SIZE
29 #define FREE_BUFFER_OFFSET (CARD_MEMORY_OFFSET + CARD_MEMORY_SIZE)
30 #define FREE_BUFFER_SIZE (BIGBUF_SIZE - FREE_BUFFER_OFFSET - 1)
31
32 extern uint8_t *BigBuf_get_addr(void);
33 extern uint16_t BigBuf_max_trace_len(void);
34 void BigBuf_Clear(void);
35 extern uint8_t *BigBuf_malloc(uint16_t);
36 extern void BigBuf_free(void);
37
38 extern uint16_t traceLen;
39
40 #endif /* __BIGBUF_H */
Impressum, Datenschutz