summaryrefstree
path: root/kernel/security/proca/proca_config.h
blob: 9c604702812f39b048fb19a6eae968c9cc936ba6 (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
/*
 * Memory information needed for address translation in tz driver
 *
 * Copyright (C) 2018 Samsung Electronics, Inc.
 * Hryhorii Tur, <hryhorii.tur@partner.samsung.com>
 *
 * This software is licensed under the terms of the GNU General Public
 * License version 2, as published by the Free Software Foundation, and
 * may be copied, distributed, and modified under those terms.
 *
 * 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 _LINUX_PROCA_MEM_INFO_H
#define _LINUX_PROCA_MEM_INFO_H

#include <linux/proca.h>
#include <linux/types.h>

struct memory_range {
	uint64_t start;
	uint64_t end;
	uint64_t flags;
} __packed;

#define MAX_MEMORY_RANGES_NUM 64ULL

struct proca_config {
	uint32_t version;
	uint32_t size;

	uint64_t va_bits;
	uint64_t va_start;
	uint64_t page_offset;
	uint64_t kimage_vaddr;
	uint64_t kimage_voffset;

	const void *gaf_addr;
	const struct proca_table *proca_table_addr;

	struct memory_range sys_ram_ranges[MAX_MEMORY_RANGES_NUM];
	uint64_t sys_ram_ranges_num;

	uint32_t magic;
} __packed;

int init_proca_config(struct proca_config *conf,
		const struct proca_table *proca_table_addr);

#endif /* _LINUX_PROCA_MEM_INFO_H */