aboutsummaryrefslogtreecommitdiff
path: root/sys/arch/amd64
diff options
context:
space:
mode:
authorIan Moffett <ian@osmora.org>2024-03-13 23:30:21 -0400
committerIan Moffett <ian@osmora.org>2024-03-13 23:30:21 -0400
commita2b2dbaa71278769e9dbf5ca611cd0d5f3b896ed (patch)
tree3bcb4dbd92c147d0a6b6b0045894b91a1fe96004 /sys/arch/amd64
parent86ee5ee30e2f98137da80434af788bf928f49d55 (diff)
kernel/amd64: machdep: Add processor_free_pcb()
Add routine to deallocate resources within the process control block. Signed-off-by: Ian Moffett <ian@osmora.org>
Diffstat (limited to 'sys/arch/amd64')
-rw-r--r--sys/arch/amd64/amd64/machdep.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c
index 7ad3e6a..fa6c1f5 100644
--- a/sys/arch/amd64/amd64/machdep.c
+++ b/sys/arch/amd64/amd64/machdep.c
@@ -180,6 +180,19 @@ processor_init_pcb(struct proc *proc)
return 0;
}
+int
+processor_free_pcb(struct proc *proc)
+{
+ struct pcb *pcb = &proc->pcb;
+
+ if (pcb->fpu_state == NULL) {
+ return -1;
+ }
+
+ vm_free_pageframe(VIRT_TO_PHYS(pcb->fpu_state), 1);
+ return 0;
+}
+
void
processor_switch_to(struct proc *old_td, struct proc *new_td)
{