summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorStef O'Rear <sorear2@gmail.com>2018-03-11 05:55:15 -0700
committerAnthony Green <green@moxielogic.com>2018-03-11 08:55:15 -0400
commit3840d49aaa831d649b1597518a2903dfed0d57f3 (patch)
treeda49ee49ae31cc6e44beeb59930e995c4ec00ebb /include
parentdca52b55bc2ac0213c20849d7e9e19fbc9202023 (diff)
downloadlibffi-3840d49aaa831d649b1597518a2903dfed0d57f3.tar.gz
New RISC-V port (#281)
* Add RISC-V support This patch adds support for the RISC-V architecture (https://riscv.org). This patch has been tested using QEMU user-mode emulation and GCC 7.2.0 in the following configurations: * -march=rv32imac -mabi=ilp32 * -march=rv32g -mabi=ilp32d * -march=rv64imac -mabi=lp64 * -march=rv64g -mabi=lp64d The ABI currently can be found at https://github.com/riscv/riscv-elf-psabi-doc/blob/master/riscv-elf.md . * Add RISC-V to README * RISC-V: fix configure.host
Diffstat (limited to 'include')
-rw-r--r--include/ffi_common.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/ffi_common.h b/include/ffi_common.h
index d1d9fd8..7fb0a64 100644
--- a/include/ffi_common.h
+++ b/include/ffi_common.h
@@ -74,7 +74,9 @@ void ffi_type_test(ffi_type *a, char *file, int line);
#define FFI_ASSERT_VALID_TYPE(x)
#endif
+/* v cast to size_t and aligned up to a multiple of a */
#define FFI_ALIGN(v, a) (((((size_t) (v))-1) | ((a)-1))+1)
+/* v cast to size_t and aligned down to a multiple of a */
#define ALIGN_DOWN(v, a) (((size_t) (v)) & -a)
/* Perform machine dependent cif processing */