[PATCH 1/many] PROC macro to annotate functions in assembly files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Introduce the PROC macro in the generic header file
include/linux/linkage.h to annotate functions in assembly
files. This is a first step to fully annotate functions
(procedures) in .S-files. The PROC macro complements the
already existing and being used ENDPROC macro. The generic
implementation of PROC is exactly the same as ENTRY.

The goal is to annotate functions, at least those called
from C code, with PROC at the beginning and ENDPROC at the
end. This is for the benefit of debugging and tracing. It
will also allow to introduce a framework to check for
nesting problems and missing annotations in a later stage
by overriding ENTRY/END and PROC/ENDPROC in architecture-
specific code, after the annotation errors have been fixed.

Signed-off-by: Alexander van Heukelum <heukelum@xxxxxxxxxxx>
Cc: Sam Ravnborg <sam@xxxxxxxxxxxx>
Cc: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---
 include/linux/linkage.h |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/include/linux/linkage.h b/include/linux/linkage.h
index fee9e59..f4bb5a7 100644
--- a/include/linux/linkage.h
+++ b/include/linux/linkage.h
@@ -69,10 +69,18 @@
   .size name, .-name
 #endif
 
-/* If symbol 'name' is treated as a subroutine (gets called, and returns)
- * then please use ENDPROC to mark 'name' as STT_FUNC for the benefit of
- * static analysis tools such as stack depth analyzer.
+/*
+ * If symbol 'name' is treated as a subroutine (gets called, and returns)
+ * then please use PROC/ENDPROC to mark 'name' as STT_FUNC for the benefit
+ * of static analysis tools such as stack depth analyzer.
  */
+#ifndef PROC
+#define PROC(name) \
+  .globl name; \
+  ALIGN; \
+  name:
+#endif
+
 #ifndef ENDPROC
 #define ENDPROC(name) \
   .type name, @function; \
-- 
1.5.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel]     [Kernel Newbies]     [x86 Platform Driver]     [Netdev]     [Linux Wireless]     [Netfilter]     [Bugtraq]     [Linux Filesystems]     [Yosemite Discussion]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Device Mapper]

  Powered by Linux