base/dispatch.c: Add documentation for some internal functions.
[catacomb] / base / dispatch.c
index fe3dcfb..4b5e17a 100644 (file)
@@ -37,7 +37,7 @@
 
 #include "dispatch.h"
 
-/*----- Main code ---------------------------------------------------------*/
+/*----- Intel x86/AMD64 feature probing -----------------------------------*/
 
 #ifdef CPUFAM_X86
 
@@ -101,6 +101,15 @@ static void cpuid(struct cpuid *cc, unsigned a, unsigned c)
 static unsigned cpuid_maxleaf(void)
   { struct cpuid c; cpuid(&c, 0, 0); return (c.a); }
 
+/* --- @cpuid_features_p@ --- *
+ *
+ * Arguments:  @unsigned dbits@ = bits to check in EDX
+ *             @unsigned cbits@ = bits to check in ECX
+ *
+ * Returns:    Nonzero if all the requested bits are set in the CPUID result
+ *             on leaf 1.
+ */
+
 static int cpuid_features_p(unsigned dbits, unsigned cbits)
 {
   struct cpuid c;
@@ -109,6 +118,14 @@ static int cpuid_features_p(unsigned dbits, unsigned cbits)
   return ((c.d & dbits) == dbits && (c.c & cbits) == cbits);
 }
 
+/* --- @xmm_registers_available_p@ --- *
+ *
+ * Arguments:  ---
+ *
+ * Returns:    Nonzero if the operating system has made the XMM registers
+ *             available for use.
+ */
+
 static int xmm_registers_available_p(void)
 {
 #ifdef __GNUC__
@@ -135,6 +152,8 @@ static int xmm_registers_available_p(void)
 
 #endif
 
+/*----- External interface ------------------------------------------------*/
+
 /* --- @check_env@ --- *
  *
  * Arguments:  @const char *ftok@ = feature token