about summary refs log tree commit diff
path: root/include/cmplog.h
blob: d59472267853931a6892a76b0ac12a4b726ea15e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#ifndef _AFL_REDQUEEN_H
#define _AFL_REDQUEEN_H

#include "config.h"

#define CMP_MAP_W 65536
#define CMP_MAP_H 256

#define SHAPE_BYTES(x) (x + 1)

#define CMP_TYPE_INS 0
#define CMP_TYPE_RTN 1

struct cmp_header {

  unsigned hits : 20;

  unsigned cnt : 20;
  unsigned id : 16;

  unsigned shape : 5;  // from 0 to 31
  unsigned type : 1;

} __attribute__((packed));

struct cmp_operands {

  u64 v0;
  u64 v1;

};

struct cmpfn_operands {

  u8 v0[32];
  u8 v1[32];

};

typedef struct cmp_operands cmp_map_list[CMP_MAP_H];

struct cmp_map {

  struct cmp_header   headers[CMP_MAP_W];
  struct cmp_operands log[CMP_MAP_W][CMP_MAP_H];

};

#endif