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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
 * necessary changes throughout the library */
bool kokay(kcond);

typedef struct kerror {
	const char* module_name,
	          * module_desc,
			  * error_string;
	kcond error;
} kerror;

kerror kexplain(kcond);

#ifdef __cplusplus
}
#endif

#endif







|









161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
 * necessary changes throughout the library */
bool kokay(kcond);

typedef struct kerror {
	const char* module_name,
	          * module_desc,
			  * error_string;
	kcond cond;
} kerror;

kerror kexplain(kcond);

#ifdef __cplusplus
}
#endif

#endif

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













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <k/core.h>
#include <k/type.h>
#include <k/internal.egroup.h>

kerror kexplain(kcond val) {
	kcond idx = val / kglobal_module_offset;
	/* module index in table */
	kcond offset = val % kglobal_module_offset;
	/* error index in module error table */

	struct kglobal_module_record* rec = kglobal_module_ident + idx;
	/* retrieve module identity from global table */

	kerror k = {
		.module_name = rec -> name,
		.module_desc = rec -> desc,
		.error_string = rec -> error_list[offset],
		.cond = val,
	};

	return k;
}