blob: 908f091c86ebfee9202d22c435b6ab1e2bad4085 (
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
|
/* Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 and
* only version 2 as published by the Free Software Foundation.
*
* 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_MEM_SHARE_H
#define _LINUX_MEM_SHARE_H
#define MEM_SHARE_SERVICE_SVC_ID 0x00000034
#define MEM_SHARE_SERVICE_INS_ID 1
#define MEM_SHARE_SERVICE_VERS 1
#define MEMORY_CMA 1
#define MEMORY_NON_CMA 0
#define MAX_CLIENTS 10
#define GPS 0
#define CHECK 0
#define FREE 1
#define MEMSHARE_GUARD_BYTES (4*1024)
struct mem_blocks {
/* Client Id information */
uint32_t client_id;
/* Peripheral associated with client */
uint32_t peripheral;
/* Sequence Id */
uint32_t sequence_id;
/* CMA or Non-CMA region */
uint32_t memory_type;
/* Guaranteed Memory */
uint32_t guarantee;
/* Memory alloted or not */
uint32_t allotted;
/* Memory allocation request received or not */
uint32_t alloc_request;
/* Allocation on request from a client*/
uint32_t client_request;
/* Size required for client */
uint32_t size;
/*
* start address of the memory block reserved by server memory
* subsystem to client
*/
phys_addr_t phy_addr;
/* Virtual address for the physical address allocated */
void *virtual_addr;
/* Release memory only when XPU is released*/
uint8_t free_memory;
/* Need Hypervisor mapping*/
uint8_t hyp_mapping;
/* Status flag which checks if ramdump file is created*/
int file_created;
};
int memshare_alloc(struct device *dev,
unsigned int block_size,
struct mem_blocks *pblk);
void memshare_free(unsigned int block_size,
struct mem_blocks *pblk);
#endif /* _LINUX_MEM_SHARE_H */
|