aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
authorMadhukar Pappireddy <madhukar.pappireddy@arm.com>2020-09-16 18:00:21 +0000
committerTrustedFirmware Code Review <review@review.trustedfirmware.org>2020-09-16 18:00:21 +0000
commitb39dca401d80091da54f9a9bccb226c6b0ba38b8 (patch)
treedcae5085e0cd5bcde729cd0cd7c0513d076857bc /docs
parent8f5426cc4b987773e2a75cfdd805da1f996ef57f (diff)
parent06ffa16694b315380c9b2ebafe06d83873f2a78d (diff)
downloadplatform_external_arm-trusted-firmware-b39dca401d80091da54f9a9bccb226c6b0ba38b8.tar.gz
platform_external_arm-trusted-firmware-b39dca401d80091da54f9a9bccb226c6b0ba38b8.tar.bz2
platform_external_arm-trusted-firmware-b39dca401d80091da54f9a9bccb226c6b0ba38b8.zip
Merge "doc: Recommend using C rather than assembly language" into integration
Diffstat (limited to 'docs')
-rw-r--r--docs/process/coding-guidelines.rst19
1 files changed, 19 insertions, 0 deletions
diff --git a/docs/process/coding-guidelines.rst b/docs/process/coding-guidelines.rst
index 2c8620d15..ef319e441 100644
--- a/docs/process/coding-guidelines.rst
+++ b/docs/process/coding-guidelines.rst
@@ -442,6 +442,25 @@ unsigned integer on all systems, cast it to ``unsigned int``.
These guidelines should be updated if additional types are needed.
+Favor C language over assembly language
+---------------------------------------
+
+Generally, prefer code written in C over assembly. Assembly code is less
+portable, harder to understand, maintain and audit security wise. Also, static
+analysis tools generally don't analyze assembly code.
+
+There are, however, legitimate uses of assembly language. These include:
+
+ - Early boot code executed before the C runtime environment is setup.
+
+ - Exception handling code.
+
+ - Low-level code where the exact sequence of instructions executed on the CPU
+ matters, such as CPU reset sequences.
+
+ - Low-level code where specific system-level instructions must be used, such
+ as cache maintenance operations.
+
--------------
*Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.*