proc.c: Simplify mycpu(), remove cpuid() for now as it is only a front for r_tp()

This commit is contained in:
Imbus 2025-06-26 10:29:40 +02:00
parent 697a84b370
commit be50854251
2 changed files with 4 additions and 16 deletions

View file

@ -2,18 +2,7 @@
struct Cpu cpus[NCPU];
// Must be called with interrupts disabled,
// to prevent race with process being moved
// to a different CPU.
int cpuid() {
int id = r_tp();
return id;
}
// Return this CPU's cpu struct.
// Interrupts must be disabled.
struct Cpu *mycpu(void) {
int id = cpuid();
struct Cpu *c = &cpus[id];
return c;
}
/**
* Return this CPU's cpu struct. Interrupts must be disabled.
*/
inline struct Cpu *mycpu(void) { return &cpus[r_tp()]; }

View file

@ -3,7 +3,6 @@
#include <riscv.h>
#include <types.h>
int cpuid(void);
struct Cpu *mycpu(void);
/** Saved registers for kernel context switches. */