Skip to content

Commit

Permalink
update ioctl of csky (#105)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dirreke authored and sunfishcode committed Jan 16, 2024
1 parent 60ebea3 commit 36f889b
Show file tree
Hide file tree
Showing 4 changed files with 52 additions and 10 deletions.
19 changes: 16 additions & 3 deletions gen/ioctl/csky-ioctls.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,22 @@
#define BLKSECDISCARD 0x127dul
#define BLKROTATIONAL 0x127eul
#define BLKZEROOUT 0x127ful
#define FIEMAP_MAX_OFFSET 0xfffffffful
#define FIEMAP_FLAG_SYNC 0x1ul
#define FIEMAP_FLAG_XATTR 0x2ul
#define FIEMAP_FLAG_CACHE 0x4ul
#define FIEMAP_FLAGS_COMPAT 0x3ul
#define FIEMAP_EXTENT_LAST 0x1ul
#define FIEMAP_EXTENT_UNKNOWN 0x2ul
#define FIEMAP_EXTENT_DELALLOC 0x4ul
#define FIEMAP_EXTENT_ENCODED 0x8ul
#define FIEMAP_EXTENT_DATA_ENCRYPTED 0x80ul
#define FIEMAP_EXTENT_NOT_ALIGNED 0x100ul
#define FIEMAP_EXTENT_DATA_INLINE 0x200ul
#define FIEMAP_EXTENT_DATA_TAIL 0x400ul
#define FIEMAP_EXTENT_UNWRITTEN 0x800ul
#define FIEMAP_EXTENT_MERGED 0x1000ul
#define FIEMAP_EXTENT_SHARED 0x2000ul
#define UFFDIO_REGISTER 0xc020aa00ul
#define UFFDIO_UNREGISTER 0x8010aa01ul
#define UFFDIO_WAKE 0x8010aa02ul
Expand Down Expand Up @@ -913,7 +929,6 @@
#define VIDIOC_G_DV_TIMINGS 0xc0845658ul
#define TUNSETIFINDEX 0x400454daul
#define CCISS_SETINTINFO 0x40084203ul
#define CM_IOSDBGLVL 0x400463faul
#define RTC_VL_CLR 0x7014ul
#define VIDIOC_REQBUFS 0xc0145608ul
#define USBDEVFS_REAPURBNDELAY32 0x4004550dul
Expand Down Expand Up @@ -1043,7 +1058,6 @@
#define VFIO_SET_IOMMU 0x3b66ul
#define VIDIOC_S_MODULATOR 0x40445637ul
#define TUNGETFILTER 0x800854dbul
#define MEYEIOC_SYNC 0xc00476c3ul
#define CCISS_SETNODENAME 0x40104205ul
#define FBIO_GETCONTROL2 0x80044689ul
#define TUNSETDEBUG 0x400454c9ul
Expand Down Expand Up @@ -1324,7 +1338,6 @@
#define VIDIOC_STREAMOFF 0x40045613ul
#define VDUSE_DESTROY_DEV 0x41008103ul
#define FDGETFDCSTAT 0x80200215ul
#define CM_IOCGATR 0xc0046301ul
#define VIDIOC_S_PRIORITY 0x40045644ul
#define SNAPSHOT_FREEZE 0x3301ul
#define VIDIOC_ENUMINPUT 0xc04c561aul
Expand Down
5 changes: 4 additions & 1 deletion gen/ioctl/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,12 @@ 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,
# As LoongArch and CSKY cross toolchain is not yet packaged in mainstream distros yet,
# pre-generated output is used for the time being
cat loongarch-ioctls.txt >> "$out"
# csky-linux-gnuabiv2-gcc -Iinclude -I../linux/usr/include/ -c list.c $cflags
# csky-linux-gnuabiv2-gcc main.c list.o -o main.exe $cflags
# qemu-csky -L /usr/csky-linux-gnuabiv2 ./main.exe >> "$out"
cat csky-ioctls.txt >> "$out"

# Add any extra custom definitions at the end.
Expand Down
19 changes: 16 additions & 3 deletions gen/modules/ioctl.h
Original file line number Diff line number Diff line change
Expand Up @@ -17207,6 +17207,22 @@
#define BLKSECDISCARD 0x127dul
#define BLKROTATIONAL 0x127eul
#define BLKZEROOUT 0x127ful
#define FIEMAP_MAX_OFFSET 0xfffffffful
#define FIEMAP_FLAG_SYNC 0x1ul
#define FIEMAP_FLAG_XATTR 0x2ul
#define FIEMAP_FLAG_CACHE 0x4ul
#define FIEMAP_FLAGS_COMPAT 0x3ul
#define FIEMAP_EXTENT_LAST 0x1ul
#define FIEMAP_EXTENT_UNKNOWN 0x2ul
#define FIEMAP_EXTENT_DELALLOC 0x4ul
#define FIEMAP_EXTENT_ENCODED 0x8ul
#define FIEMAP_EXTENT_DATA_ENCRYPTED 0x80ul
#define FIEMAP_EXTENT_NOT_ALIGNED 0x100ul
#define FIEMAP_EXTENT_DATA_INLINE 0x200ul
#define FIEMAP_EXTENT_DATA_TAIL 0x400ul
#define FIEMAP_EXTENT_UNWRITTEN 0x800ul
#define FIEMAP_EXTENT_MERGED 0x1000ul
#define FIEMAP_EXTENT_SHARED 0x2000ul
#define UFFDIO_REGISTER 0xc020aa00ul
#define UFFDIO_UNREGISTER 0x8010aa01ul
#define UFFDIO_WAKE 0x8010aa02ul
Expand Down Expand Up @@ -18017,7 +18033,6 @@
#define VIDIOC_G_DV_TIMINGS 0xc0845658ul
#define TUNSETIFINDEX 0x400454daul
#define CCISS_SETINTINFO 0x40084203ul
#define CM_IOSDBGLVL 0x400463faul
#define RTC_VL_CLR 0x7014ul
#define VIDIOC_REQBUFS 0xc0145608ul
#define USBDEVFS_REAPURBNDELAY32 0x4004550dul
Expand Down Expand Up @@ -18147,7 +18162,6 @@
#define VFIO_SET_IOMMU 0x3b66ul
#define VIDIOC_S_MODULATOR 0x40445637ul
#define TUNGETFILTER 0x800854dbul
#define MEYEIOC_SYNC 0xc00476c3ul
#define CCISS_SETNODENAME 0x40104205ul
#define FBIO_GETCONTROL2 0x80044689ul
#define TUNSETDEBUG 0x400454c9ul
Expand Down Expand Up @@ -18428,7 +18442,6 @@
#define VIDIOC_STREAMOFF 0x40045613ul
#define VDUSE_DESTROY_DEV 0x41008103ul
#define FDGETFDCSTAT 0x80200215ul
#define CM_IOCGATR 0xc0046301ul
#define VIDIOC_S_PRIORITY 0x40045644ul
#define SNAPSHOT_FREEZE 0x3301ul
#define VIDIOC_ENUMINPUT 0xc04c561aul
Expand Down
19 changes: 16 additions & 3 deletions src/csky/ioctl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,22 @@ pub const BLKDISCARDZEROES: u32 = 4732;
pub const BLKSECDISCARD: u32 = 4733;
pub const BLKROTATIONAL: u32 = 4734;
pub const BLKZEROOUT: u32 = 4735;
pub const FIEMAP_MAX_OFFSET: u32 = 4294967295;
pub const FIEMAP_FLAG_SYNC: u32 = 1;
pub const FIEMAP_FLAG_XATTR: u32 = 2;
pub const FIEMAP_FLAG_CACHE: u32 = 4;
pub const FIEMAP_FLAGS_COMPAT: u32 = 3;
pub const FIEMAP_EXTENT_LAST: u32 = 1;
pub const FIEMAP_EXTENT_UNKNOWN: u32 = 2;
pub const FIEMAP_EXTENT_DELALLOC: u32 = 4;
pub const FIEMAP_EXTENT_ENCODED: u32 = 8;
pub const FIEMAP_EXTENT_DATA_ENCRYPTED: u32 = 128;
pub const FIEMAP_EXTENT_NOT_ALIGNED: u32 = 256;
pub const FIEMAP_EXTENT_DATA_INLINE: u32 = 512;
pub const FIEMAP_EXTENT_DATA_TAIL: u32 = 1024;
pub const FIEMAP_EXTENT_UNWRITTEN: u32 = 2048;
pub const FIEMAP_EXTENT_MERGED: u32 = 4096;
pub const FIEMAP_EXTENT_SHARED: u32 = 8192;
pub const UFFDIO_REGISTER: u32 = 3223366144;
pub const UFFDIO_UNREGISTER: u32 = 2148575745;
pub const UFFDIO_WAKE: u32 = 2148575746;
Expand Down Expand Up @@ -914,7 +930,6 @@ pub const IOC_OPAL_SAVE: u32 = 1092120796;
pub const VIDIOC_G_DV_TIMINGS: u32 = 3229898328;
pub const TUNSETIFINDEX: u32 = 1074025690;
pub const CCISS_SETINTINFO: u32 = 1074283011;
pub const CM_IOSDBGLVL: u32 = 1074029562;
pub const RTC_VL_CLR: u32 = 28692;
pub const VIDIOC_REQBUFS: u32 = 3222558216;
pub const USBDEVFS_REAPURBNDELAY32: u32 = 1074025741;
Expand Down Expand Up @@ -1044,7 +1059,6 @@ pub const UI_SET_RELBIT: u32 = 1074025830;
pub const VFIO_SET_IOMMU: u32 = 15206;
pub const VIDIOC_S_MODULATOR: u32 = 1078220343;
pub const TUNGETFILTER: u32 = 2148029659;
pub const MEYEIOC_SYNC: u32 = 3221518019;
pub const CCISS_SETNODENAME: u32 = 1074807301;
pub const FBIO_GETCONTROL2: u32 = 2147763849;
pub const TUNSETDEBUG: u32 = 1074025673;
Expand Down Expand Up @@ -1325,7 +1339,6 @@ pub const PERF_EVENT_IOC_QUERY_BPF: u32 = 3221496842;
pub const VIDIOC_STREAMOFF: u32 = 1074026003;
pub const VDUSE_DESTROY_DEV: u32 = 1090552067;
pub const FDGETFDCSTAT: u32 = 2149581333;
pub const CM_IOCGATR: u32 = 3221512961;
pub const VIDIOC_S_PRIORITY: u32 = 1074026052;
pub const SNAPSHOT_FREEZE: u32 = 13057;
pub const VIDIOC_ENUMINPUT: u32 = 3226228250;
Expand Down

0 comments on commit 36f889b

Please sign in to comment.