• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Copyright (c) 2025, Google Inc. All rights reserved
2#
3# Permission is hereby granted, free of charge, to any person obtaining
4# a copy of this software and associated documentation files
5# (the "Software"), to deal in the Software without restriction,
6# including without limitation the rights to use, copy, modify, merge,
7# publish, distribute, sublicense, and/or sell copies of the Software,
8# and to permit persons to whom the Software is furnished to do so,
9# subject to the following conditions:
10#
11# The above copyright notice and this permission notice shall be
12# included in all copies or substantial portions of the Software.
13#
14# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21
22LOCAL_DIR := $(GET_LOCAL_DIR)
23
24MODULE := $(LOCAL_DIR)
25
26MODULE_CRATE_NAME := extmem
27
28MODULE_SRCS += \
29	$(LOCAL_DIR)/lib.rs \
30
31MODULE_ADD_IMPLICIT_DEPS := false
32
33MODULE_DEPS := \
34	external/lk/lib/rust_support \
35	trusty/kernel/lib/extmem \
36	trusty/kernel/lib/sm \
37	trusty/user/base/lib/liballoc-rust \
38	trusty/user/base/lib/libcompiler_builtins-rust \
39	trusty/user/base/lib/libcore-rust \
40	trusty/user/base/lib/trusty-std \
41
42MODULE_BINDGEN_ALLOW_FUNCTIONS := \
43	ext_mem_get_obj_size \
44	ext_mem_get_vmm_obj \
45	ext_mem_obj_set_match_tag \
46
47MODULE_BINDGEN_ALLOW_TYPES := \
48	ext_mem_client_id_t \
49	ext_mem_obj_id_t \
50
51MODULE_BINDGEN_SRC_HEADER := $(LOCAL_DIR)/bindings.h
52
53MODULE_RUST_USE_CLIPPY := true
54
55# When bindgen runs on this module it will attempt to create bindings for these types. rust_support
56# provides these types so we blocklist them in this call to bindgen and use those instead so they
57# can be used interchangeably with any other modules that use these types
58MODULE_BINDGEN_BLOCK_TYPES := \
59	obj_ref \
60	vmm_obj \
61
62include make/library.mk
63