mit-pdos / xv6-riscv

Xv6 for RISC-V
Other
6.52k stars 2.37k forks source link

Update entry.S #201

Open Abhinavpatel00 opened 9 months ago

Abhinavpatel00 commented 9 months ago

corrected the typo here

# Read the hardware thread ID ('mhartid') into register 'a1'.
csrr a1, mhartid

# Increment the hardware thread ID by 1 to avoid a stack overlap issue.
addi a1, a1, 1

# Calculate the new stack pointer value:
# sp = stack0 + ((hartid + 1) * 4096)
mul a0, a0, a1
add sp, sp, a0