summaryrefslogtreecommitdiff
path: root/erase_info.h
blob: b363a405c64ce3845f2edb87a836d4af4f1ae67b (plain)
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*
 * erase_info.h
 *
 * Created by: Mahesh J Salgaonkar <mahesh@linux.vnet.ibm.com>
 *
 * Copyright (C) 2011  IBM Corporation
 * Copyright (C) 2011  NEC Corporation
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 */
#ifndef _ERASE_INFO_H
#define _ERASE_INFO_H

#define MAX_SIZE_STR_LEN (26)

/*
 * Erase information, original symbol expressions.
 */
struct erase_info {
	char		*symbol_expr;
	int		num_sizes;
	long		*sizes;
	int		erased;		/* 1= erased, 0= Not erased */
};

unsigned long long get_symbol_addr_all(char *);
long get_domain_all(char *, int, unsigned long long *);
int get_die_member_all(unsigned long long die_off, int index, long *offset,
		char **name, int *nbits, int *fbits, unsigned long long *m_die);
int get_die_nfields_all(unsigned long long die_off);

struct call_back {
	long (*get_domain_all)(char *, int, unsigned long long *);
	int (*readmem)(int type_addr, unsigned long long addr, void *bufptr,
             size_t size);
	int (*get_die_attr_type)(unsigned long long die_off, int *type_flag,
            unsigned long long *die_attr_off);
	char * (*get_die_name)(unsigned long long die_off);
	unsigned long long (*get_die_offset)(char *sysname);
	int (*get_die_length)(unsigned long long die_off, int flag);
	int (*get_die_member_all)(unsigned long long die_off, int index,
		long *offset, char **name, int *nbits, int *fbits,
		unsigned long long *m_die);
	int (*get_die_nfields_all)(unsigned long long die_off);
	unsigned long long (*get_symbol_addr_all)(char *symname);
	int (*update_filter_info_raw)(unsigned long long, int, int);
};

extern struct erase_info	*erase_info;
extern unsigned long		num_erase_info;

int gather_filter_info(void);
void clear_filter_info(void);
void filter_data_buffer(unsigned char *buf, unsigned long long paddr, size_t size);
void filter_data_buffer_parallel(unsigned char *buf, unsigned long long paddr,
					size_t size, pthread_mutex_t *mutex);
unsigned long get_size_eraseinfo(void);
int update_filter_info_raw(unsigned long long, int, int);

#endif /* _ERASE_INFO_H */