Skip to content

Commit

Permalink
anyopaque to u8
Browse files Browse the repository at this point in the history
  • Loading branch information
mattnite committed Aug 4, 2023
1 parent c1ac2f4 commit d5c93ba
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 15 deletions.
13 changes: 8 additions & 5 deletions src/modules/cpus/cortex-m.zig
Original file line number Diff line number Diff line change
Expand Up @@ -70,11 +70,14 @@ pub fn clrex() void {
pub const startup_logic = struct {
extern fn microzig_main() noreturn;

extern var microzig_data_start: anyopaque;
extern var microzig_data_end: anyopaque;
extern var microzig_bss_start: anyopaque;
extern var microzig_bss_end: anyopaque;
extern const microzig_data_load_start: anyopaque;
// it looks odd to just use a u8 here, but in C it's common to use a
// char when linking these values from the linkerscript. What's
// important is the addresses of these values.
extern var microzig_data_start: u8;
extern var microzig_data_end: u8;
extern var microzig_bss_start: u8;
extern var microzig_bss_end: u8;
extern const microzig_data_load_start: u8;

pub fn _start() callconv(.C) noreturn {

Expand Down
13 changes: 8 additions & 5 deletions src/modules/cpus/riscv32.zig
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,14 @@ pub const REGBYTES = (1 << LOG_REGBYTES);
pub const startup_logic = struct {
extern fn microzig_main() noreturn;

extern var microzig_data_start: anyopaque;
extern var microzig_data_end: anyopaque;
extern var microzig_bss_start: anyopaque;
extern var microzig_bss_end: anyopaque;
extern const microzig_data_load_start: anyopaque;
// it looks odd to just use a u8 here, but in C it's common to use a
// char when linking these values from the linkerscript. What's
// important is the addresses of these values.
extern var microzig_data_start: u8;
extern var microzig_data_end: u8;
extern var microzig_bss_start: u8;
extern var microzig_bss_end: u8;
extern const microzig_data_load_start: u8;

pub fn _start() callconv(.C) noreturn {

Expand Down
13 changes: 8 additions & 5 deletions src/start.zig
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,14 @@ export fn microzig_main() noreturn {
/// Contains references to the microzig .data and .bss sections, also
/// contains the initial load address for .data if it is in flash.
pub const sections = struct {
extern var microzig_data_start: anyopaque;
extern var microzig_data_end: anyopaque;
extern var microzig_bss_start: anyopaque;
extern var microzig_bss_end: anyopaque;
extern const microzig_data_load_start: anyopaque;
// it looks odd to just use a u8 here, but in C it's common to use a
// char when linking these values from the linkerscript. What's
// important is the addresses of these values.
extern var microzig_data_start: u8;
extern var microzig_data_end: u8;
extern var microzig_bss_start: u8;
extern var microzig_bss_end: u8;
extern const microzig_data_load_start: u8;
};

pub fn initialize_system_memories() void {
Expand Down

0 comments on commit d5c93ba

Please sign in to comment.