Skip to content

Commit

Permalink
Add LoongArch64 support
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaixiaojuan authored and heiher committed Apr 12, 2023
1 parent bb8ed3c commit 62fc16b
Show file tree
Hide file tree
Showing 11 changed files with 12,651 additions and 19 deletions.
3 changes: 3 additions & 0 deletions gen/ioctl/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ qemu-riscv64 -L /usr/riscv64-linux-gnu ./main.exe >> "$out"
s390x-linux-gnu-gcc -Iinclude -c list.c $cflags
s390x-linux-gnu-gcc main.c list.o -o main.exe $cflags
qemu-s390x -L /usr/s390x-linux-gnu ./main.exe >> "$out"
# As LoongArch cross toolchain is not yet packaged in mainstream distros yet,
# pre-generated output is used for the time being
cat loongarch-ioctls.txt >> "$out"

rm list.o main.exe
4 changes: 2 additions & 2 deletions gen/ioctl/list.c
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ struct sockaddr {
#include <linux/joystick.h>
#include <linux/kd.h>
#include <linux/kcov.h>
#if !defined(__arm__) && !defined(__powerpc64__) && !defined(__riscv) // various errors
#if !defined(__arm__) && !defined(__loongarch__) && !defined(__powerpc64__) && !defined(__riscv) // various errors
#include <linux/kvm.h>
#endif
#include <linux/lirc.h>
Expand Down Expand Up @@ -509,7 +509,7 @@ void list(void) {
IOCTL_REQUEST(ENI_SETMULT);
IOCTL_REQUEST(RIO_GET_EVENT_MASK);
IOCTL_REQUEST(LIRC_GET_MAX_TIMEOUT);
#if !defined(__arm__) && !defined(__powerpc64__) && !defined(__riscv)
#if !defined(__arm__) && !defined(__loongarch__) && !defined(__powerpc64__) && !defined(__riscv)
#if 0 // needs `struct kvm_cpuid2`
IOCTL_REQUEST(KVM_GET_SUPPORTED_CPUID);
#endif
Expand Down
Loading

0 comments on commit 62fc16b

Please sign in to comment.