request_page := fn(page_count: u8): ^u8 { msg := "\{00}\{01}xxxxxxxx\0" msg_page_count := msg + 1; *msg_page_count = page_count return @eca(3, 2, msg, 12) } release_page := fn(ptr: ^u8, page_count: u8): void { msg := "\{01}\{00}xxxxxxxx\0" msg_page_count := msg + 1; *msg_page_count = page_count msg_ptr := @as(^^u8, @bitcast(msg + 2)); *msg_ptr = ptr return @eca(3, 2, msg, 12) } OutbMsg := packed struct {a: u8, b: u8, addr: u16, value: u8} InbMsg := packed struct {a: u8, b: u8, addr: u16} OutlMsg := packed struct {a: u8, b: u8, addr: u16, value: u32} InlMsg := packed struct {a: u8, b: u8, addr: u16} outb := fn(addr: u16, value: u8): void { return @eca(3, 3, &OutbMsg.(1, 0, addr, value), @sizeof(OutbMsg)) } inb := fn(addr: u16): u8 { return @eca(3, 3, &InbMsg.(0, 0, addr), @sizeof(InbMsg)) } outl := fn(addr: u16, value: u32): void { return @eca(3, 3, &OutlMsg.(1, 2, addr, value), @sizeof(OutlMsg)) } inl := fn(addr: u16): u32 { return @eca(3, 3, &InlMsg.(0, 2, addr), @sizeof(InlMsg)) }