Skip to content

Commit 90ecea7

Browse files
openkal 0.19.0; openkal-linux 0.20.0, openkal-macos 0.17.0, openkal-windows 0.15.0, openkal-emscripten 0.8.0 (#647)
Co-authored-by: speak-agent <248744407+speak-agent@users.noreply.github.com>
1 parent a89b101 commit 90ecea7

8 files changed

Lines changed: 135 additions & 6 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@
99

1010
### Added
1111

12+
- **openkal 0.19.0;openkal-linux 0.20.0、openkal-macos 0.17.0、openkal-windows 0.15.0、openkal-emscripten 0.8.0。**
13+
`openkal.task` 增加两项:`kal_task_cores`(程序可运行于其上的处理器的物理核数,0 为无法回答)与
14+
`kal_task_set_priority`(调用者所在上下文对处理器的占用:DEFAULT、LOW、BACKGROUND,属性位 `KAL_TASK_PROP_PRIORITY`,
15+
升回被拒绝为 `kal_err_permission`);规范 §1.1 写明边界:下层的东西不向上穿透,实现之间只在规范留名的余地内不同,绕过
16+
openkal 的使用者绑定它所绕到的东西。各实现:Linux 以 sysfs 拓扑与 SCHED_OTHER/BATCH/IDLE,macOS 以 `hw.physicalcpu`
17+
与 QoS 类,Windows 以处理器核心关系与后台模式,Emscripten 两者都答"无法回答/不支持"。测试成员 `openkal` 随之移动,
18+
并观察 0.19 的两项。GLOBAL 为 GitHub 标签归档,CN 为 GitCode `mcpp-res` 镜像,sha256 两处一致。
1219
- **openkal-platform 0.19.2。** openkal 0.18 的版本组,openkal-ld/run/tools 0.1.7、openkal-musl 0.23.2、
1320
openkal-llvm-runtime 0.16.12:Linux aarch64 上 okrun 在处理器表明有 SHA-256 指令时以其接纳映像。openkal 0.18.0 与三个
1421
实现不变。GLOBAL 为 GitHub 标签归档,CN 为 GitCode `mcpp-res` 镜像,sha256 两处一致。

‎pkgs/o/openkal-emscripten.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,13 @@ package = {
4646

4747
xpm = {
4848
linux = {
49+
["0.8.0"] = {
50+
url = {
51+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.8.0.tar.gz",
52+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.8.0/openkal-emscripten-0.8.0.tar.gz",
53+
},
54+
sha256 = "5caf0d10e889762b557ae5342c35a7386b856dfe9cc45a89bba90d37dc5ed95f",
55+
},
4956
["0.7.0"] = {
5057
url = {
5158
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.7.0.tar.gz",
@@ -111,6 +118,13 @@ package = {
111118
},
112119
},
113120
macosx = {
121+
["0.8.0"] = {
122+
url = {
123+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.8.0.tar.gz",
124+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.8.0/openkal-emscripten-0.8.0.tar.gz",
125+
},
126+
sha256 = "5caf0d10e889762b557ae5342c35a7386b856dfe9cc45a89bba90d37dc5ed95f",
127+
},
114128
["0.7.0"] = {
115129
url = {
116130
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.7.0.tar.gz",
@@ -176,6 +190,13 @@ package = {
176190
},
177191
},
178192
windows = {
193+
["0.8.0"] = {
194+
url = {
195+
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.8.0.tar.gz",
196+
CN = "https://gitcode.com/mcpp-res/openkal-emscripten/releases/download/0.8.0/openkal-emscripten-0.8.0.tar.gz",
197+
},
198+
sha256 = "5caf0d10e889762b557ae5342c35a7386b856dfe9cc45a89bba90d37dc5ed95f",
199+
},
179200
["0.7.0"] = {
180201
url = {
181202
GLOBAL = "https://github.com/mcpplibs/openkal-emscripten/archive/refs/tags/0.7.0.tar.gz",

‎pkgs/o/openkal-linux.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.20.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.20.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.20.0/openkal-linux-0.20.0.tar.gz",
26+
},
27+
sha256 = "1edbe561101ca392f838394242177e7d71e06650f54444095be18aa313da33dd",
28+
},
2229
["0.19.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.19.0.tar.gz",
@@ -189,6 +196,13 @@ package = {
189196
},
190197
},
191198
macosx = {
199+
["0.20.0"] = {
200+
url = {
201+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.20.0.tar.gz",
202+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.20.0/openkal-linux-0.20.0.tar.gz",
203+
},
204+
sha256 = "1edbe561101ca392f838394242177e7d71e06650f54444095be18aa313da33dd",
205+
},
192206
["0.19.0"] = {
193207
url = {
194208
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.19.0.tar.gz",
@@ -359,6 +373,13 @@ package = {
359373
},
360374
},
361375
windows = {
376+
["0.20.0"] = {
377+
url = {
378+
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.20.0.tar.gz",
379+
CN = "https://gitcode.com/mcpp-res/openkal-linux/releases/download/0.20.0/openkal-linux-0.20.0.tar.gz",
380+
},
381+
sha256 = "1edbe561101ca392f838394242177e7d71e06650f54444095be18aa313da33dd",
382+
},
362383
["0.19.0"] = {
363384
url = {
364385
GLOBAL = "https://github.com/mcpplibs/openkal-linux/archive/refs/tags/0.19.0.tar.gz",

‎pkgs/o/openkal-macos.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ package = {
1919

2020
xpm = {
2121
linux = {
22+
["0.17.0"] = {
23+
url = {
24+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.17.0.tar.gz",
25+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.17.0/openkal-macos-0.17.0.tar.gz",
26+
},
27+
sha256 = "93f006f74536f55d2a46b130013b65f34c7f3b4dffdc32cf2942d3fd8504eb29",
28+
},
2229
["0.16.0"] = {
2330
url = {
2431
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.16.0.tar.gz",
@@ -182,6 +189,13 @@ package = {
182189
},
183190
},
184191
macosx = {
192+
["0.17.0"] = {
193+
url = {
194+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.17.0.tar.gz",
195+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.17.0/openkal-macos-0.17.0.tar.gz",
196+
},
197+
sha256 = "93f006f74536f55d2a46b130013b65f34c7f3b4dffdc32cf2942d3fd8504eb29",
198+
},
185199
["0.16.0"] = {
186200
url = {
187201
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.16.0.tar.gz",
@@ -345,6 +359,13 @@ package = {
345359
},
346360
},
347361
windows = {
362+
["0.17.0"] = {
363+
url = {
364+
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.17.0.tar.gz",
365+
CN = "https://gitcode.com/mcpp-res/openkal-macos/releases/download/0.17.0/openkal-macos-0.17.0.tar.gz",
366+
},
367+
sha256 = "93f006f74536f55d2a46b130013b65f34c7f3b4dffdc32cf2942d3fd8504eb29",
368+
},
348369
["0.16.0"] = {
349370
url = {
350371
GLOBAL = "https://github.com/mcpplibs/openkal-macos/archive/refs/tags/0.16.0.tar.gz",

‎pkgs/o/openkal-windows.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@ package = {
2121

2222
xpm = {
2323
linux = {
24+
["0.15.0"] = {
25+
url = {
26+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.15.0.tar.gz",
27+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.15.0/openkal-windows-0.15.0.tar.gz",
28+
},
29+
sha256 = "2836fe7f645a353dd94a92219a9b3025531ee72f9cfb7d3ec903b605b7e6eb29",
30+
},
2431
["0.14.0"] = {
2532
url = {
2633
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.14.0.tar.gz",
@@ -212,6 +219,13 @@ package = {
212219
},
213220
},
214221
macosx = {
222+
["0.15.0"] = {
223+
url = {
224+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.15.0.tar.gz",
225+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.15.0/openkal-windows-0.15.0.tar.gz",
226+
},
227+
sha256 = "2836fe7f645a353dd94a92219a9b3025531ee72f9cfb7d3ec903b605b7e6eb29",
228+
},
215229
["0.14.0"] = {
216230
url = {
217231
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.14.0.tar.gz",
@@ -403,6 +417,13 @@ package = {
403417
},
404418
},
405419
windows = {
420+
["0.15.0"] = {
421+
url = {
422+
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.15.0.tar.gz",
423+
CN = "https://gitcode.com/mcpp-res/openkal-windows/releases/download/0.15.0/openkal-windows-0.15.0.tar.gz",
424+
},
425+
sha256 = "2836fe7f645a353dd94a92219a9b3025531ee72f9cfb7d3ec903b605b7e6eb29",
426+
},
406427
["0.14.0"] = {
407428
url = {
408429
GLOBAL = "https://github.com/mcpplibs/openkal-windows/archive/refs/tags/0.14.0.tar.gz",

‎pkgs/o/openkal.lua‎

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,13 @@ package = {
2222

2323
xpm = {
2424
linux = {
25+
["0.19.0"] = {
26+
url = {
27+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.19.0.tar.gz",
28+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.19.0/openkal-0.19.0.tar.gz",
29+
},
30+
sha256 = "3b08cb7497feccbf33426dd7dbbd9b086c54bee7f81c05e61e1807ce7d48c73b",
31+
},
2532
["0.18.0"] = {
2633
url = {
2734
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.18.0.tar.gz",
@@ -150,6 +157,13 @@ package = {
150157
},
151158
},
152159
macosx = {
160+
["0.19.0"] = {
161+
url = {
162+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.19.0.tar.gz",
163+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.19.0/openkal-0.19.0.tar.gz",
164+
},
165+
sha256 = "3b08cb7497feccbf33426dd7dbbd9b086c54bee7f81c05e61e1807ce7d48c73b",
166+
},
153167
["0.18.0"] = {
154168
url = {
155169
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.18.0.tar.gz",
@@ -278,6 +292,13 @@ package = {
278292
},
279293
},
280294
windows = {
295+
["0.19.0"] = {
296+
url = {
297+
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.19.0.tar.gz",
298+
CN = "https://gitcode.com/mcpp-res/openkal/releases/download/0.19.0/openkal-0.19.0.tar.gz",
299+
},
300+
sha256 = "3b08cb7497feccbf33426dd7dbbd9b086c54bee7f81c05e61e1807ce7d48c73b",
301+
},
281302
["0.18.0"] = {
282303
url = {
283304
GLOBAL = "https://github.com/mcpplibs/openkal/archive/refs/tags/0.18.0.tar.gz",

‎tests/examples/openkal/mcpp.toml‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@ name = "openkal-tests"
1818
version = "0.1.0"
1919

2020
[dependencies.mcpplibs]
21-
openkal = "0.18.0"
21+
openkal = "0.19.0"
2222

2323
[target.'cfg(os = "linux")'.dependencies.mcpplibs]
24-
openkal-linux = "0.19.0"
24+
openkal-linux = "0.20.0"
2525

2626
[target.'cfg(os = "macos")'.dependencies.mcpplibs]
27-
openkal-macos = "0.16.0"
27+
openkal-macos = "0.17.0"
2828

2929
[target.'cfg(windows)'.dependencies.mcpplibs]
30-
openkal-windows = "0.14.0"
30+
openkal-windows = "0.15.0"
3131

3232
[target.'cfg(all(os = "linux", env = "musl"))'.dependencies.mcpplibs]
3333
openkal-llvm-runtime = "0.16.12"
3434

3535
[target.'cfg(arch = "wasm32")'.dependencies.mcpplibs]
36-
openkal-emscripten = "0.7.0"
36+
openkal-emscripten = "0.8.0"
3737

3838
[target.'cfg(arch = "riscv64")'.dependencies.mcpplibs]
3939
openkal-opensbi = "0.8.3"

‎tests/examples/openkal/tests/kal.cpp‎

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@
66
// (0.17) the system is named, this program names itself with the moment it
77
// started, and a rename that does not replace refuses a name that is taken;
88
// (0.17.1) a joined command line is refused where programs receive vectors;
9-
// (0.18) a file is mapped, the region holds its bytes and zero after its end.
9+
// (0.18) a file is mapped, the region holds its bytes and zero after its end;
10+
// (0.19) the cores are no more than the processors, and a started context
11+
// lowers its claim on the processors where the implementation claims it.
1012
// The terminal is not observed here,
1113
// because a test run has none; the implementations observe it on a terminal
1214
// they make.
@@ -34,6 +36,9 @@ long (*volatile g_recurse)(long) = recurse;
3436
long recurse(long n) { volatile char pad[1000]; pad[0] = static_cast<char>(n); return n ? g_recurse(n - 1) + pad[0] : 0; }
3537

3638
struct probe { kal_uintptr told; volatile int done; };
39+
40+
int g_claim = -1;
41+
void lowers(void*) { g_claim = kal_task_set_priority(KAL_TASK_PRIORITY_BACKGROUND); }
3742
void room(void* p) {
3843
auto* q = static_cast<probe*>(p);
3944
void* base = nullptr; kal_uintptr size = 0;
@@ -121,6 +126,18 @@ int main() {
121126
kal_fs_remove(root, "okt.m", 5);
122127
}
123128

129+
{
130+
const kal_uintptr cores = kal_task_cores(), processors = kal_task_parallelism();
131+
check(processors == 0 || cores <= processors, "the cores are no more than the processors");
132+
kal_task t{};
133+
if (kal_task_start(lowers, nullptr, &t) == kal_ok) {
134+
kal_task_join(t);
135+
const bool claims = (kal_task_props() & KAL_TASK_PROP_PRIORITY) != 0;
136+
check(claims ? g_claim == kal_ok : g_claim == kal_err_not_supported,
137+
"a started context lowers its claim to background, or is told the implementation has none");
138+
}
139+
}
140+
124141
if (failures == 0) kal_stream_write(kal_stdout(), "openkal: held\n", 14);
125142
return failures == 0 ? 0 : 1;
126143
}

0 commit comments

Comments
 (0)