mirror of
https://github.com/rdmsr/zag.git
synced 2026-11-01 15:48:21 +00:00
rtl: add LinkerSet
This commit is contained in:
@@ -124,10 +124,8 @@ const PerCpu = struct {
|
||||
|
||||
const pcpu = ke.CpuLocal(PerCpu, undefined);
|
||||
|
||||
export const qspinlock_percpu_init linksection(r.percpu_init) = &init_cpu;
|
||||
|
||||
/// Initialize a CPU's MCS nodes.
|
||||
fn init_cpu() linksection(r.init) callconv(.c) void {
|
||||
fn init_cpu() linksection(r.init) void {
|
||||
var cpu = pcpu.local();
|
||||
cpu.curr_idx = 0;
|
||||
|
||||
@@ -137,6 +135,10 @@ fn init_cpu() linksection(r.init) callconv(.c) void {
|
||||
}
|
||||
}
|
||||
|
||||
comptime {
|
||||
_ = r.percpu_init_set.insert(&init_cpu);
|
||||
}
|
||||
|
||||
/// Queued spin lock implementation.
|
||||
/// See https://rdmsr.github.io/writing/qspinlocks
|
||||
pub const QSpinLock = LockTemplate(struct {
|
||||
|
||||
Reference in New Issue
Block a user