1/* SPDX-License-Identifier: BSD-2-Clause */ 2/* 3 * Copyright (c) 2015-2016, Linaro Limited 4 * All rights reserved. 5 * 6 * Redistribution and use in source and binary forms, with or without 7 * modification, are permitted provided that the following conditions are met: 8 * 9 * 1. Redistributions of source code must retain the above copyright notice, 10 * this list of conditions and the following disclaimer. 11 * 12 * 2. Redistributions in binary form must reproduce the above copyright notice, 13 * this list of conditions and the following disclaimer in the documentation 14 * and/or other materials provided with the distribution. 15 * 16 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 19 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE 20 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 21 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 22 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 23 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 24 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 25 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 26 * POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <asm.S> 30#include <kernel/unwind.h> 31 32 .fpu neon 33 34/* void vfp_save_extension_regs(uint64_t regs[VFP_NUM_REGS]); */ 35FUNC vfp_save_extension_regs , : 36UNWIND( .fnstart) 37 vstm r0!, {d0-d15} 38 vstm r0, {d16-d31} 39 bx lr 40UNWIND( .fnend) 41END_FUNC vfp_save_extension_regs 42 43/* void vfp_restore_extension_regs(uint64_t regs[VFP_NUM_REGS]); */ 44FUNC vfp_restore_extension_regs , : 45UNWIND( .fnstart) 46 vldm r0!, {d0-d15} 47 vldm r0, {d16-d31} 48 bx lr 49UNWIND( .fnend) 50END_FUNC vfp_restore_extension_regs 51 52/* void vfp_write_fpexc(uint32_t fpexc) */ 53FUNC vfp_write_fpexc , : 54UNWIND( .fnstart) 55 vmsr fpexc, r0 56 bx lr 57UNWIND( .fnend) 58END_FUNC vfp_write_fpexc 59 60/* uint32_t vfp_read_fpexc(void) */ 61FUNC vfp_read_fpexc , : 62UNWIND( .fnstart) 63 vmrs r0, fpexc 64 bx lr 65UNWIND( .fnend) 66END_FUNC vfp_read_fpexc 67 68/* void vfp_write_fpscr(uint32_t fpscr) */ 69FUNC vfp_write_fpscr , : 70UNWIND( .fnstart) 71 vmsr fpscr, r0 72 bx lr 73UNWIND( .fnend) 74END_FUNC vfp_write_fpscr 75 76/* uint32_t vfp_read_fpscr(void) */ 77FUNC vfp_read_fpscr , : 78UNWIND( .fnstart) 79 vmrs r0, fpscr 80 bx lr 81UNWIND( .fnend) 82END_FUNC vfp_read_fpscr 83