Module: Mach

Extended by:
Types
Included in:
ProcessShared::Mach
Defined in:
lib/mach.rb,
lib/mach/host.rb,
lib/mach/port.rb,
lib/mach/task.rb,
lib/mach/clock.rb,
lib/mach/error.rb,
lib/mach/types.rb,
lib/mach/functions.rb,
lib/mach/semaphore.rb,
lib/mach/time_spec.rb

Defined Under Namespace

Modules: Functions, Types Classes: Clock, Error, Host, MsgBase, MsgBody, MsgHeader, MsgPortDescriptor, MsgTrailer, Port, Semaphore, Task, TimeSpec

Constant Summary collapse

SyncPolicy =
enum( :fifo, 0x0,
:fixed_priority, 0x1,
:reversed, 0x2,
:order_mask, 0x3,
:lifo, 0x0 | 0x2, # um...
:max, 0x7 )
PortRight =
enum( :send, 0,
:receive,
:send_once,
:port_set,
:dead_name,
:labelh,
:number )
PORT_NULL =
0
MSG_TIMEOUT_NONE =
0
PortType =
enum(:none, 0,
:send, pt(:send),
:receive, pt(:receive),
:send_once, pt(:send_once),
:port_set, pt(:port_set),
:dead_name, pt(:dead_name),
:labelh, pt(:labelh),

:send_receive, pt(:send, :receive),
:send_rights, pt(:send, :send_once),
:port_rights, pt(:send, :send_once, :receive),
:port_or_dead, pt(:send, :send_once, :receive, :dead_name),
:all_rights, pt(:send, :send_once, :receive, :dead_name, :port_set))
MsgType =
enum( :move_receive, 16, # must hold receive rights
:move_send,        # must hold send rights
:move_send_once,   # must hold sendonce rights
:copy_send,        # must hold send rights
:make_send,        # must hold receive rights
:make_send_once,   # must hold receive rights
:copy_receive )
SpecialPort =
enum( :kernel, 1,
:host,
:name,
:bootstrap )
KERN_SUCCESS =
0

Class Method Summary collapse

Methods included from Types

enum, find_type, typedefs

Class Method Details

.bootstrap_portPort

affected by get,set_special_port

Returns:

  • (Port)

    the original bootstrap port; different from that



101
102
103
# File 'lib/mach.rb', line 101

def self.bootstrap_port
  @bootstrap_port ||= Mach::Port.new(:port => Mach::Functions::bootstrap_port)
end

.pt(*syms) ⇒ Object

port type macro



55
56
57
58
59
60
61
# File 'lib/mach.rb', line 55

def self.pt(*syms)
  acc = 0
  syms.each do |sym|
    acc |= (1 << (PortRight[sym] + 16))
  end
  acc
end