diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/core.h b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/core.h index 21a86db89..0bfa4b198 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/core.h +++ b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/core.h @@ -226,10 +226,10 @@ __attribute__((__always_inline__)) static inline void arch_set_return(struct tra // TODO: refer to jh7110 Linux struct thread_info { unsigned long flags; /* low level flags */ - int preempt_count; /* 0=>preemptible, <0=>BUG */ + long preempt_count; /* 0=>preemptible, <0=>BUG */ long kernel_sp; /* Kernel stack pointer */ long user_sp; /* User stack pointer */ - int cpu; + long cpu; }; diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S index f9ba432d3..d445c8883 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S +++ b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/boot.S @@ -11,7 +11,6 @@ */ #include -#include "core.h" #include "memlayout.h" @@ -61,8 +60,7 @@ clear_bss_done: /* Restore C environment */ la tp, init_thread_info - sw zero, TASK_TI_CPU(tp) - la sp, init_thread_union + THREAD_SIZE + sw zero, 32(tp) /* Start the kernel */ tail bootmain @@ -70,7 +68,7 @@ clear_bss_done: relocate_enable_mmu: /* Relocate return address */ la a1, kernel_map - ld a1, KERNEL_MAP_VIRT_ADDR(a1) + ld a1, 0(a1) la a2, _start sub a1, a1, a2 add ra, ra, a1 diff --git a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/jh7110.lds b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/jh7110.lds index 93f0e549e..94aed0350 100644 --- a/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/jh7110.lds +++ b/Ubiquitous/XiZi_AIoT/hardkernel/arch/riscv/rv64gc/preboot_for_jh7110/jh7110.lds @@ -39,7 +39,6 @@ OUTPUT_ARCH(riscv) OUTPUT_FORMAT("elf64-littleriscv", "elf64-littleriscv", "elf64-littleriscv") -/* ENTRY(_start) */ ENTRY( _boot_start ) MEMORY { @@ -85,27 +84,15 @@ SECTIONS PROVIDE(boot_end_addr = .); } -. = ALIGN(0x1000); .text : { . = ALIGN(0x1000); *(.text .text.*) } - . = ALIGN(0x1000); .data : { - . = ALIGN(16); - *(.sdata .sdata.*) - . = ALIGN(16); + . = ALIGN(0x1000); *(.data .data.*) - __start_init_task = .; - init_thread_union = .; - init_stack = .; - KEEP(*(.data..init_task)) - KEEP(*(.data..init_thread_info)) - . = __start_init_task + ((1 << (12)) << (2)); - __end_init_task = .; - . = ALIGN(0x1000); PROVIDE(_binary_fs_img_start = .); *(.rawdata_fs_img*) @@ -122,11 +109,14 @@ SECTIONS PROVIDE(__init_array_end = .); } - . = ALIGN(0x1000); - _image_size = . - _start; + .sdata : { + . = ALIGN(0x1000); + __global_pointer$ = . + 0x800; + *(.sdata*) + } - . = ALIGN(0x1000); .bss : { + . = ALIGN(0x1000); PROVIDE(kernel_data_begin = .); PROVIDE(__bss_start = .); *(.bss .bss.* COMMON) @@ -136,11 +126,9 @@ SECTIONS __bss_stop = .; } - . = ALIGN((1 << 21)); - .sdata : { - __global_pointer$ = . + 0x800; - *(.sdata*) - } + . = ALIGN(0x1000); + _image_size = . - _start; + . = ALIGN((1 << 21)); _edata = .; _end = .; diff --git a/Ubiquitous/XiZi_AIoT/services/boards/jh7110/jh7110_user.lds b/Ubiquitous/XiZi_AIoT/services/boards/jh7110/jh7110_user.lds index fb0dc78e0..d06e84c91 100644 --- a/Ubiquitous/XiZi_AIoT/services/boards/jh7110/jh7110_user.lds +++ b/Ubiquitous/XiZi_AIoT/services/boards/jh7110/jh7110_user.lds @@ -86,61 +86,3 @@ SECTIONS _end = .; PROVIDE(end = .); } - -/* -SECTIONS -{ - _start = .; - _boot_start = .; - -. = ALIGN(0x1000); - .text : { - . = ALIGN(0x1000); - *(.text .text.*) - } - - . = ALIGN(0x1000); - .data : { - . = ALIGN(16); - *(.sdata .sdata.*) - . = ALIGN(16); - *(.data .data.*) - - __start_init_task = .; - init_thread_union = .; - init_stack = .; - KEEP(*(.data..init_task)) - KEEP(*(.data..init_thread_info)) - . = __start_init_task + ((1 << (12)) << (2)); - __end_init_task = .; - - - PROVIDE(__init_array_start = .); - PROVIDE(__init_array_end = .); - } - - . = ALIGN(0x1000); - _image_size = . - _start; - - . = ALIGN(0x1000); - .bss : { - PROVIDE(kernel_data_begin = .); - PROVIDE(__bss_start = .); - *(.bss .bss.* COMMON) - . = ALIGN(0x1000); - PROVIDE(__bss_end = .); - PROVIDE(kernel_data_end = .); - __bss_stop = .; - } - - . = ALIGN((1 << 21)); - .sdata : { - __global_pointer$ = . + 0x800; - *(.sdata*) - } - . = ALIGN((1 << 21)); - _edata = .; - _end = .; - PROVIDE(end = .); -} -*/ \ No newline at end of file