Skip to content

DO NOT MERGE#119

Open
pussuw wants to merge 2 commits intomasterfrom
riscv_asm_ctxswitch
Open

DO NOT MERGE#119
pussuw wants to merge 2 commits intomasterfrom
riscv_asm_ctxswitch

Conversation

@pussuw
Copy link
Copy Markdown

@pussuw pussuw commented May 16, 2023

Hiding spot for the assembly context switch routines. Severely outdated. Added here so they don't get lost if local machine dies.

pussuw added 2 commits March 29, 2022 15:08
- Add config "ARCH_USE_S_MODE" which controls whether the kernel
  runs in M-mode or S-mode
- Add more MSTATUS and most of the SSTATUS register definitions
- Add more MIP flags for interrupt delegation
- Add handling of interrupts from S-mode
- Add handling of FPU from S-mode
- Add new context handling functions that are not dependent on the trap
  handlers / ecall

NOTE: S-mode requires a companion SW (SBI) which is not yet implemented,
      thus S-mode is not usable as is, yet.
It might be useful to store things in memory per CPU. The tricky part
is that all CPUs run the same code and see the same memory, so some
kind of centralized access is required.

For now, the structure contains the hart id.

Access to the structure elements is provided via sscratch, which is
unique for every hart!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant