forked from trusty-ia/trusty_app_storage
-
Notifications
You must be signed in to change notification settings - Fork 0
/
block_device_tipc.h
70 lines (60 loc) · 1.91 KB
/
block_device_tipc.h
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
70
/*
* Copyright (C) 2015 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <trusty_ipc.h>
#include "block_device.h"
#include "ipc.h"
#include "tipc_ns.h"
#include "transaction.h"
struct rpmb_key;
struct block_device_tipc;
/**
* struct block_device_rpmb
* @state: Pointer to shared state containing ipc_handle and rpmb_state
* @dev: Block device state
* @base: First block to use in rpmb partition
*/
struct block_device_rpmb {
struct block_device dev;
struct block_device_tipc *state;
uint16_t base;
};
struct client_port_context {
struct fs *tr_state;
struct ipc_port_context client_ctx;
};
/**
* struct block_device_tipc
* @ipc_handle
*/
struct block_device_tipc {
handle_t ipc_handle;
struct rpmb_state *rpmb_state;
struct block_device_rpmb dev_rpmb;
struct fs tr_state_rpmb;
struct client_port_context fs_rpmb;
struct client_port_context fs_rpmb_boot;
ns_handle_t ns_handle;
struct block_device dev_ns;
struct block_device_rpmb dev_ns_rpmb;
struct fs tr_state_ns;
struct client_port_context fs_ns;
};
int block_device_tipc_init(struct block_device_tipc *state,
handle_t ipc_handle,
const struct key *fs_key,
const struct rpmb_key *rpmb_key);
void block_device_tipc_uninit(struct block_device_tipc *state);