Zig 0.17.0-dev (Split by item)

Shortcut keys
?
Show these tips
S
Focus search field
Esc
Clear focus & close tips
U
Jump to source code
↑
Move up in search results
↓
Move down in search results
↵
Go to active search result
This is an example of documentation generated by ZigDoc, an alternative to Zig's built-in Auto Doc feature. See also examples in other modes/formats. The project being documented here (as the example) is the Zig standard library. Public Function

current

Public Function
std.debug.cpu_context.Sparc.current
pub inline fn current() Sparc

File

debug/cpu_context.zig:1528
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
    pub inline fn current() Sparc {
        flushWindows();

        var ctx: Sparc = undefined;
        asm volatile (if (Gpr == u64)
                \\ stx %%g0, [%%l0 + 0]
                \\ stx %%g1, [%%l0 + 8]
                \\ stx %%g2, [%%l0 + 16]
                \\ stx %%g3, [%%l0 + 24]
                \\ stx %%g4, [%%l0 + 32]
                \\ stx %%g5, [%%l0 + 40]
                \\ stx %%g6, [%%l0 + 48]
                \\ stx %%g7, [%%l0 + 56]
                \\ stx %%o0, [%%l0 + 64]
                \\ stx %%o1, [%%l0 + 72]
                \\ stx %%o2, [%%l0 + 80]
                \\ stx %%o3, [%%l0 + 88]
                \\ stx %%o4, [%%l0 + 96]
                \\ stx %%o5, [%%l0 + 104]
                \\ stx %%o6, [%%l0 + 112]
                \\ stx %%o7, [%%l0 + 120]
                \\ stx %%l0, [%%l0 + 128]
                \\ stx %%l1, [%%l0 + 136]
                \\ stx %%l2, [%%l0 + 144]
                \\ stx %%l3, [%%l0 + 152]
                \\ stx %%l4, [%%l0 + 160]
                \\ stx %%l5, [%%l0 + 168]
                \\ stx %%l6, [%%l0 + 176]
                \\ stx %%l7, [%%l0 + 184]
                \\ stx %%i0, [%%l0 + 192]
                \\ stx %%i1, [%%l0 + 200]
                \\ stx %%i2, [%%l0 + 208]
                \\ stx %%i3, [%%l0 + 216]
                \\ stx %%i4, [%%l0 + 224]
                \\ stx %%i5, [%%l0 + 232]
                \\ stx %%i6, [%%l0 + 240]
                \\ stx %%i7, [%%l0 + 248]
                \\ call 1f
                \\  nop
                \\1:
                \\ stx %%o7, [%%l0 + 256]
            else
                \\ std %%g0, [%%l0 + 0]
                \\ std %%g2, [%%l0 + 8]
                \\ std %%g4, [%%l0 + 16]
                \\ std %%g6, [%%l0 + 24]
                \\ std %%o0, [%%l0 + 32]
                \\ std %%o2, [%%l0 + 40]
                \\ std %%o4, [%%l0 + 48]
                \\ std %%o6, [%%l0 + 56]
                \\ std %%l0, [%%l0 + 64]
                \\ std %%l2, [%%l0 + 72]
                \\ std %%l4, [%%l0 + 80]
                \\ std %%l6, [%%l0 + 88]
                \\ std %%i0, [%%l0 + 96]
                \\ std %%i2, [%%l0 + 104]
                \\ std %%i4, [%%l0 + 112]
                \\ std %%i6, [%%l0 + 120]
                \\ call 1f
                \\  nop
                \\1:
                \\ st %%o7, [%%l0 + 128]
            :
            : [ctx] "{l0}" (&ctx),
            : .{ .o7 = true, .memory = true });
        return ctx;
    }