summaryrefslogtreecommitdiff
path: root/lib9p/idl/2010-9P2000.L.9p
diff options
context:
space:
mode:
Diffstat (limited to 'lib9p/idl/2010-9P2000.L.9p')
-rw-r--r--lib9p/idl/2010-9P2000.L.9p186
1 files changed, 92 insertions, 94 deletions
diff --git a/lib9p/idl/2010-9P2000.L.9p b/lib9p/idl/2010-9P2000.L.9p
index 7ac86a6..d81a15b 100644
--- a/lib9p/idl/2010-9P2000.L.9p
+++ b/lib9p/idl/2010-9P2000.L.9p
@@ -39,49 +39,48 @@ num super_magic = 4
# protocol.h (and are different than the Linux kernel's values, which
# vary by architecture).
bitfield lo = 4
- "0=subfield(mode)" # low bit of the 2-bit RDONLY/WRONLY/RDWR/NOACCESS enum
- "1=subfield(mode)" # high bit of the 2-bit RDONLY/WRONLY/RDWR/NOACCESS enum
- #"2=unused"
- #"3=unused"
- #"4=unused"
- #"5=unused"
- "6=CREATE"
- "7=EXCL"
- "8=NOCTTY"
- "9=TRUNC"
- "10=APPEND"
- "11=NONBLOCK"
- "12=DSYNC"
- "13=BSD_FASYNC"
- "14=DIRECT"
- "15=LARGEFILE"
- "16=DIRECTORY"
- "17=NOFOLLOW"
- "18=NOATIME"
- "19=CLOEXEC"
- "20=SYNC"
-
- "RDONLY = 0"
- "WRONLY = 1"
- "RDWR = 2"
- "NOACCESS = 3"
-
- "MODE_MASK = 0b000000000000000000011"
- "FLAG_MASK = 0b111111111111111000000"
+ "bit 0=num(MODE)" # low bit of the 2-bit RDONLY/WRONLY/RDWR/NOACCESS enum
+ "bit 1=num(MODE)" # high bit of the 2-bit RDONLY/WRONLY/RDWR/NOACCESS enum
+ #"bit 2=unused"
+ #"bit 3=unused"
+ #"bit 4=unused"
+ #"bit 5=unused"
+ "bit 6=CREATE"
+ "bit 7=EXCL"
+ "bit 8=NOCTTY"
+ "bit 9=TRUNC"
+ "bit 10=APPEND"
+ "bit 11=NONBLOCK"
+ "bit 12=DSYNC"
+ "bit 13=BSD_FASYNC"
+ "bit 14=DIRECT"
+ "bit 15=LARGEFILE"
+ "bit 16=DIRECTORY"
+ "bit 17=NOFOLLOW"
+ "bit 18=NOATIME"
+ "bit 19=CLOEXEC"
+ "bit 20=SYNC"
+
+ "num(MODE) RDONLY = 0"
+ "num(MODE) WRONLY = 1"
+ "num(MODE) RDWR = 2"
+ "num(MODE) NOACCESS = 3"
+
+ "mask FLAG = 0b111111111111111000000"
# "D"irentry "T"ype
#
# These match the Linux kernel's values.
num dt = 1
- "UNKNOWN = 0"
- "NAMED_PIPE = 1"
- "CHAR_DEV = 2"
- "DIRECTORY = 4"
- "BLOCK_DEV = 6"
- "REGULAR = 8"
- "SYMLINK = 10"
- "SOCKET = 12"
- "WHITEOUT = 14"
+ "UNKNOWN = 0"
+ "PIPE = 1"
+ "CHAR_DEV = 2"
+ "DIRECTORY = 4"
+ "BLOCK_DEV = 6" # proof it's not a bitfield
+ "REGULAR = 8"
+ "SYMLINK = 10" # proof it's not a bitfield
+ "SOCKET = 12" # proof it's not a bitfield
+ "_WHITEOUT = 14" # proof it's not a bitfield
# Mode
#
@@ -89,34 +88,33 @@ num dt = 1
# instead of just 16? Who knows?
bitfield mode = 4
#...
- "15=subfield(fmt)" # bit of the 4-bit FMT_ enum
- "14=subfield(fmt)" # bit of the 4-bit FMT_ enum
- "13=subfield(fmt)" # bit of the 4-bit FMT_ enum
- "12=subfield(fmt)" # bit of the 4-bit FMT_ enum
+ "bit 15=num(FMT)" # bit of the 4-bit FMT_ enum
+ "bit 14=num(FMT)" # bit of the 4-bit FMT_ enum
+ "bit 13=num(FMT)" # bit of the 4-bit FMT_ enum
+ "bit 12=num(FMT)" # bit of the 4-bit FMT_ enum
#...
- "11=PERM_SETGROUP"
- "10=PERM_SETUSER"
- "9=PERM_STICKY"
- "8=PERM_OWNER_R"
- "7=PERM_OWNER_W"
- "6=PERM_OWNER_X"
- "5=PERM_GROUP_R"
- "4=PERM_GROUP_W"
- "3=PERM_GROUP_X"
- "2=PERM_OTHER_R"
- "1=PERM_OTHER_W"
- "0=PERM_OTHER_X"
-
- "FMT_NAMED_PIPE = LIB9P_DT_NAMED_PIPE<<12"
- "FMT_CHAR_DEV = LIB9P_DT_CHAR_DEV<<12"
- "FMT_DIRECTORY = LIB9P_DT_DIRECTORY<<12"
- "FMT_BLOCK_DEV = LIB9P_DT_BLOCK_DEV<<12"
- "FMT_REGULAR = LIB9P_DT_REGULAR<<12"
- "FMT_SYMLINK = LIB9P_DT_SYMLINK<<12"
- "FMT_SOCKET = LIB9P_DT_SOCKET<<12"
-
- "PERM_MASK = 0000777" # PERM_*
- "FMT_MASK = 0170000" # _fmt_*
+ "bit 11=PERM_SETGROUP"
+ "bit 10=PERM_SETUSER"
+ "bit 9=PERM_STICKY"
+ "bit 8=PERM_OWNER_R"
+ "bit 7=PERM_OWNER_W"
+ "bit 6=PERM_OWNER_X"
+ "bit 5=PERM_GROUP_R"
+ "bit 4=PERM_GROUP_W"
+ "bit 3=PERM_GROUP_X"
+ "bit 2=PERM_OTHER_R"
+ "bit 1=PERM_OTHER_W"
+ "bit 0=PERM_OTHER_X"
+
+ "num(FMT) PIPE = dt.PIPE<<12"
+ "num(FMT) CHAR_DEV = dt.CHAR_DEV<<12"
+ "num(FMT) DIRECTORY = dt.DIRECTORY<<12"
+ "num(FMT) BLOCK_DEV = dt.BLOCK_DEV<<12"
+ "num(FMT) REGULAR = dt.REGULAR<<12"
+ "num(FMT) SYMLINK = dt.SYMLINK<<12"
+ "num(FMT) SOCKET = dt.SOCKET<<12"
+
+ "mask PERM = 07777" # PERM_*
# A boolean value that is for some reason 4 bytes wide.
num b4 = 4
@@ -125,35 +123,35 @@ num b4 = 4
# all other values are true also
bitfield getattr = 8
- "0=MODE"
- "1=NLINK"
- "2=UID"
- "3=GID"
- "4=RDEV"
- "5=ATIME"
- "6=MTIME"
- "7=CTIME"
- "8=INO"
- "9=SIZE"
- "10=BLOCKS"
-
- "11=BTIME"
- "12=GEN"
- "13=DATA_VERSION"
-
- "BASIC=0x000007ff" # Mask for fields up to BLOCKS
- "ALL =0x00003fff" # Mask for All fields above
+ "bit 0=MODE"
+ "bit 1=NLINK"
+ "bit 2=UID"
+ "bit 3=GID"
+ "bit 4=RDEV"
+ "bit 5=ATIME"
+ "bit 6=MTIME"
+ "bit 7=CTIME"
+ "bit 8=INO"
+ "bit 9=SIZE"
+ "bit 10=BLOCKS"
+
+ "bit 11=BTIME"
+ "bit 12=GEN"
+ "bit 13=DATA_VERSION"
+
+ "alias BASIC=0x000007ff" # Mask for fields up to BLOCKS
+ "alias ALL =0x00003fff" # Mask for All fields above
bitfield setattr = 4
- "0=MODE"
- "1=UID"
- "2=GID"
- "3=SIZE"
- "4=ATIME"
- "5=MTIME"
- "6=CTIME"
- "7=ATIME_SET"
- "8=MTIME_SET"
+ "bit 0=MODE"
+ "bit 1=UID"
+ "bit 2=GID"
+ "bit 3=SIZE"
+ "bit 4=ATIME"
+ "bit 5=MTIME"
+ "bit 6=CTIME"
+ "bit 7=ATIME_SET"
+ "bit 8=MTIME_SET"
num lock_type = 1
"RDLCK=0"
@@ -161,8 +159,8 @@ num lock_type = 1
"UNLCK=2"
bitfield lock_flags = 4
- "0=BLOCK"
- "1=RECLAIM"
+ "bit 0=BLOCK"
+ "bit 1=RECLAIM"
num lock_status = 1
"SUCCESS=0"