develop/sca/sparse.html · develop/sca/sparse.rst 공식 원문 ↗

Zephyr 3.7.0 · Develop · SCA · Sparse

Sparse 지원

Cached와 uncached address pointer를 정적 분석으로 구분해 Xtensa address-space 오류를 찾습니다.

Official pathdevelop/sca/sparse.html
Source filedevelop/sca/sparse.rst
Source versionZephyr 3.7.0
TranslationFull · reviewed

본문 기준: Zephyr 3.7.0 LTS3 · 이후 유지보수 패치는 별도입니다.

Part 1

요약·해설

address_space, force, Zephyr의 __cache 공간과 Sparse build variant를 설명합니다.

Pointer

address_space

Cast

force

Xtensa

__cache

Part 2

접을 수 있는 영어 원문 전체

영어 원문 전체 펼치기
원문 SHA-256 40231ACB57AE5DB055518E34202E3978D0F608E7809D2768F0C7E2837F1D9254
.. _sparse:

Sparse support
##############

`Sparse <https://www.kernel.org/doc/html/latest/dev-tools/sparse.html>`__
is a static code analysis tool.
Apart from performing common code analysis tasks it also supports an
``address_space`` attribute, which allows introduction of distinct address
spaces in C code with subsequent verification that pointers to different
address spaces do not get confused. Additionally it supports a ``force``
attribute which should be used to cast pointers between different address
spaces. At the moment Zephyr introduces a single custom address space
``__cache`` used to identify pointers from the cached address range on the
Xtensa architecture. This helps identify cases where cached and uncached
addresses are confused.

Running with sparse
*******************

To run a sparse verification build :ref:`west build <west-building>` should be
called with a ``-DZEPHYR_SCA_VARIANT=sparse`` parameter, e.g.

.. code-block:: shell

    west build -d hello -b intel_adsp/cavs25 zephyr/samples/hello_world -- -DZEPHYR_SCA_VARIANT=sparse

Part 3

한국어 전문 번역

Sparse 지원

Sparse는 static code analysis 도구입니다. 일반적인 code analysis 외에 address_space attribute를 지원합니다. 이를 이용하면 C code에 서로 다른 address space를 도입하고 서로 다른 공간의 pointer가 혼동되지 않는지 검증할 수 있습니다.

force attribute는 서로 다른 address space의 pointer를 cast할 때 사용해야 합니다. 현재 Zephyr는 Xtensa architecture의 cached address range pointer를 식별하는 custom address space __cache 하나를 도입합니다. 이를 통해 cached·uncached address를 혼동하는 경우를 찾을 수 있습니다.

Sparse로 실행

west build를 -DZEPHYR_SCA_VARIANT=sparse parameter와 함께 호출해 Sparse verification build를 실행합니다.

west build -d hello -b intel_adsp/cavs25 zephyr/samples/hello_world -- -DZEPHYR_SCA_VARIANT=sparse

Source

출처

영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.