summaryrefslogtreecommitdiffstats
path: root/src/include/compiler.h
diff options
context:
space:
mode:
authorMichael Brown2007-09-11 16:42:17 +0200
committerMichael Brown2007-09-11 16:42:17 +0200
commit5f6439c828c1de42ba83593040842b30e86d6b29 (patch)
tree112970ab2eede1a23f57742a3c60f25fe8371688 /src/include/compiler.h
parentForce MAC address for testing purposes (diff)
parentMerge branch 'master' of rom.etherboot.org:/pub/scm/gpxe (diff)
downloadipxe-5f6439c828c1de42ba83593040842b30e86d6b29.tar.gz
ipxe-5f6439c828c1de42ba83593040842b30e86d6b29.tar.xz
ipxe-5f6439c828c1de42ba83593040842b30e86d6b29.zip
Merge branch 'master' into 3leaf-rewrite
Diffstat (limited to 'src/include/compiler.h')
-rw-r--r--src/include/compiler.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/include/compiler.h b/src/include/compiler.h
index 2151fc6ac..a195e5368 100644
--- a/src/include/compiler.h
+++ b/src/include/compiler.h
@@ -280,6 +280,31 @@ extern void dbg_hex_dump_da ( unsigned long dispaddr,
#define __cdecl __attribute__ (( cdecl , regparm(0) ))
/**
+ * Declare a function as pure - i.e. without side effects
+ */
+#define __pure __attribute__ (( pure ))
+
+/**
+ * Declare a function as const - i.e. it does not access global memory
+ * (including dereferencing pointers passed to it) at all.
+ * Must also not call any non-const functions.
+ */
+#define __const __attribute__ (( const ))
+
+/**
+ * Declare a function's pointer parameters as non-null - i.e. force
+ * compiler to check pointers at compile time and enable possible
+ * optimizations based on that fact
+ */
+#define __nonnull __attribute__ (( nonnull ))
+
+/**
+ * Declare a pointer returned by a function as a unique memory address
+ * as returned by malloc-type functions.
+ */
+#define __malloc __attribute__ (( malloc ))
+
+/**
* Declare a function as used.
*
* Necessary only if the function is called only from assembler code.