We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 8dc751d commit 7f38c1eCopy full SHA for 7f38c1e
1 file changed
port/wch/ch32v/src/cpus/main.zig
@@ -282,7 +282,26 @@ pub const startup_logic = struct {
282
@export(&startup_logic._system_init, .{ .name = "_system_init" });
283
asm volatile (
284
\\jal _system_init
285
- );
+ // We have clobber all caller-saved registers
286
+ ::: .{
287
+ .x1 = true,
288
+ .x5 = true,
289
+ .x6 = true,
290
+ .x7 = true,
291
+ .x10 = true,
292
+ .x11 = true,
293
+ .x12 = true,
294
+ .x13 = true,
295
+ .x14 = true,
296
+ .x15 = true,
297
+ .x16 = true,
298
+ .x17 = true,
299
+ .x28 = true,
300
+ .x29 = true,
301
+ .x30 = true,
302
+ .x31 = true,
303
+ .memory = true,
304
+ });
305
306
// Load the address of the `microzig_main` function into the `mepc` register
307
// and transfer control to it using the `mret` instruction.
0 commit comments