mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 07:48:20 +00:00
ke: add continuations
This commit is contained in:
+2
-2
@@ -126,8 +126,8 @@ pub fn init() void {
|
||||
|
||||
const td = ps.thread.create_kernel(
|
||||
.Default,
|
||||
worker,
|
||||
null,
|
||||
.{ .func = worker, .arg = null },
|
||||
true,
|
||||
) catch @panic("handle me");
|
||||
ke.sched.enqueue(&td.kern);
|
||||
}
|
||||
|
||||
+2
-1
@@ -26,7 +26,8 @@ pub fn init() void {
|
||||
if (rtl.cmdline.get_string(cline, "test")) |tst| {
|
||||
// Run a test if specified.
|
||||
if (r.tests.tests.get(tst)) |func| {
|
||||
const t = ps.thread.create_kernel(.Default, func, r.boot_info) catch @panic("oom");
|
||||
const t = ps.thread.create_kernel(.Default, .{ .func = func, .arg = r.boot_info }, true) catch
|
||||
@panic("oom");
|
||||
ke.sched.enqueue(&t.kern);
|
||||
} else {
|
||||
std.log.info("invalid test: \"{s}\"", .{tst});
|
||||
|
||||
+12
-10
@@ -124,14 +124,15 @@ const Pool = struct {
|
||||
|
||||
var td = try ps.thread.create_kernel(
|
||||
WorkItem.Priority.to_sched_prio(self.prio),
|
||||
work_loop,
|
||||
@ptrFromInt(ctx.value),
|
||||
.{ .func = work_loop, .arg = @ptrFromInt(ctx.value) },
|
||||
true,
|
||||
);
|
||||
|
||||
td.kern.nice = -ke.Priority.nice_max;
|
||||
|
||||
if (cpu) |c| {
|
||||
ke.sched.pin_on(&td.kern, c);
|
||||
if (cpu != null) {
|
||||
td.kern.last_cpu = cpu;
|
||||
td.kern.pinned = true;
|
||||
}
|
||||
|
||||
ke.sched.enqueue(&td.kern);
|
||||
@@ -176,12 +177,13 @@ const Pool = struct {
|
||||
|
||||
var td = try ps.thread.create_kernel(
|
||||
WorkItem.Priority.to_sched_prio(self.prio),
|
||||
work_loop,
|
||||
@ptrFromInt(ctx.value),
|
||||
.{ .func = work_loop, .arg = @ptrFromInt(ctx.value) },
|
||||
true,
|
||||
);
|
||||
|
||||
if (cpu) |c| {
|
||||
ke.sched.pin_on(&td.kern, c);
|
||||
if (cpu != null) {
|
||||
td.kern.last_cpu = cpu;
|
||||
td.kern.pinned = true;
|
||||
}
|
||||
|
||||
ke.sched.enqueue(&td.kern);
|
||||
@@ -313,8 +315,8 @@ pub fn init() !void {
|
||||
|
||||
var td = ps.thread.create_kernel(
|
||||
.Default,
|
||||
pool_manager,
|
||||
null,
|
||||
.{ .func = pool_manager, .arg = null },
|
||||
true,
|
||||
) catch @panic("Failed to create pool manager");
|
||||
|
||||
ke.sched.enqueue(&td.kern);
|
||||
|
||||
Reference in New Issue
Block a user