libk  Check-in [6bc8ca3cac]

Overview
Comment:add volatile qualifiers, add helper functions for error mechanism
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 6bc8ca3cac15ce250bf87fce66a5c90988f556d03689cd360a176e6973bebedb
User & Date: lexi on 2019-10-21 01:40:38
Other Links: manifest | tags
Context
2019-10-21
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
01:03
change testbin to pass appropriate string lengths to kiosend check-in: 3626b335f2 user: lexi tags: trunk
Changes

Modified arch/posix.h from [bc192b16ff] to [4c89ca109f].

77
78
79
80
81
82
83
84
85
86
87
88
89
90
	 * selected by the build script; /arch/$target
	 * is set as an include directory */
#	include <system_calls.h>
#endif

#ifdef KFplatform_define_funcs

extern struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, 
		k_platform_syscall_arg args[]);

#endif

#endif







|
|
|




77
78
79
80
81
82
83
84
85
86
87
88
89
90
	 * selected by the build script; /arch/$target
	 * is set as an include directory */
#	include <system_calls.h>
#endif

#ifdef KFplatform_define_funcs

volatile extern struct k_platform_syscall_answer
k_platform_syscall(volatile enum k_platform_syscall call,
		volatile u8 valency, volatile k_platform_syscall_arg args[]);

#endif

#endif

Modified mod/kcore/core.h from [4bc4090351] to [58676980aa].

1
2
3
4
5

6
7
8
9
10
11
12
..
24
25
26
27
28
29
30

31
32
33
34
35
36
37
...
154
155
156
157
158
159
160









161
162
163
164
165
166
#ifndef KIcore
#define KIcore
#include <k/type.h>
#include <k/io.h>
#include <k/str.h>


#ifdef __cplusplus
extern "C" {
#endif

typedef struct kvar {
	ksraw name;
................................................................................
/* i'm really sorry okay */
typedef
#if (__STDC_VERSION__ >= 199901L)
	_Bool bool;
#endif
enum
#if !(__STDC_VERSION__ >= 199901L)

	bool /* enum bool { */
#endif
{
	false = 0, no  = 0,
	true  = 1, yes = 1
}
#if !(__STDC_VERSION__ >= 199901L)
................................................................................
 * and there are few enough error conditions
 * in each  that 16-bit address space should
 * be more  than enough for the  foreseeable
 * future. however if that changes, altering
 * the  definition here will effect all  the
 * necessary changes throughout the library */
bool kokay(kcond);










#ifdef __cplusplus
}
#endif

#endif





>







 







>







 







>
>
>
>
>
>
>
>
>






1
2
3
4
5
6
7
8
9
10
11
12
13
..
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
...
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#ifndef KIcore
#define KIcore
#include <k/type.h>
#include <k/io.h>
#include <k/str.h>
#include <k/internal.egroup.h>

#ifdef __cplusplus
extern "C" {
#endif

typedef struct kvar {
	ksraw name;
................................................................................
/* i'm really sorry okay */
typedef
#if (__STDC_VERSION__ >= 199901L)
	_Bool bool;
#endif
enum
#if !(__STDC_VERSION__ >= 199901L)

	bool /* enum bool { */
#endif
{
	false = 0, no  = 0,
	true  = 1, yes = 1
}
#if !(__STDC_VERSION__ >= 199901L)
................................................................................
 * and there are few enough error conditions
 * in each  that 16-bit address space should
 * be more  than enough for the  foreseeable
 * future. however if that changes, altering
 * the  definition here will effect all  the
 * 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

Modified mod/kcore/platform.syscall.fn.c from [4315e80d93] to [f22252d79e].

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#ifdef KFenv_posix
#	include <posix.h>
#else
	Knoimpl(k_platform_syscall)
#endif

extern void k_platform_syscall_raw (
		k_platform_syscall_return* return_slot,
		k_platform_syscall_error*  error_no_slot,
		enum k_platform_syscall    syscall_no,
		u8                         valency,
		s64*                       args);

struct k_platform_syscall_answer
k_platform_syscall(enum k_platform_syscall call, u8 valency, s64 args[]) {
	struct k_platform_syscall_answer answer;

	k_platform_syscall_raw
		(&answer.ret,
		 &answer.error,
		 call, valency, args);

	return answer;
}







|
|
|
|
|
|

|
|









12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36

#ifdef KFenv_posix
#	include <posix.h>
#else
	Knoimpl(k_platform_syscall)
#endif

volatile extern void k_platform_syscall_raw (
		volatile k_platform_syscall_return* return_slot,
		volatile k_platform_syscall_error*  error_no_slot,
		volatile enum k_platform_syscall    syscall_no,
		volatile u8                         valency,
		volatile s64*                       args);

volatile struct k_platform_syscall_answer
k_platform_syscall(volatile enum k_platform_syscall call, volatile u8 valency, volatile s64 args[]) {
	struct k_platform_syscall_answer answer;

	k_platform_syscall_raw
		(&answer.ret,
		 &answer.error,
		 call, valency, args);

	return answer;
}