Skip to content

Commit 0ece330

Browse files
committed
final touches
1 parent 5cdd6dd commit 0ece330

File tree

3 files changed

+16
-14
lines changed

3 files changed

+16
-14
lines changed

core/src/cpus/cortex_m.zig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -591,7 +591,7 @@ pub const startup_logic = struct {
591591
extern var microzig_bss_end: u8;
592592
extern const microzig_data_load_start: u8;
593593

594-
pub fn ram_image_entrypoint() linksection("microzig_ram_start") callconv(.naked) void {
594+
pub fn ram_image_entry_point() linksection("microzig_ram_start") callconv(.naked) void {
595595
asm volatile (
596596
\\
597597
// Set VTOR to point to ram table
@@ -684,7 +684,7 @@ fn is_ramimage() bool {
684684

685685
pub fn export_startup_logic() void {
686686
if (is_ramimage())
687-
@export(&startup_logic.ram_image_entrypoint, .{
687+
@export(&startup_logic.ram_image_entry_point, .{
688688
.name = "_entry_point",
689689
.linkage = .strong,
690690
})

port/raspberrypi/rp2xxx/src/hal.zig

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,14 @@ comptime {
4949
pub const HAL_Options = switch (compatibility.chip) {
5050
.RP2040 => struct {},
5151
.RP2350 => struct {
52-
image_def_exe_security: bootmeta.ImageDef.ImageTypeFlags.ExeSecurity = .secure,
53-
54-
/// Next metadata block to link after image_def. **Last block in the
55-
/// chain must link back to the first one** (to
56-
/// `bootmeta.image_def_block`).
57-
next_metadata_block: ?*const anyopaque = null,
52+
bootmeta: struct {
53+
image_def_exe_security: bootmeta.ImageDef.ImageTypeFlags.ExeSecurity = .secure,
54+
55+
/// Next metadata block to link after image_def. **Last block in the
56+
/// chain must link back to the first one** (to
57+
/// `bootmeta.image_def_block`).
58+
next_block: ?*const anyopaque = null,
59+
} = .{},
5860
},
5961
};
6062

port/raspberrypi/rp2xxx/src/hal/bootmeta.zig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ pub const image_def_block = if (microzig.config.ram_image and arch == .arm) Bloc
1212
.image_def = .{
1313
.image_type_flags = .{
1414
.image_type = .exe,
15-
.exe_security = root.microzig_options.hal.image_def_exe_security,
15+
.exe_security = root.microzig_options.hal.bootmeta.image_def_exe_security,
1616
.cpu = .arm,
1717
.chip = .RP2350,
1818
.try_before_you_buy = false,
@@ -21,26 +21,26 @@ pub const image_def_block = if (microzig.config.ram_image and arch == .arm) Bloc
2121
// We must specify a custom entry point since by default RP2350 expects
2222
// the vector table at the start of the image.
2323
.entry_point = .{
24-
.entry = &microzig.cpu.startup_logic.ram_image_entrypoint,
25-
.sp = microzig.config.end_of_stack,
24+
.entry = &microzig.cpu.startup_logic.ram_image_entry_point,
25+
.sp = microzig.cpu.startup_logic._vector_table.initial_stack_pointer,
2626
},
2727
},
28-
.link = root.microzig_options.hal.next_metadata_block,
28+
.link = root.microzig_options.hal.bootmeta.next_block,
2929
} else Block(extern struct {
3030
image_def: ImageDef,
3131
}){
3232
.items = .{
3333
.image_def = .{
3434
.image_type_flags = .{
3535
.image_type = .exe,
36-
.exe_security = root.microzig_options.hal.image_def_exe_security,
36+
.exe_security = root.microzig_options.hal.bootmeta.image_def_exe_security,
3737
.cpu = std.meta.stringToEnum(ImageDef.ImageTypeFlags.Cpu, @tagName(arch)).?,
3838
.chip = .RP2350,
3939
.try_before_you_buy = false,
4040
},
4141
},
4242
},
43-
.link = root.microzig_options.hal.next_metadata_block,
43+
.link = root.microzig_options.hal.bootmeta.next_block,
4444
};
4545

4646
comptime {

0 commit comments

Comments
 (0)