On 1/6/22 17:41, Song Gao wrote:
We should disable '__BITS_PER_LONG' at [1] before run gensyscalls.sh [1] arch/loongarch/include/uapi/asm/bitsperlong.h Signed-off-by: Song Gao<gaos...@loongson.cn> Signed-off-by: Xiaojuan Yang<yangxiaoj...@loongson.cn> Reviewed-by: Richard Henderson<richard.hender...@linaro.org> Reviewed-by: Philippe Mathieu-Daudé<f4...@amsat.org> --- linux-user/loongarch64/syscall_nr.h | 313 ++++++++++++++++++++++++ linux-user/loongarch64/target_syscall.h | 48 ++++ linux-user/syscall_defs.h | 10 +- scripts/gensyscalls.sh | 1 + 4 files changed, 368 insertions(+), 4 deletions(-) create mode 100644 linux-user/loongarch64/syscall_nr.h create mode 100644 linux-user/loongarch64/target_syscall.h
This is exactly what we don't want to merge before the Linux port (and glibc) lands; things like UNAME_MINIMUM_RELEASE and the syscall numbers certainly need to be updated afterwards. Otherwise everything looks good though.
The "struct { ... } csr" part suggested by Philippe is deviating from the kernel sources, but the memory layout is the same, and in looking at other targets it seems we're not required to keep exact correspondence with kernel -- am I right? (Many targets do use the exact definition as kernel, e.g. aarch64, though)