Skip to content

Commit 67a4e6e

Browse files
committed
Add LoongArch64 support
1 parent bb8ed3c commit 67a4e6e

File tree

10 files changed

+11129
-3
lines changed

10 files changed

+11129
-3
lines changed

gen/ioctl/generate.sh

+3
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,8 @@ qemu-riscv64 -L /usr/riscv64-linux-gnu ./main.exe >> "$out"
4444
s390x-linux-gnu-gcc -Iinclude -c list.c $cflags
4545
s390x-linux-gnu-gcc main.c list.o -o main.exe $cflags
4646
qemu-s390x -L /usr/s390x-linux-gnu ./main.exe >> "$out"
47+
loongarch64-linux-gnu-gcc -Iinclude -c list.c $cflags
48+
loongarch64-linux-gnu-gcc main.c list.o -o main.exe $cflags
49+
./main.exe >> "$out"
4750

4851
rm list.o main.exe

gen/ioctl/list.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ struct sockaddr {
9494
#include <linux/joystick.h>
9595
#include <linux/kd.h>
9696
#include <linux/kcov.h>
97-
#if !defined(__arm__) && !defined(__powerpc64__) && !defined(__riscv) // various errors
97+
#if !defined(__arm__) && !defined(__loongarch__) && !defined(__powerpc64__) && !defined(__riscv) // various errors
9898
#include <linux/kvm.h>
9999
#endif
100100
#include <linux/lirc.h>
@@ -509,7 +509,7 @@ void list(void) {
509509
IOCTL_REQUEST(ENI_SETMULT);
510510
IOCTL_REQUEST(RIO_GET_EVENT_MASK);
511511
IOCTL_REQUEST(LIRC_GET_MAX_TIMEOUT);
512-
#if !defined(__arm__) && !defined(__powerpc64__) && !defined(__riscv)
512+
#if !defined(__arm__) && !defined(__loongarch__) && !defined(__powerpc64__) && !defined(__riscv)
513513
#if 0 // needs `struct kvm_cpuid2`
514514
IOCTL_REQUEST(KVM_GET_SUPPORTED_CPUID);
515515
#endif

gen/ioctl/main.c

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ int main(void) {
4343
printf("#if defined(__riscv) && __riscv_xlen == 64\n");
4444
#elif defined(__s390x__)
4545
printf("#if defined(__s390x__)\n");
46+
#elif defined(__loongarch__)
47+
printf("#ifdef __loongarch__\n");
4648
#else
4749
#error "unimplemented architecture"
4850
#endif

0 commit comments

Comments
 (0)