Skip to content

Commit 8a9066f

Browse files
committed
[libcpu-riscv]: [surpport SMP]: Fix issues with non-standard formatting
Fix issues with non-standard formatting Signed-off-by: Mengchen Teng <teng_mengchen@163.com>
1 parent a59652d commit 8a9066f

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

libcpu/risc-v/common64/cpuport.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,6 @@ int rt_hw_cpu_id(void)
9090
asm volatile("csrr %0, satp" : "=r"(hartid));
9191
return hartid;
9292
}
93-
94-
9593
#endif /* RT_USING_SMP */
9694
}
9795

@@ -221,13 +219,12 @@ void rt_hw_percpu_hartid_init(rt_ubase_t *percpu_ptr, rt_ubase_t hartid)
221219
{
222220
rt_ubase_t *percpu_hartid_paddr;
223221
rt_size_t percpu_size = (rt_size_t)((rt_ubase_t)&__percpu_end - (rt_ubase_t)&__percpu_start);
224-
222+
225223
percpu_hartid = percpu_ptr;
226224

227225
// from virtual address to physical address
228226
percpu_ptr = (rt_ubase_t *)((rt_ubase_t)percpu_ptr + (rt_ubase_t)rt_kmem_pvoff());
229227
percpu_hartid_paddr = percpu_ptr;
230-
231228

232229
/* Save to the real area */
233230
*(rt_ubase_t *)((void *)percpu_hartid_paddr + hartid * percpu_size) = hartid;
@@ -236,7 +233,7 @@ void rt_hw_percpu_hartid_init(rt_ubase_t *percpu_ptr, rt_ubase_t hartid)
236233

237234
void secondary_cpu_entry(void)
238235
{
239-
236+
240237
#ifdef RT_USING_SMART
241238
/* switch to kernel address space */
242239
rt_hw_aspace_switch(&rt_kernel_space);

libcpu/risc-v/common64/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static int _map_one_page(struct rt_aspace *aspace, void *va, void *pa,
180180
*(mmu_l3 + l3_off) = COMBINEPTE((rt_ubase_t)pa, attr);
181181
rt_hw_cpu_dcache_clean(mmu_l3 + l3_off, sizeof(*(mmu_l3 + l3_off)));
182182
}
183-
183+
184184
return 0;
185185
}
186186

@@ -951,7 +951,7 @@ void rt_hw_mem_setup_early(void *pgtbl, rt_uint64_t hartid)
951951
ps += L2_PAGE_SIZE;
952952
vs += L2_PAGE_SIZE;
953953
}
954-
#endif
954+
#endif
955955
/* apply new mapping */
956956
asm volatile("sfence.vma x0, x0");
957957
write_csr(satp, SATP_BASE | ((size_t)early_pgtbl >> PAGE_OFFSET_BIT));

0 commit comments

Comments
 (0)