Module: Vigilem::Evdev::System::IOCTL
Overview
consider the possibility of switching to RubyInline?
-
RubyInline (and ZenTest) gave significant problems installing “invalid gem: package metadata is missing” updating to the newest rubygems and clearing the gem from the cache worked A C/C++ compiler (the same one that compiled your ruby interpreter) irb keeps throwing Errno::ENOENT: No such file or directory - /…home dir…/(irb) from /…/.rvm/gems/ruby-1.9.3-p545/gems/RubyInline-3.12.3/lib/inline.rb:532:in ‘mtime’
-
move this note to it’s own file
Class Method Summary collapse
-
.kernel_versions ⇒ Array<Integer>
versions which are compatible with this file.
Instance Method Summary collapse
-
#_IO(type, nr) ⇒ Integer
an ioctl with no parameters.
- #_IOC(dir, type, nr, size) ⇒ Object
- #_IOC_DIR(nr) ⇒ Integer
-
#_IOC_DIRBITS ⇒ Integer
2.
- #_IOC_DIRMASK ⇒ Integer
- #_IOC_DIRSHIFT ⇒ Integer
-
#_IOC_NONE ⇒ Integer
no data transfer.
- #_IOC_NR(nr) ⇒ Integer
-
#_IOC_NRBITS ⇒ Integer
8.
- #_IOC_NRMASK ⇒ Integer
- #_IOC_NRSHIFT ⇒ Integer
-
#_IOC_READ ⇒ Integer
2.
- #_IOC_SIZE(nr) ⇒ Integer
-
#_IOC_SIZEBITS ⇒ Integer
14.
- #_IOC_SIZEMASK ⇒ Integer
- #_IOC_SIZESHIFT ⇒ Integer
- #_IOC_TYPE(nr) ⇒ Integer
-
#_IOC_TYPEBITS ⇒ Integer
8.
- #_IOC_TYPEMASK ⇒ Integer
- #_IOC_TYPESHIFT ⇒ Integer
-
#_IOC_WRITE ⇒ Integer
1.
-
#_IOR(type, nr, fmt_or_size) ⇒ Object
for reading data (copy_to_user).
-
#_IOW(type, nr, fmt_or_size) ⇒ Object
for writing data (copy_from_user).
-
#_IOWR(type, nr, fmt_or_size) ⇒ Object
for bidirectional transfers.
- #_size_of(numeric_or_format) ⇒ Fixnum
- #IOC_IN ⇒ Object
- #IOC_INOUT ⇒ Object
- #IOC_OUT ⇒ Object
- #IOCSIZE_MASK ⇒ Integer
- #IOCSIZE_SHIFT ⇒ Integer
Class Method Details
.kernel_versions ⇒ Array<Integer>
versions which are compatible with this file
23 24 25 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 23 def self.kernel_versions %w(3.7 3.8 3.9 3.10 3.11 3.12 3.13 3.14 3.15 3.16) end |
Instance Method Details
#_IO(type, nr) ⇒ Integer
an ioctl with no parameters
94 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 94 def _IO(type,nr); return _IOC(_IOC_NONE,type.ord,nr,0); end |
#_IOC(dir, type, nr, size) ⇒ Object
84 85 86 87 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 84 def _IOC(dir, type, nr, size) (System.native_signed_long(dir << _IOC_DIRSHIFT) | (type.ord << _IOC_TYPESHIFT) | (nr << _IOC_NRSHIFT) | (size << _IOC_SIZESHIFT)) end |
#_IOC_DIR(nr) ⇒ Integer
114 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 114 def _IOC_DIR(nr); return (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK); end |
#_IOC_DIRBITS ⇒ Integer
Returns 2.
34 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 34 def _IOC_DIRBITS; 2; end |
#_IOC_DIRMASK ⇒ Integer
42 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 42 def _IOC_DIRMASK; ((1 << _IOC_DIRBITS)-1); end |
#_IOC_DIRSHIFT ⇒ Integer
50 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 50 def _IOC_DIRSHIFT; (_IOC_SIZESHIFT+_IOC_SIZEBITS); end |
#_IOC_NONE ⇒ Integer
no data transfer
71 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 71 def _IOC_NONE; 0; end |
#_IOC_NR(nr) ⇒ Integer
120 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 120 def _IOC_NR(nr); return (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK); end |
#_IOC_NRBITS ⇒ Integer
Returns 8.
28 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 28 def _IOC_NRBITS; 8; end |
#_IOC_NRMASK ⇒ Integer
36 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 36 def _IOC_NRMASK; ((1 << _IOC_NRBITS)-1); end |
#_IOC_NRSHIFT ⇒ Integer
44 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 44 def _IOC_NRSHIFT; 0; end |
#_IOC_READ ⇒ Integer
Returns 2.
75 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 75 def _IOC_READ; 2; end |
#_IOC_SIZE(nr) ⇒ Integer
123 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 123 def _IOC_SIZE(nr); return (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK); end |
#_IOC_SIZEBITS ⇒ Integer
Returns 14.
32 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 32 def _IOC_SIZEBITS; 14; end |
#_IOC_SIZEMASK ⇒ Integer
40 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 40 def _IOC_SIZEMASK; ((1 << _IOC_SIZEBITS)-1); end |
#_IOC_SIZESHIFT ⇒ Integer
48 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 48 def _IOC_SIZESHIFT; (_IOC_TYPESHIFT+_IOC_TYPEBITS); end |
#_IOC_TYPE(nr) ⇒ Integer
117 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 117 def _IOC_TYPE(nr); return (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK); end |
#_IOC_TYPEBITS ⇒ Integer
Returns 8.
30 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 30 def _IOC_TYPEBITS; 8; end |
#_IOC_TYPEMASK ⇒ Integer
38 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 38 def _IOC_TYPEMASK; ((1 << _IOC_TYPEBITS)-1); end |
#_IOC_TYPESHIFT ⇒ Integer
46 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 46 def _IOC_TYPESHIFT; (_IOC_NRSHIFT+_IOC_NRBITS); end |
#_IOC_WRITE ⇒ Integer
Returns 1.
73 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 73 def _IOC_WRITE; 1; end |
#_IOR(type, nr, fmt_or_size) ⇒ Object
for reading data (copy_to_user)
97 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 97 def _IOR(type,nr,fmt_or_size); return _IOC(_IOC_READ,type.ord,nr,_size_of(fmt_or_size)); end |
#_IOW(type, nr, fmt_or_size) ⇒ Object
for writing data (copy_from_user)
100 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 100 def _IOW(type,nr,fmt_or_size); return _IOC(_IOC_WRITE,(type.ord),(nr),_size_of(fmt_or_size)); end |
#_IOWR(type, nr, fmt_or_size) ⇒ Object
for bidirectional transfers
103 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 103 def _IOWR(type,nr,fmt_or_size); return _IOC(_IOC_READ|_IOC_WRITE,(type.ord),(nr),_size_of(fmt_or_size)); end |
#_size_of(numeric_or_format) ⇒ Fixnum
128 129 130 131 132 133 134 135 136 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 128 def _size_of(numeric_or_format) if numeric_or_format.is_a? String sizeof(numeric_or_format) elsif numeric_or_format.is_a? Numeric numeric_or_format else numeric_or_format.respond_to? :size numeric_or_format.size end end |
#IOC_IN ⇒ Object
52 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 52 def IOC_IN; (_IOC_WRITE << _IOC_DIRSHIFT); end |
#IOC_INOUT ⇒ Object
56 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 56 def IOC_INOUT; ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT); end |
#IOC_OUT ⇒ Object
54 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 54 def IOC_OUT; (_IOC_READ << _IOC_DIRSHIFT); end |
#IOCSIZE_MASK ⇒ Integer
63 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 63 def IOCSIZE_MASK; (_IOC_SIZEMASK << _IOC_SIZESHIFT); end |
#IOCSIZE_SHIFT ⇒ Integer
65 |
# File 'lib/vigilem/evdev/system/ioctl.rb', line 65 def IOCSIZE_SHIFT; (_IOC_SIZESHIFT); end |