aboutsummaryrefslogtreecommitdiff
path: root/src/syslua/lx/sysdef.lua
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2017-04-19 15:34:04 +0200
committerAlex Auvolat <alex@adnab.me>2017-04-19 15:34:04 +0200
commite53a39d9ec28b24ea0d408f1500e987d005cd651 (patch)
tree639c93f2a17aabee7759cd16645b4d7da693ae4c /src/syslua/lx/sysdef.lua
parentd4a89538d381bb62b4c7c864b09d3d8274cf0bdb (diff)
downloadkogata-e53a39d9ec28b24ea0d408f1500e987d005cd651.tar.gz
kogata-e53a39d9ec28b24ea0d408f1500e987d005cd651.zip
Lua shell :)
Diffstat (limited to 'src/syslua/lx/sysdef.lua')
-rw-r--r--src/syslua/lx/sysdef.lua36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/syslua/lx/sysdef.lua b/src/syslua/lx/sysdef.lua
new file mode 100644
index 0000000..7c0d14f
--- /dev/null
+++ b/src/syslua/lx/sysdef.lua
@@ -0,0 +1,36 @@
+-- Constant definitions based on common/include/proto/fs.h
+
+return {
+ -- FILE TYPES
+ FT_REGULAR = 0,
+ FT_DIR = 0x01,
+ FT_DEV = 0x02,
+ FT_BLOCKDEV = 0x04,
+ FT_CHARDEV = 0x08,
+ FT_CHANNEL = 0x10,
+ FT_FRAMEBUFFER = 0x20,
+
+ -- FILE MODES
+ FM_READ = 0x01,
+ FM_WRITE = 0x02,
+ FM_READDIR = 0x04,
+ FM_MMAP = 0x08,
+ FM_CREATE = 0x10,
+ FM_TRUNC = 0x20,
+ FM_APPEND = 0x40,
+ FM_IOCTL = 0x100,
+ FM_BLOCKING = 0x200,
+ FM_DCREATE = 0x1000,
+ FM_DMOVE = 0x2000,
+ FM_DDELETE = 0x4000,
+ FM_ALL_MODES = 0xFFFF,
+
+ -- IOCTL calls
+ IOCTL_BLOCKDEV_GET_BLOCK_SIZE = 40,
+ IOCTL_BLOCKDEV_GET_BLOCK_COUNT = 41,
+
+ -- Modes for select call
+ SEL_READ = 0x01,
+ SEL_WRITE = 0x02,
+ SEL_ERROR = 0x04,
+}