• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#
2# Copyright (c) 2024, Google, Inc. All rights reserved
3#
4# Permission is hereby granted, free of charge, to any person obtaining
5# a copy of this software and associated documentation files
6# (the "Software"), to deal in the Software without restriction,
7# including without limitation the rights to use, copy, modify, merge,
8# publish, distribute, sublicense, and/or sell copies of the Software,
9# and to permit persons to whom the Software is furnished to do so,
10# subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be
13# included in all copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
16# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
17# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
19# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
20# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
21# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22#
23
24LOCAL_DIR := $(GET_LOCAL_DIR)
25
26MODULE := $(LOCAL_DIR)
27
28MODULE_CRATE_NAME := rust_support
29
30MODULE_SRCS := \
31	$(LOCAL_DIR)/lib.rs \
32
33# Don't make this module depend on itself.
34MODULE_ADD_IMPLICIT_DEPS := false
35
36MODULE_DEPS := \
37	external/rust/crates/num-derive \
38	external/rust/crates/num-traits \
39	external/rust/crates/log \
40	trusty/user/base/lib/liballoc-rust \
41	trusty/user/base/lib/libcompiler_builtins-rust \
42	trusty/user/base/lib/libcore-rust \
43	trusty/user/base/lib/trusty-std \
44	$(LOCAL_DIR)/wrappers \
45
46MODULE_BINDGEN_ALLOW_FUNCTIONS := \
47	_panic \
48	fflush \
49	fputs \
50	ipc_get_msg \
51	ipc_port_connect_async \
52	ipc_put_msg \
53	ipc_read_msg \
54	ipc_send_msg \
55	lk_stdin \
56	lk_stdout \
57	lk_stderr \
58	mutex_acquire_timeout \
59	mutex_destroy \
60	mutex_init \
61	mutex_release \
62	thread_create \
63	thread_resume \
64	vaddr_to_paddr \
65	vmm_alloc_physical_etc \
66	vmm_alloc_contiguous \
67	vmm_free_region \
68
69MODULE_BINDGEN_ALLOW_TYPES := \
70	Error \
71	iovec_kern \
72	ipc_msg_.* \
73	lk_init_.* \
74	trusty_ipc_event_type \
75
76MODULE_BINDGEN_ALLOW_VARS := \
77	.*_PRIORITY \
78	_kernel_aspace \
79	ARCH_MMU_FLAG_.* \
80	DEFAULT_STACK_SIZE \
81	FILE \
82	IPC_CONNECT_WAIT_FOR_PORT \
83	IPC_HANDLE_POLL_.* \
84	NUM_PRIORITIES \
85	PAGE_SIZE \
86	PAGE_SIZE_SHIFT \
87	zero_uuid \
88
89MODULE_BINDGEN_FLAGS := \
90	--newtype-enum Error \
91	--newtype-enum lk_init_level \
92	--bitfield-enum lk_init_flags \
93	--no-prepend-enum-name \
94	--with-derive-custom Error=FromPrimitive \
95
96MODULE_BINDGEN_SRC_HEADER := $(LOCAL_DIR)/bindings.h
97
98include make/module.mk
99