libk  Check-in [bdb84af41a]

Overview
Comment:fix broken commit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: bdb84af41a408394bae59e8fadc5742c4b4294f3e44c155487151db76a40ff37
User & Date: lexi on 2019-10-21 01:46:58
Other Links: manifest | tags
Context
2019-10-21
04:28
don't clobber callee-saved registers check-in: 481509e134 user: lexi tags: trunk
01:46
fix broken commit check-in: bdb84af41a user: lexi tags: trunk
01:40
add volatile qualifiers, add helper functions for error mechanism check-in: 6bc8ca3cac user: lexi tags: trunk
Changes

Modified mod/kcore/core.h from [58676980aa] to [2582f2493d].

   161    161    * necessary changes throughout the library */
   162    162   bool kokay(kcond);
   163    163   
   164    164   typedef struct kerror {
   165    165   	const char* module_name,
   166    166   	          * module_desc,
   167    167   			  * error_string;
   168         -	kcond error;
          168  +	kcond cond;
   169    169   } kerror;
   170    170   
   171    171   kerror kexplain(kcond);
   172    172   
   173    173   #ifdef __cplusplus
   174    174   }
   175    175   #endif
   176    176   
   177    177   #endif

Added mod/kcore/explain.fn.c version [97dcae5195].

            1  +#include <k/core.h>
            2  +#include <k/type.h>
            3  +#include <k/internal.egroup.h>
            4  +
            5  +kerror kexplain(kcond val) {
            6  +	kcond idx = val / kglobal_module_offset;
            7  +	/* module index in table */
            8  +	kcond offset = val % kglobal_module_offset;
            9  +	/* error index in module error table */
           10  +
           11  +	struct kglobal_module_record* rec = kglobal_module_ident + idx;
           12  +	/* retrieve module identity from global table */
           13  +
           14  +	kerror k = {
           15  +		.module_name = rec -> name,
           16  +		.module_desc = rec -> desc,
           17  +		.error_string = rec -> error_list[offset],
           18  +		.cond = val,
           19  +	};
           20  +
           21  +	return k;
           22  +}