svn commit: r307321 - in head/sys/arm64: arm64 include
Konrad Witaszczyk
def at FreeBSD.org
Sat Oct 15 11:41:44 UTC 2016
Hi Andrew,
On 10/14/2016 17:53, Andrew Turner wrote:
> Author: andrew
> Date: Fri Oct 14 15:53:48 2016
> New Revision: 307321
> URL: https://svnweb.freebsd.org/changeset/base/307321
>
> Log:
> Rework how we store the VFP registers in the pcb. This will be used when
> creating a floating-point context within the kernel without having to move
> the stored values in memory.
>
> Sponsored by: The FreeBSD Foundation
>
> Modified:
> head/sys/arm64/arm64/machdep.c
> head/sys/arm64/arm64/vfp.c
> head/sys/arm64/arm64/vm_machdep.c
> head/sys/arm64/include/pcb.h
> head/sys/arm64/include/vfp.h
[...]
> Modified: head/sys/arm64/include/pcb.h
> ==============================================================================
> --- head/sys/arm64/include/pcb.h Fri Oct 14 15:16:44 2016 (r307320)
> +++ head/sys/arm64/include/pcb.h Fri Oct 14 15:53:48 2016 (r307321)
> @@ -31,6 +31,8 @@
>
> #ifndef LOCORE
>
> +#include <machine/vfp.h>
> +
> struct trapframe;
>
> #define PCB_LR 30
> @@ -49,13 +51,17 @@ struct pcb {
> #define PCB_SINGLE_STEP_SHIFT 0
> #define PCB_SINGLE_STEP (1 << PCB_SINGLE_STEP_SHIFT)
>
> - /* Place last to simplify the asm to access the rest if the struct */
> - __uint128_t pcb_vfp[32];
> - uint32_t pcb_fpcr;
> - uint32_t pcb_fpsr;
> + struct vfpstate *pcb_fpusaved;
> int pcb_fpflags;
> #define PCB_FP_STARTED 0x01
> u_int pcb_vfpcpu; /* Last cpu this thread ran VFP code */
> +
> + /*
> + * The userspace VFP state. The pcb_fpusaved pointer will point to
> + * this unless the kernel has allocated a VFP context.
> + * Place last to simplify the asm to access the rest if the struct.
> + */
> + struct vfpstate pcb_fpustate;
> };
>
> #ifdef _KERNEL
>
> Modified: head/sys/arm64/include/vfp.h
> ==============================================================================
> --- head/sys/arm64/include/vfp.h Fri Oct 14 15:16:44 2016 (r307320)
> +++ head/sys/arm64/include/vfp.h Fri Oct 14 15:53:48 2016 (r307321)
> @@ -35,6 +35,12 @@
> #ifdef _KERNEL
>
> #ifndef LOCORE
> +struct vfpstate {
> + __uint128_t vfp_regs[32];
> + uint32_t vfp_fpcr;
> + uint32_t vfp_fpsr;
> +};
> +
> void vfp_init(void);
> void vfp_discard(struct thread *);
> void vfp_restore_state(void);
These changes break buildworld for arm64:
In file included from /usr/home/def/FreeBSD/ekcd/repo/lib/libutil/kinfo_getfile.c:5:
In file included from
/usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/sys/user.h:38:
/usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/machine/pcb.h:64:18:
error: field has incomplete type 'struct vfpstate'
struct vfpstate pcb_fpustate;
^
/usr/obj/arm64.aarch64/usr/home/def/FreeBSD/ekcd/repo/tmp/usr/include/machine/pcb.h:54:9:
note: forward declaration of 'struct vfpstate'
struct vfpstate *pcb_fpusaved;
^
1 error generated.
--- kinfo_getfile.o ---
*** [kinfo_getfile.o] Error code 1
You might want to consider making vfpstate available for userland as in arm
case. If so I'm attaching a patch for it.
Konrad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vfpstate.patch
Type: text/x-patch
Size: 461 bytes
Desc: not available
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20161015/5a2ecb92/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 949 bytes
Desc: OpenPGP digital signature
URL: <http://lists.freebsd.org/pipermail/svn-src-all/attachments/20161015/5a2ecb92/attachment.sig>
More information about the svn-src-all
mailing list