-
Notifications
You must be signed in to change notification settings - Fork 4
Add sections table #32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
58344a5
473a4d8
940149a
99f3527
b9fe67a
78de14d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| #include "khal.h" | ||
| #include "kstring.h" | ||
| #include <stdint.h> | ||
|
|
||
| extern uint64_t kernel_section_text_start; | ||
| extern uint64_t kernel_section_text_end; | ||
| extern uint64_t kernel_section_rodata_start; | ||
| extern uint64_t kernel_section_rodata_end; | ||
| extern uint64_t kernel_section_data_start; | ||
| extern uint64_t kernel_section_data_end; | ||
| extern uint64_t kernel_section_bss_start; | ||
| extern uint64_t kernel_section_bss_end; | ||
|
|
||
| typedef struct { | ||
| uint64_t start; | ||
| uint64_t end; | ||
| } sections_t; | ||
|
|
||
| sections_t kernel_sections[4]; | ||
|
|
||
| sections_t *sectons_init() { | ||
| // Why this halts cpu? | ||
| //memset(&kernel_section_bss_start, 0, | ||
| // (uint64_t)&kernel_section_bss_end - | ||
| // (uint64_t)&kernel_section_bss_start); | ||
| serial_printf("\t.text 0x%x-0x%x(%u)\n", &kernel_section_text_start, | ||
| &kernel_section_text_end, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_text_end - &kernel_section_text_start); | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'long'.
|
||
| kernel_sections[0] = | ||
| (sections_t){ kernel_section_text_start, kernel_section_text_end }; | ||
|
|
||
| serial_printf("\t.rodata 0x%x-0x%x(%u)\n", &kernel_section_rodata_start, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_rodata_end, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_rodata_end - &kernel_section_rodata_start); | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'long'.
|
||
| kernel_sections[1] = | ||
| (sections_t){ kernel_section_rodata_start, kernel_section_rodata_end }; | ||
|
|
||
| serial_printf("\t.data 0x%x-0x%x(%u)\n", &kernel_section_data_start, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_data_end, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_data_end - &kernel_section_data_start); | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'long'.
|
||
| kernel_sections[2] = | ||
| (sections_t){ kernel_section_data_start, kernel_section_data_end }; | ||
|
|
||
| serial_printf("\t.bss 0x%x-0x%x(%u)\n", &kernel_section_bss_start, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_bss_end, | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'unsigned long *'.
|
||
| &kernel_section_bss_end - &kernel_section_bss_start); | ||
Check failureCode scanning / CodeQL Wrong type of arguments to formatting function High
This format specifier for type 'unsigned int' does not match the argument type 'long'.
|
||
| kernel_sections[3] = | ||
| (sections_t){ kernel_section_bss_start, kernel_section_bss_end }; | ||
|
|
||
| return (sections_t *)&kernel_sections; | ||
| } | ||
Check failure
Code scanning / CodeQL
Wrong type of arguments to formatting function High