Skip to content

Commit

Permalink
RISC-V: Rename relocate() and make it global
Browse files Browse the repository at this point in the history
The low-level relocate() function enables mmu and relocates
execution to link-time addresses. We rename relocate() function
to relocate_enable_mmu() function which is more informative.

Also, the relocate_enable_mmu() function will be used in the
resume path when a CPU wakes-up from a non-retentive suspend
so we make it global symbol.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Reviewed-by: Guo Ren <guoren@kernel.org>
Reviewed-by: Atish Patra <atishp@rivosinc.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
  • Loading branch information
Anup Patel authored and Palmer Dabbelt committed Mar 10, 2022
1 parent f6e64b6 commit e1de2c9
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions arch/riscv/kernel/head.S
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@ pe_head_start:

.align 2
#ifdef CONFIG_MMU
relocate:
.global relocate_enable_mmu
relocate_enable_mmu:
/* Relocate return address */
la a1, kernel_map
XIP_FIXUP_OFFSET a1
Expand Down Expand Up @@ -185,7 +186,7 @@ secondary_start_sbi:
/* Enable virtual memory and relocate to virtual address */
la a0, swapper_pg_dir
XIP_FIXUP_OFFSET a0
call relocate
call relocate_enable_mmu
#endif
call setup_trap_vector
tail smp_callin
Expand Down Expand Up @@ -329,7 +330,7 @@ clear_bss_done:
#ifdef CONFIG_MMU
la a0, early_pg_dir
XIP_FIXUP_OFFSET a0
call relocate
call relocate_enable_mmu
#endif /* CONFIG_MMU */

call setup_trap_vector
Expand Down

0 comments on commit e1de2c9

Please sign in to comment.