diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/entry.S | 7 | ||||
-rw-r--r-- | kernel/proc.c | 2 | ||||
-rw-r--r-- | kernel/spinlock.c | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/kernel/entry.S b/kernel/entry.S index b3d2c55..97eaf11 100644 --- a/kernel/entry.S +++ b/kernel/entry.S @@ -2,7 +2,7 @@ # there seem to be provided by qemu, as if it # were a ROM. the code at 0x1000 jumps to # 0x8000000, the _start function here, - # in machine mode. + # in machine mode. each CPU starts here. .section .data .globl stack0 .section .text @@ -11,8 +11,9 @@ .globl _entry _entry: # set up a stack for C. - # stack0 is declared in start, - # with 4096 bytes per CPU. + # stack0 is declared in start.c, + # with a 4096-byte stack per CPU. + # sp = stack0 + (hartid * 4096) la sp, stack0 li a0, 1024*4 csrr a1, mhartid diff --git a/kernel/proc.c b/kernel/proc.c index 81c0e98..cebef1a 100644 --- a/kernel/proc.c +++ b/kernel/proc.c @@ -46,7 +46,7 @@ cpuid() return id; } -// Return this core's cpu struct. +// Return this CPU's cpu struct. // Interrupts must be disabled. struct cpu* mycpu(void) { diff --git a/kernel/spinlock.c b/kernel/spinlock.c index 83512bb..563532e 100644 --- a/kernel/spinlock.c +++ b/kernel/spinlock.c @@ -52,7 +52,7 @@ release(struct spinlock *lk) // Tell the C compiler and the CPU to not move loads or stores // past this point, to ensure that all the stores in the critical - // section are visible to other cores before the lock is released. + // section are visible to other CPUs before the lock is released. // On RISC-V, this turns into a fence instruction. __sync_synchronize(); |