File size: 623 Bytes
e085b8b
 
 
612e2b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// SPDX-License-Identifier: LicenseRef-Sovereign-Leviathan-SL-AGPL3-001
// Licensing: see LICENSE in the repository root.

const ccu = @import("ccu.zig");

export fn _start() linksection(".text.init") callconv(.Naked) noreturn {
    asm volatile (
        \\la sp, _stack_top
        \\call kmain
        \\1: j 1b
    );
}

export fn kmain() noreturn {
    const unit = ccu.Ccu.init(ccu.BASE_ADDR);
    _ = unit.compute(6, 7) catch halt();
    halt();
}

fn halt() noreturn {
    while (true) asm volatile ("wfi");
}

pub fn panic(_: []const u8, _: ?*@import("std").builtin.StackTrace, _: ?usize) noreturn {
    halt();
}