Skip to content

Commit

Permalink
main: Drop PAYLOAD_SIZE, use compile time kernel size
Browse files Browse the repository at this point in the history
Signed-off-by: Markuss Broks <[email protected]>
  • Loading branch information
nergzd723 authored and ivoszbg committed Jun 14, 2022
1 parent 4d1a5f8 commit 7c6386e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/main.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
#ifndef MAIN_H_ /* Include guard */
#define MAIN_H_

extern unsigned long kernel_size;
extern void load_kernel(void* dtb, void* x1, void* x2, void* x3, void* kernel);
extern void soc_init(void);
extern void board_init(void);
Expand Down
2 changes: 2 additions & 0 deletions main/linker.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,6 @@ SECTIONS
kernel = .;
KERNEL_PATH
}

kernel_size = SIZEOF(.kernel);
}
2 changes: 1 addition & 1 deletion main/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,6 @@ void main(void* dt, void* kernel) {
#ifdef CONFIG_SIMPLE_FB
debug_printfb((char*)CONFIG_FRAMEBUFFER_BASE, "Booting linux...", 0, CONFIG_FRAMEBUFFER_WIDTH, CONFIG_FRAMEBUFFER_STRIDE);
#endif
memcpy((void*)CONFIG_PAYLOAD_ENTRY, kernel, CONFIG_PAYLOAD_SIZE);
memcpy((void*)CONFIG_PAYLOAD_ENTRY, kernel, (unsigned long) &kernel_size);
load_kernel(dt, 0, 0, 0, (void*)CONFIG_PAYLOAD_ENTRY);
}

0 comments on commit 7c6386e

Please sign in to comment.