git: 87271de92c4a - stable/13 - Unstaticize {get,set}_fpcontext() on amd64

From: Dmitry Chagin <dchagin_at_FreeBSD.org>
Date: Thu, 09 Feb 2023 07:56:37 UTC
The branch stable/13 has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=87271de92c4a69cfe92656c16bbef467e60b8c3b

commit 87271de92c4a69cfe92656c16bbef467e60b8c3b
Author:     Edward Tomasz Napierala <trasz@FreeBSD.org>
AuthorDate: 2022-01-04 13:25:12 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2023-02-09 07:54:16 +0000

    Unstaticize {get,set}_fpcontext() on amd64
    
    This will be used to fix Linux signal delivery.
    
    Discussed With: kib
    Sponsored By:   EPSRC
    
    (cherry picked from commit 562bc0a943d1fad1a9b551557609d2941a851b4d)
---
 sys/amd64/amd64/exec_machdep.c | 9 ++-------
 sys/amd64/include/md_var.h     | 5 +++++
 2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/sys/amd64/amd64/exec_machdep.c b/sys/amd64/amd64/exec_machdep.c
index 0c2bebaea8f3..233f222b49f1 100644
--- a/sys/amd64/amd64/exec_machdep.c
+++ b/sys/amd64/amd64/exec_machdep.c
@@ -95,11 +95,6 @@ __FBSDID("$FreeBSD$");
 #include <machine/specialreg.h>
 #include <machine/trap.h>
 
-static void get_fpcontext(struct thread *td, mcontext_t *mcp,
-    char **xfpusave, size_t *xfpusave_len);
-static int set_fpcontext(struct thread *td, mcontext_t *mcp,
-    char *xfpustate, size_t xfpustate_len);
-
 /*
  * Send an interrupt to process.
  *
@@ -714,7 +709,7 @@ set_mcontext(struct thread *td, mcontext_t *mcp)
 	return (0);
 }
 
-static void
+void
 get_fpcontext(struct thread *td, mcontext_t *mcp, char **xfpusave,
     size_t *xfpusave_len)
 {
@@ -735,7 +730,7 @@ get_fpcontext(struct thread *td, mcontext_t *mcp, char **xfpusave,
 	}
 }
 
-static int
+int
 set_fpcontext(struct thread *td, mcontext_t *mcp, char *xfpustate,
     size_t xfpustate_len)
 {
diff --git a/sys/amd64/include/md_var.h b/sys/amd64/include/md_var.h
index c8610f495bfe..13dedac784d1 100644
--- a/sys/amd64/include/md_var.h
+++ b/sys/amd64/include/md_var.h
@@ -54,6 +54,7 @@ extern vm_paddr_t KERNend;
 
 extern bool efi_boot;
 
+struct	__mcontext;
 struct	savefpu;
 struct	sysentvec;
 
@@ -89,5 +90,9 @@ void	set_top_of_stack_td(struct thread *td);
 struct savefpu *get_pcb_user_save_td(struct thread *td);
 struct savefpu *get_pcb_user_save_pcb(struct pcb *pcb);
 void	pci_early_quirks(void);
+void	get_fpcontext(struct thread *td, struct __mcontext *mcp,
+	    char **xfpusave, size_t *xfpusave_len);
+int	set_fpcontext(struct thread *td, struct __mcontext *mcp,
+	    char *xfpustate, size_t xfpustate_len);
 
 #endif /* !_MACHINE_MD_VAR_H_ */