2015-09-19 03:13:17 +08:00
|
|
|
# Kconfig - debug configuration options
|
|
|
|
|
|
|
|
#
|
|
|
|
# Copyright (c) 2015 Wind River Systems, Inc.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
|
|
|
|
menu "Safe memory access"
|
|
|
|
|
|
|
|
config MEM_SAFE
|
|
|
|
bool
|
|
|
|
prompt "Enable safe memory access"
|
|
|
|
default n
|
|
|
|
help
|
2016-04-12 05:18:44 +08:00
|
|
|
Add the routines available in mem_safe.h to the system. This is added
|
|
|
|
as a kconfig option instead of simply linking against the library
|
|
|
|
because some implementations might require initialization.
|
2015-09-19 03:13:17 +08:00
|
|
|
|
|
|
|
choice
|
|
|
|
prompt "Safe memory access implementation"
|
|
|
|
default MEM_SAFE_CHECK_BOUNDARIES
|
|
|
|
|
|
|
|
config MEM_SAFE_CHECK_BOUNDARIES
|
|
|
|
bool
|
|
|
|
prompt "Software validation of memory access within memory regions"
|
|
|
|
help
|
2016-04-12 05:18:44 +08:00
|
|
|
This implementation checks the application image's text/rodata
|
|
|
|
boundaries for its read-only region and the data/bss/noinit boundaries
|
|
|
|
for its read-write region, in software.
|
2015-09-19 03:13:17 +08:00
|
|
|
|
2016-04-12 05:18:44 +08:00
|
|
|
Other regions can be added as needed by using the
|
|
|
|
sys_mem_safe_region_add() API. The number of regions that can be added
|
|
|
|
is controlled via the MEM_SAFE_NUM_REGIONS kconfig option.
|
2015-09-19 03:13:17 +08:00
|
|
|
|
|
|
|
This implementation requires initialization and thus consumes some boot
|
|
|
|
time.
|
|
|
|
|
|
|
|
endchoice
|
|
|
|
|
|
|
|
config MEM_SAFE_NUM_EXTRA_REGIONS
|
|
|
|
int
|
2016-04-12 05:18:44 +08:00
|
|
|
prompt "Number of safe memory access regions to be added at runtime"
|
2015-09-19 03:13:17 +08:00
|
|
|
depends on MEM_SAFE_CHECK_BOUNDARIES
|
|
|
|
default 0
|
|
|
|
help
|
2016-04-12 05:18:44 +08:00
|
|
|
The functions available in mem_safe.h check if memory is within
|
|
|
|
read-only or read-write regions before accessing it instead of crashing.
|
|
|
|
The kernel image is added as a valid region automatically, but other
|
|
|
|
regions can be added if the application makes access to additional
|
|
|
|
memory outside of the image's boundaries.
|
2015-09-19 03:13:17 +08:00
|
|
|
|
|
|
|
endmenu
|