aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/amd64/amd64/machdep.c13
-rw-r--r--sys/include/sys/machdep.h1
2 files changed, 14 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)
{
diff --git a/sys/include/sys/machdep.h b/sys/include/sys/machdep.h
index b6edf14..0c06374 100644
--- a/sys/include/sys/machdep.h
+++ b/sys/include/sys/machdep.h
@@ -39,6 +39,7 @@
#define MAXCPUS 32
int processor_init_pcb(struct proc *proc);
+int processor_free_pcb(struct proc *proc);
void processor_switch_to(struct proc *old_td, struct proc *new_td);
void processor_init(void);
void processor_halt(void);