Cygwin: access: Fix X_OK behaviour for backup operators and admins
[newlib-cygwin.git] / newlib / libc / machine / riscv / sys / asm.h
blob8c8aeb3ae77575a8071f3074549c7f26531941cb
1 /* Copyright (c) 2017 SiFive Inc. All rights reserved.
3 This copyrighted material is made available to anyone wishing to use,
4 modify, copy, or redistribute it subject to the terms and conditions
5 of the FreeBSD License. This program is distributed in the hope that
6 it will be useful, but WITHOUT ANY WARRANTY expressed or implied,
7 including the implied warranties of MERCHANTABILITY or FITNESS FOR
8 A PARTICULAR PURPOSE. A copy of this license is available at
9 http://www.opensource.org/licenses.
12 #ifndef _SYS_ASM_H
13 #define _SYS_ASM_H
16 * Macros to handle different pointer/register sizes for 32/64-bit code
18 #if __riscv_xlen == 64
19 # define PTRLOG 3
20 # define SZREG 8
21 # define REG_S sd
22 # define REG_L ld
23 #elif __riscv_xlen == 32
24 # define PTRLOG 2
25 # define SZREG 4
26 # define REG_S sw
27 # define REG_L lw
28 #else
29 # error __riscv_xlen must equal 32 or 64
30 #endif
32 #ifndef __riscv_float_abi_soft
33 /* For ABI uniformity, reserve 8 bytes for floats, even if double-precision
34 floating-point is not supported in hardware. */
35 # define SZFREG 8
36 # ifdef __riscv_float_abi_single
37 # define FREG_L flw
38 # define FREG_S fsw
39 # elif defined(__riscv_float_abi_double)
40 # define FREG_L fld
41 # define FREG_S fsd
42 # elif defined(__riscv_float_abi_quad)
43 # define FREG_L flq
44 # define FREG_S fsq
45 # else
46 # error unsupported FLEN
47 # endif
48 #endif
50 #endif /* sys/asm.h */