Index: contrib/arch/HelenOS.adl
===================================================================
--- contrib/arch/HelenOS.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/HelenOS.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,9 @@
+system architecture HelenOS version 0.4.1 {
+	/* SPARTAN kernel */
+	inst kernel kernel;
+	
+	/* Naming Service */
+	inst ns ns;
+	
+	[/uspace/lib/libc/bind.kernel%ns]
+};
Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/hadlbppp.py	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,170 @@
+#!/usr/bin/env python
+#
+# Copyright (c) 2009 Martin Decky
+# All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# - Redistributions of source code must retain the above copyright
+#   notice, this list of conditions and the following disclaimer.
+# - Redistributions in binary form must reproduce the above copyright
+#   notice, this list of conditions and the following disclaimer in the
+#   documentation and/or other materials provided with the distribution.
+# - The name of the author may not be used to endorse or promote products
+#   derived from this software without specific prior written permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+"""
+HelenOS Architecture Description Language and Behavior Protocols preprocessor
+"""
+
+import sys
+import os
+
+def usage(prname):
+	"Print usage syntax"
+	print prname + " <OUTPUT>"
+
+def tabs(cnt):
+	"Return given number of tabs"
+	
+	return ("\t" * cnt)
+
+def cond_append(tokens, token, trim):
+	"Conditionally append token to tokens with trim"
+	
+	if (trim):
+		token = token.strip(" \t")
+		if (token != ""):
+			tokens.append(token)
+	else:
+		tokens.append(token)
+	
+	return tokens
+
+def split_tokens(string, delimiters, trim = False):
+	"Split string to tokens by delimiters, keep the delimiters"
+	
+	tokens = []
+	last = 0
+	i = 0
+	
+	while (i < len(string)):
+		for delim in delimiters:
+			if (len(delim) > 0):
+				
+				if ((string[i:(i + len(delim))] == delim) and (i > 0)):
+					tokens = cond_append(tokens, string[last:i], trim)
+					last = i
+					i += len(delim) - 1
+					break
+		
+		i += 1
+	
+	tokens = cond_append(tokens, string[last:len(string)], trim)
+	
+	return tokens
+
+def parse(fname, outf):
+	"Parse particular protocol"
+	
+	inf = file(fname, "r")
+	outf.write("### %s\n\n" % fname)
+	
+	tokens = split_tokens(inf.read(), ["\n", " ", "\t", "(", ")", "{", "}", "[", "/*", "*/", "#", "*", ";", "+", "||", "|", "!", "?"], True)
+	
+	empty = True
+	comment = False
+	lcomment = False
+	indent = 0
+	
+	for token in tokens:
+		if (comment):
+			if (token == "*/"):
+				comment = False
+			continue
+		
+		if ((not comment) and (token == "/*")):
+			comment = True
+			continue
+		
+		if (lcomment):
+			if (token == "\n"):
+				lcomment = False
+			continue
+		
+		if ((not lcomment) and (token == "#")):
+			lcomment = True
+			continue
+		
+		if (token == "\n"):
+			continue
+		
+		if (empty):
+			empty = False
+		
+		if ((token == ";") or (token == "+") or (token == "||") or (token == "|")):
+			outf.write(" %s\n" % token)
+		elif (token == "("):
+			outf.write("%s%s\n" % (tabs(indent), token))
+			indent += 1
+		elif (token == ")"):
+			indent -= 1
+			outf.write("\n%s%s" % (tabs(indent), token))
+		elif (token == "{"):
+			outf.write(" %s\n" % token)
+			indent += 1
+		elif (token == "}"):
+			indent -= 1
+			outf.write("\n%s%s" % (tabs(indent), token))
+		elif (token == "*"):
+			outf.write("%s" % token)
+		else:
+			outf.write("%s%s" % (tabs(indent), token))
+	
+	if (empty):
+		outf.write("NULL")
+	
+	outf.write("\n\n\n")
+	inf.close()
+
+def recursion(root, output, level):
+	"Recursive directory walk"
+	
+	for name in os.listdir(root):
+		canon = os.path.join(root, name)
+		
+		if ((os.path.isfile(canon)) and (level > 0)):
+			fcomp = split_tokens(canon, ["."])
+			if (fcomp[-1] == ".bp"):
+				parse(canon, outf)
+		
+		if (os.path.isdir(canon)):
+			recursion(canon, outf, level + 1)
+
+def main():
+	if (len(sys.argv) < 2):
+		usage(sys.argv[0])
+		return
+	
+	path = os.path.abspath(sys.argv[1])
+	if (not os.path.isdir(path)):
+		print "<OUTPUT> is not a directory"
+		return
+	
+	recursion(".", path, 0)
+	
+if __name__ == '__main__':
+	main()
Index: contrib/arch/kernel/kernel.adl
===================================================================
--- contrib/arch/kernel/kernel.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/kernel/kernel.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,270 @@
+/*****************************
+ * Kernel syscall interfaces *
+ *****************************/
+
+interface kernel_klog {
+		/* Print using kernel facility */
+		unative_t sys_klog(int fd, const void *buf, size_t size);
+	protocol:
+		sys_klog*
+};
+
+interface kernel_console {
+		/* Enable kernel console */
+		uintptr_t sys_debug_enable_console(void);
+		
+		/* Disable kernel console */
+		uintptr_t sys_debug_disable_console(void);
+	protocol:
+		(sys_debug_enable_console + sys_debug_disable_console)*
+};
+
+interface kernel_tls {
+		/* Set thread-local storage pointer (on architectures where kernel mode is required) */
+		unative_t sys_tls_set(unative_t addr);
+	protocol:
+		sys_tls_set*
+};
+
+interface kernel_thread {
+		/* Create new thread */
+		unative_t sys_thread_create(uspace_arg_t *uspace_uarg, char *uspace_name, size_t name_len, thread_id_t *uspace_thread_id);
+		
+		/* Terminate current thread */
+		unative_t sys_thread_exit(int uspace_status);
+		
+		/* Get current thread id */
+		unative_t sys_thread_get_id(thread_id_t *uspace_thread_id);
+	protocol:
+		(sys_thread_create + sys_thread_get_id)* ; sys_thread_exit
+};
+
+interface kernel_task {
+		/* Set name fo the current task */
+		unative_t sys_task_set_name(const char *uspace_name, size_t name_len);
+		
+		/* Get current task id */
+		unative_t sys_task_get_id(task_id_t *uspace_task_id);
+	protocol:
+		(sys_task_set_name + sys_task_get_id)*
+};
+
+interface kernel_program {
+		/* Spawn a new instance of clonable loader service */
+		unative_t sys_program_spawn_loader(char *uspace_name, size_t name_len);
+	protocol:
+		sys_program_spawn_loader*
+};
+
+interface kernel_futex {
+		/* Sleep in a futex wait queue */
+		unative_t sys_futex_sleep_timeout(uintptr_t uaddr, uint32_t usec, int flags);
+		
+		/* Wakeup one thread waiting in futex wait queue */
+		unative_t sys_futex_wakeup(uintptr_t uaddr);
+	protocol:
+		(sys_futex_sleep_timeout + sys_futex_wakeup)*
+};
+
+interface kernel_smc {
+		/* Enforce self-modifying code cache coherency */
+		unative_t sys_smc_coherence(uintptr_t va, size_t size);
+	protocol:
+		sys_smc_coherence*
+};
+
+interface kernel_as {
+		/* Create new address space area */
+		unative_t sys_as_area_create(uintptr_t address, size_t size, int flags);
+		
+		/* Resize an address space area */
+		unative_t sys_as_area_resize(uinptr_t address, size_t size, int flags);
+		
+		/* Change flags of an address space area */
+		unative_t sys_as_area_change_flags(uintptr_t address, int flags);
+		
+		/* Destroy an address space area */
+		unative_t sys_as_area_destroy(uintptr_t address);
+	protocol:
+		(sys_as_area_create + sys_as_area_resize + sys_as_area_change_flags + sys_as_area_destroy)*
+};
+
+interface kernel_ipc {
+		/* Fast synchronous IPC call */
+		unative_t sys_ipc_call_sync_fast(unative_t phoneid, unative_t method, unative_t arg1, unative_t arg2, unative_t arg3, ipc_data_t *data);
+		
+		/* Slow synchronous IPC call */
+		unative_t sys_ipc_call_sync_slow(unative_t phoneid, ipc_data_t *question, ipc_data_t *answer);
+		
+		/* Fast asynchronous IPC call */
+		unative_t sys_ipc_call_async_fast(unative_t phoneid, unative_t method, unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4);
+		
+		/* Slow asynchronous IPC call */
+		unative_t sys_ipc_call_async_slow(unative_t phoneid, ipc_data_t *data);
+		
+		/* Fast forward a received IPC call to another destination */
+		unative_t sys_ipc_forward_fast(unative_t callid, unative_t phoneid, unative_t method, unative_t arg1, unative_t arg2, int mode);
+		
+		/* Slow forward a received IPC call to another destination */
+		unative_t sys_ipc_forward_slow(unative_t callid, unative_t phoneid, ipc_data_t *data, int mode);
+		
+		/* Fast answer an IPC call */
+		unative_t sys_ipc_answer_fast(unative_t callid, unative_t retval, unative_t arg1, unative_t arg2, unative_t arg3, unative_t arg4);
+		
+		/* Slow answer an IPC call */
+		unative_t sys_ipc_answer_slow(unative_t callid, ipc_data_t *data);
+		
+		/* Hang up a phone */
+		unative_t sys_ipc_hangup(int phoneid);
+		
+		/* Wait for an incoming IPC call or answer */
+		unative_t sys_ipc_wait_for_call(ipc_data_t *calldata, uint32_t usec, int flags);
+		
+		/* Interrupt one thread of the current task from waiting on IPC call */
+		unative_t sys_ipc_poke(void);
+	protocol:
+		(sys_ipc_call_sync_fast + sys_ipc_call_sync_slow + sys_ipc_call_async_fast + sys_ipc_call_async_slow + sys_ipc_forward_fast + sys_ipc_forward_slow + sys_ipc_answer_fast + sys_ipc_answer_slow + sys_ipc_hangup + sys_ipc_wait_for_call + sys_ipc_poke)*
+};
+
+interface kernel_event {
+		/* Subscribe to kernel event notifications */
+		unative_t sys_event_subscribe(unative_t evno, unative_t method);
+	protocol:
+		sys_event_subscribe*
+};
+
+interface kernel_cap {
+		/* Grant capabilities to a task */
+		unative_t sys_cap_grant(sysarg64_t *uspace_taskid_arg, cap_t caps);
+		
+		/* Revoke capabilities from a task */
+		unative_t sys_cap_revoke(sysarg64_t *uspace_taskid_arg, cap_t caps);
+	protocol:
+		(sys_cap_grant + sys_cap_rewoke)*
+};
+
+interface kernel_ddi {
+		/* Enable access I/O address space for the current task */
+		unative_t sys_enable_iospace(ddi_ioarg_t *uspace_io_arg);
+		
+		/* Map physical memory to the current task's address space */
+		unative_t sys_physmem_map(unative_t phys_base, unative_t virt_base, unative_t pages, unative_t flags);
+		
+		/* Enable or disable preemption */
+		unative_t sys_preempt_control(int enable);
+		
+		/* Assign unique device number */
+		unative_t sys_device_assign_devno(void);
+		
+		/* Connect an IRQ handler to the current task */
+		unative_t sys_ipc_register_irq(inr_t inr, devno_t devno, unative_t method, irq_code_t *ucode);
+		
+		/* Disconnect an IRQ handler from the current task */
+		unative_t sys_ipc_unregister_irq(inr_t inr, devno_t devno);
+	protocol:
+		(sys_enable_iospace + sys_physmem_map + sys_device_assign_devno + sys_preempt_control + sys_ipc_register_irq + sys_ipc_unregister_irq)*
+};
+
+interface kernel_sysinfo {
+		/* Check for sysinfo key validity */
+		unative_t sys_sysinfo_valid(unative_t ptr, unative_t len);
+		
+		/* Get sysinfo key value */
+		unative_t sys_sysinfo_value(unatice_t ptr, unative_t len);
+	protocol:
+		(sys_sysinfo_valid + sys_sysinfo_value)*
+};
+
+interface kernel_debug {
+		/* Connect to the kernel debugging answerbox of a given task */
+		unative_t sys_ipc_connect_kbox(sysarg64_t *uspace_taskid_arg);
+	protocol:
+		sys_ipc_connect_kbox*
+};
+
+
+/*****************************************************
+ * Primitive kernel components (exported subsystems) *
+ *****************************************************/
+
+frame kernel_console {
+	provides:
+		kernel_klog kernel_klog;
+		kernel_console kernel_console;
+};
+
+frame kernel_proc {
+	provides:
+		kernel_tls kernel_tls;
+		kernel_thread kernel_thread;
+		kernel_task kernel_task;
+		kernel_program kernel_program;
+};
+
+frame kernel_synch {
+	provides:
+		kernel_futex kernel_futex;
+		kernel_smc kernel_smc;
+};
+
+frame kernel_mm {
+	provides:
+		kernel_as kernel_as;
+};
+
+frame kernel_ipc {
+	provides:
+		kernel_ipc kernel_ipc;
+		kernel_event kernel_event;
+};
+
+frame kernel_security {
+	provides:
+		kernel_cap kernel_cap;
+};
+
+frame kernel_ddi {
+	provides:
+		kernel_ddi kernel_ddi;
+};
+
+frame kernel_sysinfo {
+	provides:
+		kernel_sysinfo kernel_sysinfo;
+};
+
+frame kernel_debug {
+	provides:
+		kernel_debug kernel_debug;
+};
+
+
+/******************************
+ * Composite kernel component *
+ ******************************/
+
+architecture kernel {
+	inst kernel_console kernel_console;
+	inst kernel_proc kernel_proc;
+	inst kernel_synch kernel_synch;
+	inst kernel_mm kernel_mm;
+	inst kernel_ipc kernel_ipc;
+	inst kernel_security kernel_security;
+	inst kernel_ddi kernel_ddi;
+	inst kernel_sysinfo kernel_sysinfo;
+	inst kernel_debug kernel_debug;
+	
+	delegate kernel_klog to kernel_console:kernel_klog;
+	delegate kernel_console to kernel_console:kernel_console;
+	delegate kernel_tls to kernel_proc:kernel_tls;
+	delegate kernel_thread to kernel_proc:kernel_thread;
+	delegate kernel_task to kernel_proc:kernel_task;
+	delegate kernel_program to kernel_proc:kernel_program;
+	delegate kernel_as to kernel_mm:kernel_as;
+	delegate kernel_ipc to kernel_ipc:kernel_sys;
+	delegate kernel_event to kernel_ipc:kernel_event;
+	delegate kernel_cap to kernel_security:kernel_cap;
+	delegate kernel_ddi to kernel_ddi:kernel_ddi;
+	delegate kernel_sysinfo to kernel_sysinfo:kernel_sysinfo;
+	delegate kernel_debug to kernel_debug:kernel_debug;
+};
Index: contrib/arch/uspace/app/klog/klog.bp
===================================================================
--- contrib/arch/uspace/app/klog/klog.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/app/klog/klog.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!ns.IPC_M_SHARE_IN /* SERVICE_MEM_KLOG */
Index: contrib/arch/uspace/lib/libc/bind.kernel
===================================================================
--- contrib/arch/uspace/lib/libc/bind.kernel	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/bind.kernel	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,14 @@
+/* Bindings to kernel interfaces */
+bind %%:kernel_klog to kernel:kernel_klog;
+bind %%:kernel_console to kernel:kernel_console;
+bind %%:kernel_tls to kernel:kernel_tls;
+bind %%:kernel_thread to kernel:kernel_thread;
+bind %%:kernel_task to kernel:kernel_task;
+bind %%:kernel_program to kernel:kernel_program;
+bind %%:kernel_as to kernel:kernel_as;
+bind %%:kernel_ipc to kernel:kernel_sys;
+bind %%:kernel_event to kernel:kernel_event;
+bind %%:kernel_cap to kernel:kernel_cap;
+bind %%:kernel_ddi to kernel:kernel_ddi;
+bind %%:kernel_sysinfo to kernel:kernel_sysinfo;
+bind %%:kernel_debug to kernel:kernel_debug;
Index: contrib/arch/uspace/lib/libc/devmap_device_connect
===================================================================
--- contrib/arch/uspace/lib/libc/devmap_device_connect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/devmap_device_connect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+[devmap_get_phone] ;
+!dev.IPC_M_CONNECT_ME_TO
Index: contrib/arch/uspace/lib/libc/devmap_device_get_count
===================================================================
--- contrib/arch/uspace/lib/libc/devmap_device_get_count	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/devmap_device_get_count	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+[devmap_get_phone] ;
+!devmap.DEVMAP_DEVICE_GET_COUNT
Index: contrib/arch/uspace/lib/libc/devmap_device_get_devices
===================================================================
--- contrib/arch/uspace/lib/libc/devmap_device_get_devices	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/devmap_device_get_devices	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,3 @@
+[devmap_get_phone] ;
+!devmap.DEVMAP_DEVICE_GET_DEVICES ;
+!devmap.IPC_M_DATA_READ
Index: contrib/arch/uspace/lib/libc/devmap_device_get_handle
===================================================================
--- contrib/arch/uspace/lib/libc/devmap_device_get_handle	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/devmap_device_get_handle	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,3 @@
+[devmap_get_phone] ;
+!devmap.DEVMAP_DEVICE_GET_HANDLE ;
+!devmap.IPC_M_DATA_WRITE /* name */
Index: contrib/arch/uspace/lib/libc/devmap_get_phone
===================================================================
--- contrib/arch/uspace/lib/libc/devmap_get_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/devmap_get_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+!ns.IPC_M_CONNECT_ME_TO /* devmap */ +
+NULL
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_connect
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_connect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_connect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+[devmap_get_phone] ;
+!dev.IPC_M_CONNECT_ME_TO
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+[devmap_get_phone] ;
+!devmap.DEVMAP_DEVICE_GET_COUNT
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,3 @@
+[devmap_get_phone] ;
+!devmap.DEVMAP_DEVICE_GET_DEVICES ;
+!devmap.IPC_M_DATA_READ
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,3 @@
+[devmap_get_phone] ;
+!devmap.DEVMAP_DEVICE_GET_HANDLE ;
+!devmap.IPC_M_DATA_WRITE /* name */
Index: contrib/arch/uspace/lib/libc/fnc.devmap_get_phone
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_get_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_get_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+!ns.IPC_M_CONNECT_ME_TO /* devmap */ +
+NULL
Index: contrib/arch/uspace/lib/libc/protocol
===================================================================
--- contrib/arch/uspace/lib/libc/protocol	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/protocol	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+/* Protocol by which libc uses uspace services */
Index: contrib/arch/uspace/lib/libc/protocol.kernel
===================================================================
--- contrib/arch/uspace/lib/libc/protocol.kernel	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/protocol.kernel	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+/* Protocol according to which libc uses kernel syscalls */
Index: contrib/arch/uspace/lib/libc/requires.iface
===================================================================
--- contrib/arch/uspace/lib/libc/requires.iface	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/requires.iface	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+/* Interfaces required by libc */
+naming_service ns;
Index: contrib/arch/uspace/lib/libc/requires.iface.kernel
===================================================================
--- contrib/arch/uspace/lib/libc/requires.iface.kernel	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libc/requires.iface.kernel	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,14 @@
+/* Kernel interfaces required by libc */
+kernel_klog kernel_klog;
+kernel_console kernel_console;
+kernel_tls kernel_tls;
+kernel_thread kernel_thread;
+kernel_task kernel_task;
+kernel_program kernel_program;
+kernel_as kernel_as;
+kernel_ipc kernel_sys;
+kernel_event kernel_event;
+kernel_cap kernel_cap;
+kernel_ddi kernel_ddi;
+kernel_sysinfo kernel_sysinfo;
+kernel_debug kernel_debug;
Index: contrib/arch/uspace/lib/libfs/fs_register
===================================================================
--- contrib/arch/uspace/lib/libfs/fs_register	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libfs/fs_register	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,4 @@
+!vfs.VFS_IN_REGISTER ;
+!vfs.IPC_M_DATA_WRITE /* vfs_into_t */ ;
+!vfs.IPC_M_CONNECT_TO_ME ;
+!vfs.IPC_M_SHARE_IN
Index: contrib/arch/uspace/lib/libfs/libfs_lookup
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_lookup	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libfs/libfs_lookup	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fs.VFS_OUT_LOOKUP*
Index: contrib/arch/uspace/lib/libfs/libfs_mount
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_mount	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libfs/libfs_mount	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,6 @@
+?fs.IPC_M_CONNECTION_CLONE ;
+?fs.IPC_M_DATA_WRITE /* mount options */ {
+	!fs.IPC_M_CONNECT_ME ;
+	!fs.VFS_OUT_MOUNTED ;
+	!fs.IPC_M_DATA_WRITE /* forwarded */
+}
Index: contrib/arch/uspace/lib/libfs/libfs_stat
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_stat	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/lib/libfs/libfs_stat	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+?fs.IPC_M_DATA_READ
Index: contrib/arch/uspace/srv/bd/block_device.adl
===================================================================
--- contrib/arch/uspace/srv/bd/block_device.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/bd/block_device.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,21 @@
+interface block_device extends service {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Share out data buffer */
+		ipcarg_t ipc_m_share_out(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t flags, out ipcarg_t dst_as_area_base);
+		
+		/* Get block size */
+		ipcarg_t get_block_size(out ipcarg_t block_size);
+		
+		/* Read blocks via shared data buffer */
+		ipcarg_t read_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
+		
+		/* Write blocks via shared data buffer */
+		ipcarg_t write_blocks(in ipcarg_t index_lower, in ipcarg_t index_upper, in ipcarg_t count);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[block_device.bp]
+};
Index: contrib/arch/uspace/srv/bd/block_device.bp
===================================================================
--- contrib/arch/uspace/srv/bd/block_device.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/bd/block_device.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,8 @@
+?ipc_m_connect_me_to ;
+?ipc_m_share_out ;
+(
+	?get_block_size +
+	?read_blocks +
+	?write_blocks
+)* ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/bd/rd/rd.adl
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/bd/rd/rd.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,9 @@
+frame rd {
+	provides:
+		block_device bd;
+	requires:
+		[/lib/libc/iface.requires]
+		device_mapper_driver dm_driver;
+	protocol:
+		[rd.bp]
+};
Index: contrib/arch/uspace/srv/bd/rd/rd.bp
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/bd/rd/rd.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,2 @@
+[/lib/libc/devmap_driver_register] ;
+[/lib/libc/devmap_device_register]
Index: contrib/arch/uspace/srv/console/cell_mark_changed
===================================================================
--- contrib/arch/uspace/srv/console/cell_mark_changed	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/cell_mark_changed	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,4 @@
+(
+	[fb_pending_flush] +
+	NULL
+)
Index: contrib/arch/uspace/srv/console/clear
===================================================================
--- contrib/arch/uspace/srv/console/clear	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/clear	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_CLEAR
Index: contrib/arch/uspace/srv/console/cons_read
===================================================================
--- contrib/arch/uspace/srv/console/cons_read	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/cons_read	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+?console.IPC_M_DATA_READ
Index: contrib/arch/uspace/srv/console/cons_write
===================================================================
--- contrib/arch/uspace/srv/console/cons_write	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/cons_write	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,3 @@
+?console.IPC_M_DATA_WRITE ;
+[write_char]* ;
+[gcons_notify_char]
Index: contrib/arch/uspace/srv/console/console.bp
===================================================================
--- contrib/arch/uspace/srv/console/console.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/console.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,101 @@
+!ns.IPC_CONNECT_ME_TO /* kbd */ ;
+!kbd.IPC_CONNECT_TO_ME ;
+!ns.IPC_CONNECT_ME_TO /* fb */ ;
+[devmap_driver_register] ;
+!fb.FB_GET_RESOLUTION ;
+(
+	[vp_create] +
+	[vp_switch]
+)* ;
+[make_pixmap]* ;
+[make_anim] ;
+[vp_switch] ;
+!fb.FB_FLUSH ;
+!fb.FB_GET_CSIZE ;
+!fb.FB_GET_COLOR_CAP ;
+!fb.IPC_M_SHARE_OUT ;
+[devmap_device_register]* ;
+[gcons_redraw_console] ;
+[set_rgb_color] ;
+[screen_clear] ;
+[curs_goto] ;
+[curs_visibility] ;
+(
+	?console.IPC_M_CONNECT_ME_TO ;
+	[gcons_notify_connect] ;
+	(
+		?console.VFS_OUT_READ {
+			[cons_read]
+		} +
+		
+		?console.VFS_OUT_WRITE {
+			[cons_write]
+		} +
+		
+		?console.VFS_OUT_SYNC {
+			[fb_pending_flush] ;
+			(
+				(
+					!fb.FB_FLUSH ;
+					[curs_goto]
+				) +
+				NULL
+			) ;
+		} +
+		
+		?console.CONSOLE_CLEAR {
+			!fb.FB_FLUSH +
+			NULL
+		} +
+		
+		?console.CONSOLE_GOTO {
+			!fb.CURS_GOTO +
+			NULL
+		} +
+		
+		?console.CONSOLE_GET_SIZE +
+		
+		?console.CONSOLE_GET_COLOR_CAP +
+		
+		?console.CONSOLE_SET_STYLE {
+			[fb_pending_flush] ;
+			(
+				[set_style] +
+				NULL
+			)
+		} +
+		
+		?console.CONSOLE_SET_COLOR {
+			[fb_pending_flush] ;
+			(
+				[set_color] +
+				NULL
+			)
+		} +
+		
+		?console.CONSOLE_SET_RGB_COLOR {
+			[fb_pending_flush] ;
+			(
+				[set_rgb_color] +
+				NULL
+			)
+		} +
+		
+		?console.CONSOLE_CURSOR_VISIBILITY {
+			[fb_pending_flush] ;
+			(
+				[curs_visibility] +
+				NULL
+			)
+		} +
+		
+		?console.CONSOLE_GET_EVENT +
+		
+		?console.CONSOLE_KCON_ENABLE
+		
+	)* ;
+	
+	?console.IPC_M_PHONE_HUNGUP {
+		[gcons_notify_disconnect]
+	}
+)*
Index: contrib/arch/uspace/srv/console/curs_goto
===================================================================
--- contrib/arch/uspace/srv/console/curs_goto	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/curs_goto	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_CURSOR_GOTO
Index: contrib/arch/uspace/srv/console/curs_visibility
===================================================================
--- contrib/arch/uspace/srv/console/curs_visibility	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/curs_visibility	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_CURSOR_VISIBILITY
Index: contrib/arch/uspace/srv/console/draw_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/draw_pixmap	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/draw_pixmap	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,4 @@
+!fb.FB_PREPARE_SHM ;
+!fb.IPC_M_SHARE_OUT ;
+!fb.FB_DRAW_PPM ;
+!fb.FB_DROP_SHM
Index: contrib/arch/uspace/srv/console/fb_pending_flush
===================================================================
--- contrib/arch/uspace/srv/console/fb_pending_flush	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/fb_pending_flush	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_DRAW_TEXT_DATA
Index: contrib/arch/uspace/srv/console/gcons_notify_connect
===================================================================
--- contrib/arch/uspace/srv/console/gcons_notify_connect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/gcons_notify_connect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,5 @@
+(
+	[redraw_state] ;
+	[vp_switch]
+) +
+NULL
Index: contrib/arch/uspace/srv/console/gcons_notify_disconnect
===================================================================
--- contrib/arch/uspace/srv/console/gcons_notify_disconnect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/gcons_notify_disconnect	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,5 @@
+(
+	[redraw_state] ;
+	[vp_switch]
+) +
+NULL
Index: contrib/arch/uspace/srv/console/gcons_redraw_console
===================================================================
--- contrib/arch/uspace/srv/console/gcons_redraw_console	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/gcons_redraw_console	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,10 @@
+(
+	[vp_switch] ;
+	[set_rgb_color] ;
+	[clear] ;
+	[draw_pixmap] ;
+	[draw_pixmap] ;
+	[redraw_state]* ;
+	[vp_switch]
+) +
+NULL
Index: contrib/arch/uspace/srv/console/make_anim
===================================================================
--- contrib/arch/uspace/srv/console/make_anim	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/make_anim	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,4 @@
+!fb.FB_ANIM_CREATE ;
+[make_pixmap]* ;
+!fb.FB_ANIM_ADDPIXMAP ;
+!fb.FB_ANIM_START
Index: contrib/arch/uspace/srv/console/make_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/make_pixmap	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/make_pixmap	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,4 @@
+!fb.FB_PREPARE_SHM ;
+!fb.IPC_M_SHARE_OUT ;
+!fb.FB_SHM2PIXMAP ;
+!fb.FB_DROP_SHM
Index: contrib/arch/uspace/srv/console/redraw_state
===================================================================
--- contrib/arch/uspace/srv/console/redraw_state	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/redraw_state	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,11 @@
+[vp_switch] ;
+(
+	!fb.FB_VP_DRAW_PIXMAP +
+	NULL
+) ;
+(
+	(
+		!fb.FB_PUTCHAR*
+	) +
+	NULL
+)
Index: contrib/arch/uspace/srv/console/screen_clear
===================================================================
--- contrib/arch/uspace/srv/console/screen_clear	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/screen_clear	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_CLEAR
Index: contrib/arch/uspace/srv/console/set_color
===================================================================
--- contrib/arch/uspace/srv/console/set_color	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/set_color	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_SET_COLOR
Index: contrib/arch/uspace/srv/console/set_rgb_color
===================================================================
--- contrib/arch/uspace/srv/console/set_rgb_color	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/set_rgb_color	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_SET_RGB_COLOR
Index: contrib/arch/uspace/srv/console/set_style
===================================================================
--- contrib/arch/uspace/srv/console/set_style	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/set_style	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_SET_STYLE
Index: contrib/arch/uspace/srv/console/vp_create
===================================================================
--- contrib/arch/uspace/srv/console/vp_create	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/vp_create	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_VIEWPORT_CREATE
Index: contrib/arch/uspace/srv/console/vp_switch
===================================================================
--- contrib/arch/uspace/srv/console/vp_switch	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/vp_switch	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fb.FB_VIEWPORT_SWITCH
Index: contrib/arch/uspace/srv/console/write_char
===================================================================
--- contrib/arch/uspace/srv/console/write_char	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/console/write_char	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,18 @@
+(
+	[fb_pending_flush] +
+	[cell_mark_changed]
+) ;
+(
+	(
+		[fb_pending_flush] ;
+		(
+			!fb.FB_SCROLL +
+			NULL
+		)
+	) +
+	NULL
+) ;
+(
+	[curs_goto] +
+	NULL
+)
Index: contrib/arch/uspace/srv/devmap/device_mapper_client.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/device_mapper_client.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/devmap/device_mapper_client.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,21 @@
+?ipc_m_connect_me_to ;
+
+!service.ipc_m_connect_me_to /* forward */
++
+(
+	(
+		?device_get_handle {
+			?ipc_m_data_write /* device name */
+		} +
+		
+		?device_get_name +
+		?device_null_create +
+		?device_null_destroy +
+		?device_get_count +
+		
+		?device_get_devices {
+			?ipc_m_data_read /* buffer */
+		}
+	)*
+) ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/devmap/device_mapper_driver.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/device_mapper_driver.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/devmap/device_mapper_driver.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,22 @@
+?ipc_m_connect_me_to ;
+?driver_register {
+	tentative {
+		?ipc_m_data_write /* driver name */
+	}
+} ;
+(
+	?device_register {
+		tentative {
+			?ipc_m_data_write /* device name */
+		}
+	} +
+	
+	?device_get_handle {
+		?ipc_m_data_write /* device name */
+	} +
+	
+	?device_get_name +
+	?device_unregister +
+	?driver_unregister
+)* ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/devmap/devmap.adl
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/devmap/devmap.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,75 @@
+interface device_mapper_driver {
+		/* Establish connection (iface is DEVMAP_DRIVER) */
+		ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface);
+		
+		/* Register as a new driver */
+		ipcarg_t driver_register(void);
+		
+		/* Unregister all devices and the driver itself */
+		ipcarg_t driver_unregister(void);
+		
+		/* Register new device and return handle */
+		ipcarg_t device_register(out ipcarg_t handle);
+		
+		/* Unregister device */
+		ipcarg_t device_unregister(in ipcarg_t handle);
+		
+		/* Resolve device name to handle */
+		ipcarg_t device_get_handle(in ipcarg_t flags);
+		
+		/* Get device name for a given handle */
+		ipcarg_t device_get_name(in ipcarg_t handle);
+		
+		/* Transfer driver or device name */
+		ipcarg_t ipc_m_data_write(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[device_mapper_driver.bp]
+};
+
+interface device_mapper_client {
+		/* Establish connection (iface is DEVMAP_CLIENT) or forward to device (iface is DEVMAP_CONNECT_TO_DEVICE) */
+		ipcarg_t ipc_m_connect_me_to(in ipcarg_t iface, in ipcarg_t handle);
+		
+		/* Resolve device name to handle */
+		ipcarg_t device_get_handle(in ipcarg_t flags);
+		
+		/* Get device name for a given handle */
+		ipcarg_t device_get_name(in ipcarg_t handle);
+		
+		/* Clone NULL device */
+		ipcarg_t device_null_create(out ipcarg_t index);
+		
+		/* Destroy NULL device */
+		ipcarg_t device_null_destroy(in ipcarg_t index);
+		
+		/* Get number of devices */
+		ipcarg_t device_get_count(out ipcarg_t count);
+		
+		/* Get an array of (device_name, handle) pairs */
+		ipcarg_t device_get_devices(void)
+		
+		/* Transfer device name from client */
+		ipcarg_t ipc_m_data_write(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
+		
+		/* Transfer (device_name, handle) pairs to client */
+		ipcarg_t ipc_m_data_read(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[device_mapper_client.bp]
+	
+};
+
+frame devmap {
+	provides:
+		device_mapper_driver dm_driver;
+		device_mapper_client dm_client;
+	requires:
+		[/lib/libc/iface.requires]
+	protocol:
+		[devmap.bp]
+};
Index: contrib/arch/uspace/srv/devmap/devmap.bp
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/devmap/devmap.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!ns.ipc_m_connect_to_me
Index: contrib/arch/uspace/srv/fb/fb.bp
===================================================================
--- contrib/arch/uspace/srv/fb/fb.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/fb/fb.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,74 @@
+!ns.IPC_M_CONNECT_TO_ME ;
+(
+	?fb.IPC_M_CONNECT_ME_TO ;
+	(
+		?fb.IPC_M_SHARE_OUT +
+		
+		(
+			?fb.FB_PREPARE_SHM ;
+			?fb.IPC_M_AS_AREA_SEND ;
+			?fb.FB_DRAW_PPM ;
+			?fb.FB_DROP_SHM
+		) +
+		
+		(
+			?fb.IPC_M_AS_AREA_SEND ;
+			?fb.FB_DRAW_TEXT_DATA
+		) +
+		
+		?fb.FB_SHM2PIXMAP +
+		
+		?fb.FB_VP_DRAW_PIXMAP +
+		
+		?fb.FB_VP2PIXMAP +
+		
+		?fb.FB_DROP_PIXMAP +
+		
+		?fb.FB_ANIM_CREATE +
+		
+		?fb.FB_ANIM_DROP +
+		
+		?fb.FB_ANIM_ADDPIXMAP +
+		
+		?fb.FB_ANIM_CHGVP +
+		
+		?fb.FB_ANIM_START +
+		
+		?fb.FB_ANIM_STOP +
+		
+		?fb.FB_PUTCHAR +
+		
+		?fb.FB_CLEAR +
+		
+		?fb.FB_CURSOR_GOTO +
+		
+		?fb.FB_CURSOR_VISIBILITY +
+		
+		?fb.FB_GET_CSIZE +
+		
+		?fb.FB_GET_COLOR_CAP +
+		
+		?fb.FB_SCROLL +
+		
+		?fb.FB_VIEWPORT_SWITCH +
+		
+		?fb.FB_VIEWPORT_CREATE +
+		
+		?fb.FB_VIEWPORT_DELETE +
+		
+		?fb.FB_SET_STYLE +
+		
+		?fb.FB_SET_COLOR +
+		
+		?fb.FB_SET_RGB_COLOR +
+		
+		?fb.FB_GET_RESOLUTION +
+		
+		?fb.FB_POINTER_MOVE +
+		
+		?fb.FB_SCREEN_YIELD +
+		
+		?fb.FB_SCREEN_RECLAIM
+	)* ;
+	?fb.IPC_M_PHONE_HUNGUP
+)*
Index: contrib/arch/uspace/srv/fs/devfs/devfs.bp
===================================================================
--- contrib/arch/uspace/srv/fs/devfs/devfs.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/fs/devfs/devfs.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,66 @@
+[../../../lib/libc/devmap_get_phone] ;
+!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
+[../../../lib/libfs/fs_register] ;
+(
+	?fs.IPC_M_CONNECT_ME_TO ;
+	(
+		?fs.VFS_OUT_MOUNTED {
+			?fs.IPC_M_DATA_WRITE /* mount options */
+		} +
+		
+		?fs.VFS_OUT_MOUNT +
+		
+		?fs.VFS_OUT_LOOKUP {
+			(
+				[../../../lib/libc/devmap_device_get_handle] ;
+				[../../../lib/libc/devmap_device_connect]
+			) +
+			NULL
+		} +
+		
+		?fs.VFS_OUT_READ {
+			?fs.IPC_M_DATA_READ /* payload */ {
+				(
+					!dev.VFS_OUT_READ ;
+					!dev.IPC_M_DATA_READ /* forwarded */
+				) +
+				(
+					[../../../lib/libc/devmap_device_get_count] ;
+					[../../../lib/libc/devmap_device_get_devices]
+				)
+			}
+		} +
+		
+		?fs.VFS_OUT_WRITE {
+			?fs.IPC_M_DATA_WRITE /* payload */ {
+				(
+					!dev.VFS_OUT_WRITE ;
+					!dev.IPC_M_DATA_WRITE /* forwarded */
+				)
+			} +
+			NULL
+		} +
+		
+		?fs.VFS_OUT_TRUNCATE +
+		
+		?fs.VFS_OUT_CLOSE {
+			!dev.IPC_M_PHONE_HUNGUP
+		} +
+		
+		?fs.VFS_OUT_DESTROY +
+		
+		?fs.VFS_OUT_OPEN_NODE {
+			[../../../lib/libc/devmap_device_connect] +
+			NULL
+		} +
+		
+		?fs.VFS_OUT_STAT {
+			?IPC_M_DATA_READ /* struct stat */
+		} +
+		
+		?fs.VFS_OUT_SYNC
+		
+	)* ;
+	?fs.IPC_M_PHONE_HUNGUP
+)* ;
+!vfs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/fs/fat/fat.bp
===================================================================
--- contrib/arch/uspace/srv/fs/fat/fat.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/fs/fat/fat.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,45 @@
+!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
+[../../../lib/libfs/fs_register] ;
+(
+	?fs.IPC_M_CONNECT_ME_TO ;
+	(
+		?fs.VFS_OUT_MOUNTED {
+			?fs.IPC_M_DATA_WRITE /* mount options */
+		} +
+		
+		?fs.VFS_OUT_MOUNT {
+			[../../../lib/libfs/libfs_mount]
+		} +
+		
+		?fs.VFS_OUT_LOOKUP {
+			[../../../lib/libfs/libfs_lookup]
+		} +
+		
+		?fs.VFS_OUT_READ {
+			?fs.IPC_M_DATA_READ /* payload */
+		} +
+		
+		?fs.VFS_OUT_WRITE {
+			?fs.IPC_M_DATA_WRITE /* payload */
+		} +
+		
+		?fs.VFS_OUT_TRUNCATE +
+		
+		?fs.VFS_OUT_CLOSE +
+		
+		?fs.VFS_OUT_DESTROY +
+		
+		?fs.VFS_OUT_OPEN_NODE {
+			[../../../lib/libfs/libfs_open_node]
+		} +
+		
+		?fs.VFS_OUT_STAT {
+			[../../../lib/libfs/libfs_stat]
+		} +
+		
+		?fs.VFS_OUT_SYNC
+		
+	)* ;
+	?fs.IPC_M_PHONE_HUNGUP
+)* ;
+!vfs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp
===================================================================
--- contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,45 @@
+!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
+[../../../lib/libfs/fs_register] ;
+(
+	?fs.IPC_M_CONNECT_ME_TO ;
+	(
+		?fs.VFS_OUT_MOUNTED {
+			?fs.IPC_M_DATA_WRITE /* mount options */
+		} +
+		
+		?fs.VFS_OUT_MOUNT {
+			[../../../lib/libfs/libfs_mount]
+		} +
+		
+		?fs.VFS_OUT_LOOKUP {
+			[../../../lib/libfs/libfs_lookup]
+		} +
+		
+		?fs.VFS_OUT_READ {
+			?fs.IPC_M_DATA_READ /* payload */
+		} +
+		
+		?fs.VFS_OUT_WRITE {
+			?fs.IPC_M_DATA_WRITE /* payload */
+		} +
+		
+		?fs.VFS_OUT_TRUNCATE +
+		
+		?fs.VFS_OUT_CLOSE +
+		
+		?fs.VFS_OUT_DESTROY +
+		
+		?fs.VFS_OUT_OPEN_NODE {
+			[../../../lib/libfs/libfs_open_node]
+		} +
+		
+		?fs.VFS_OUT_STAT {
+			[../../../lib/libfs/libfs_stat]
+		} +
+		
+		?fs.VFS_OUT_SYNC
+		
+	)* ;
+	?fs.IPC_M_PHONE_HUNGUP
+)* ;
+!vfs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/kbd/kbd.bp
===================================================================
--- contrib/arch/uspace/srv/kbd/kbd.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/kbd/kbd.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,20 @@
+(
+	!ns.IPC_M_CONNECT_ME_TO /* cir */ +
+	NULL
+) ;
+!ns.IPC_M_CONNECT_TO_ME ;
+(
+	?kbd.IPC_M_CONNECT_ME_TO ;
+	(
+		(
+			?kbd.KBD_YIELD +
+			?kbd.KBD_RECLAIM +
+		) |
+		!console.KBD_EVENT
+	)* ;
+	?kbd.IPC_M_PHONE_HUNGUP
+)* ;
+(
+	!cir.IPC_M_PHONE_HUNGUP +
+	NULL
+)
Index: contrib/arch/uspace/srv/loader/loader.bp
===================================================================
--- contrib/arch/uspace/srv/loader/loader.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/loader/loader.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,25 @@
+!ns.NS_ID_INTRO ;
+!ns.IPC_M_CONNECT_TO_ME ;
+(
+	?loader.LOADER_GET_TASKID {
+		?loader.IPC_M_DATA_READ /* task id */
+	} +
+	
+	?loader.LOADER_SET_PATHNAME {
+		?loader.IPC_M_DATA_WRITE /* path */
+	} +
+	
+	?loader.LOADER_SET_ARGS {
+		?loader.IPC_M_DATA_WRITE /* arguments */
+	} +
+	
+	?loader.LOADER_SET_FILES {
+		?loader.IPC_M_DATA_WRITE /* files */
+	} +
+	
+	?loader.LOADER_LOAD
+)* ;
+(
+	?loader.LOADER_RUN +
+	?loader.IPC_M_PHONE_HUNGUP
+)
Index: contrib/arch/uspace/srv/ns/naming_service.bp
===================================================================
--- contrib/arch/uspace/srv/ns/naming_service.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/ns/naming_service.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,23 @@
+/* Every task has an implicit connection to the Naming Service,
+   thus there is no explicit ?ipc_m_connect_me_to */
+
+(
+	?ipc_m_connect_to_me {
+		tentative {
+			!loader.ipc_m_connect_to_me /* forward */
+		}
+	} +
+	
+	?ipc_m_connect_me_to {
+		tentative {
+			!service.ipc_m_connect_me_to /* forward */
+		}
+	} +
+	
+	?ipc_m_share_in +
+	?ping +
+	?task_wait +
+	?id_intro +
+	?retval
+)* ;
+?ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/ns/ns.adl
===================================================================
--- contrib/arch/uspace/srv/ns/ns.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/ns/ns.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,36 @@
+interface naming_service {
+		/* Register a clonable service or a generic service */
+		ipcarg_t ipc_m_connect_to_me(in ipcarg_t service);
+		
+		/* Connect to a clonable service or a generic service */
+		ipcarg_t ipc_m_connect_me_to(in ipcarg_t service, in ipcarg_t arg2, in ipcarg_t arg3, in ipcarg_t flags);
+		
+		/* Share real-time clock page or klog page */
+		ipcarg_t ipc_m_share_in(in ipcarg_t as_area_base, in ipcarg_t as_area_size, in ipcarg_t service);
+		
+		/* For IPC testing purposes */
+		ipcarg_t ping(void);
+		
+		/* Wait for task exit and get exit status and return value */
+		ipcarg_t task_wait(in ipcarg_t id_lower, in ipcarg_t id_upper, out ipcarg_t status, out ipcarg_t retval);
+		
+		/* Introduce a new loader task id in such a way it cannot be spoofed */
+		ipcarg_t id_intro(in ipcarg_t id_lower, in ipcarg_t id_upper);
+		
+		/* Set task return value */
+		ipcarg_t retval(in ipcarg_t retval);
+		
+		/* Implicit connection close */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[naming_service.bp]
+};
+
+frame ns {
+	provides:
+		naming_service ns;
+	requires:
+		[/uspace/lib/libc/requires.iface.kernel]
+	protocol:
+		[/uspace/lib/libc/protocol.kernel]
+};
Index: contrib/arch/uspace/srv/ns/service.adl
===================================================================
--- contrib/arch/uspace/srv/ns/service.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/ns/service.adl	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,5 @@
+interface service {
+		/* Establish connection with the service
+		   (this call is forwarded from Naming Service or Device Mapper) */
+		ipcarg_t ipc_m_connect_me_to(void);
+};
Index: contrib/arch/uspace/srv/pci/pci.bp
===================================================================
--- contrib/arch/uspace/srv/pci/pci.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/pci/pci.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,5 @@
+!ns.IPC_M_CONNECT_TO_ME ;
+(
+	?pci.IPC_M_CONNECT_ME_TO ;
+	?pci.IPC_M_PHONE_HUNGUP
+)*
Index: contrib/arch/uspace/srv/vfs/vfs.bp
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/vfs/vfs.bp	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,131 @@
+!ns.IPC_M_CONNECT_TO_ME ;
+(
+	?vfs.IPC_M_CONNECT_ME_TO ;
+	(
+		?vfs.VFS_IN_REGISTER {
+			?vfs.IPC_M_DATA_WRITE ;
+			?vfs.IPC_M_CONNECT_TO_ME ;
+			?vfs.IPC_M_SHARE_IN
+		} +
+		
+		?vfs.VFS_IN_MOUNT {
+			?vfs.IPC_M_DATA_WRITE /* mount point */ ;
+			?vfs.IPC_M_DATA_WRITE /* mount options */ ;
+			?vfs.IPC_M_DATA_WRITE /* fs name */ ;
+			?vfs.IPC_M_PING ;
+			(
+				
+				!fs.VFS_OUT_MOUNTED ;
+				!fs.IPC_M_DATA_WRITE /* mount options */
+			) /* root fs */ +
+			(
+				!fs.VFS_OUT_MOUNT ;
+				!fs.IPC_M_CONNECTION_CLONE ;
+				!fs.VFS_M_DATA_WRITE /* mount options */
+			) /* non-root fs */
+		} +
+		
+		?vfs.VFS_IN_OPEN {
+			?vfs.IPC_M_DATA_WRITE /* path */ ;
+			[vfs_lookup_internal] ;
+			(
+				(
+					[vfs_grab_phone] ;
+					!fs.VFS_OUT_TRUNCATE ;
+					[vfs_release_phone]
+				) +
+				NULL
+			)
+		} +
+		
+		?vfs.VFS_IN_OPEN_NODE {
+			[vfs_grab_phone] ;
+			!fs.VFS_OUT_OPEN_NODE ;
+			[vfs_release_phone] ;
+			(
+				(
+					[vfs_grab_phone] ;
+					!fs.VFS_OUT_TRUNCATE ;
+					[vfs_release_phone]
+				) +
+				NULL
+			)
+		} +
+		
+		?vfs.VFS_IN_CLOSE {
+			[vfs_grab_phone] ;
+			!fs.VFS_OUT_CLOSE ;
+			[vfs_release_phone]
+		} +
+		
+		?vfs.VFS_IN_READ {
+			?vfs.IPC_M_DATA_READ {
+				[vfs_grab_phone] ;
+				!fs.VFS_OUT_READ /* payload */ ;
+				!fs.IPC_M_DATA_READ /* forwarded */ ;
+				[vfs_release_phone]
+			}
+		} +
+		
+		?vfs.VFS_IN_WRITE {
+			?vfs.IPC_M_DATA_WRITE {
+				[vfs_grab_phone] ;
+				!fs.VFS_OUT_WRITE /* payload */ ;
+				!fs.IPC_M_DATA_WRITE /* forwarded */ ;
+				[vfs_release_phone]
+			}
+		} +
+		
+		?vfs.VFS_IN_SEEK +
+		
+		?vfs.VFS_IN_TRUNCATE {
+			[vfs_grab_phone] ;
+			!fs.VFS_OUT_TRUNCATE ;
+			[vfs_release_phone]
+		} +
+		
+		?vfs.VFS_IN_FSTAT {
+			?vfs.IPC_M_DATA_READ /* struct stat */ {
+				[vfs_grab_phone] ;
+				!fs.VFS_OUT_STAT ;
+				!fs.IPC_M_DATA_READ /* forwarded */ ;
+				[vfs_release_phone]
+			}
+		} +
+		
+		?vfs.VFS_IN_STAT {
+			?vfs.IPC_M_DATA_WRITE /* path */ ;
+			?vfs.IPC_M_DATA_READ /* struct stat */ {
+				[vfs_lookup_internal] ;
+				!fs.VFS_OUT_STAT ;
+				!fs.IPC_M_DATA_READ /* forwarded */
+			}
+		} +
+		
+		?vfs.VFS_IN_MKDIR {
+			?vfs.IPC_M_DATA_WRITE /* path */ ;
+			[vfs_lookup_internal]
+		} +
+		
+		?vfs.VFS_IN_UNLINK {
+			?vfs.IPC_M_DATA_WRITE /* path */ ;
+			[vfs_lookup_internal]
+		} +
+		
+		?vfs.VFS_IN_RENAME {
+			?vfs.IPC_M_DATA_WRITE /* old path */ ;
+			?vfs.IPC_M_DATE_WRITE /* new path */ ;
+			[vfs_lookup_internal] /* lookup old path */ ;
+			[vfs_lookup_internal] /* lookup parent of new path */ ;
+			[vfs_lookup_internal] /* destroy old link for the new path */ ;
+			[vfs_lookup_internal] /* create new link for the new path */ ;
+			[vfs_lookup_internal] /* destroy link for the old path */
+		} +
+		
+		?vfs.VFS_IN_SYNC {
+			!fs.VFS_OUT_SYNC
+		}
+		
+	)* ;
+	?vfs.IPC_M_PHONE_HUNGUP
+)*
Index: contrib/arch/uspace/srv/vfs/vfs_grab_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_grab_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/vfs/vfs_grab_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fs.IPC_M_CONNECT_ME_TO
Index: contrib/arch/uspace/srv/vfs/vfs_lookup_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_lookup_internal	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/vfs/vfs_lookup_internal	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,3 @@
+[vfs_grab_phone] ;
+!fs.VFS_OUT_LOOKUP ;
+[vfs_release_phone]
Index: contrib/arch/uspace/srv/vfs/vfs_release_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_release_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
+++ contrib/arch/uspace/srv/vfs/vfs_release_phone	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -0,0 +1,1 @@
+!fs.IPC_M_PHONE_HUNGUP
Index: ntrib/bp/app/klog/klog.bp
===================================================================
--- contrib/bp/app/klog/klog.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!ns.IPC_M_SHARE_IN /* SERVICE_MEM_KLOG */
Index: ntrib/bp/lib/libc/devmap_device_connect
===================================================================
--- contrib/bp/lib/libc/devmap_device_connect	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,2 +1,0 @@
-[devmap_get_phone] ;
-!dev.IPC_M_CONNECT_ME_TO
Index: ntrib/bp/lib/libc/devmap_device_get_count
===================================================================
--- contrib/bp/lib/libc/devmap_device_get_count	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,2 +1,0 @@
-[devmap_get_phone] ;
-!devmap.DEVMAP_DEVICE_GET_COUNT
Index: ntrib/bp/lib/libc/devmap_device_get_devices
===================================================================
--- contrib/bp/lib/libc/devmap_device_get_devices	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,3 +1,0 @@
-[devmap_get_phone] ;
-!devmap.DEVMAP_DEVICE_GET_DEVICES ;
-!devmap.IPC_M_DATA_READ
Index: ntrib/bp/lib/libc/devmap_device_get_handle
===================================================================
--- contrib/bp/lib/libc/devmap_device_get_handle	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,3 +1,0 @@
-[devmap_get_phone] ;
-!devmap.DEVMAP_DEVICE_GET_HANDLE ;
-!devmap.IPC_M_DATA_WRITE /* name */
Index: ntrib/bp/lib/libc/devmap_get_phone
===================================================================
--- contrib/bp/lib/libc/devmap_get_phone	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,2 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* devmap */ +
-NULL
Index: ntrib/bp/lib/libfs/fs_register
===================================================================
--- contrib/bp/lib/libfs/fs_register	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!vfs.VFS_IN_REGISTER ;
-!vfs.IPC_M_DATA_WRITE /* vfs_into_t */ ;
-!vfs.IPC_M_CONNECT_TO_ME ;
-!vfs.IPC_M_SHARE_IN
Index: ntrib/bp/lib/libfs/libfs_lookup
===================================================================
--- contrib/bp/lib/libfs/libfs_lookup	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.VFS_OUT_LOOKUP*
Index: ntrib/bp/lib/libfs/libfs_mount
===================================================================
--- contrib/bp/lib/libfs/libfs_mount	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,6 +1,0 @@
-?fs.IPC_M_CONNECTION_CLONE ;
-?fs.IPC_M_DATA_WRITE /* mount options */ {
-	!fs.IPC_M_CONNECT_ME ;
-	!fs.VFS_OUT_MOUNTED ;
-	!fs.IPC_M_DATA_WRITE /* forwarded */
-}
Index: ntrib/bp/lib/libfs/libfs_stat
===================================================================
--- contrib/bp/lib/libfs/libfs_stat	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?fs.IPC_M_DATA_READ
Index: ntrib/bp/preproc.py
===================================================================
--- contrib/bp/preproc.py	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,172 +1,0 @@
-#!/usr/bin/env python
-#
-# Copyright (c) 2009 Martin Decky
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# - Redistributions of source code must retain the above copyright
-#   notice, this list of conditions and the following disclaimer.
-# - Redistributions in binary form must reproduce the above copyright
-#   notice, this list of conditions and the following disclaimer in the
-#   documentation and/or other materials provided with the distribution.
-# - The name of the author may not be used to endorse or promote products
-#   derived from this software without specific prior written permission.
-#
-# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
-# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
-# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
-# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
-# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
-# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
-# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-#
-"""
-HelenOS Behavior Protocols preprocessor
-"""
-
-import sys
-import os
-
-def usage(prname):
-	"Print usage syntax"
-	print prname + " <OUTPUT>"
-
-def tabs(cnt):
-	"Return given number of tabs"
-	
-	return ("\t" * cnt)
-
-def cond_append(tokens, token, trim):
-	"Conditionally append token to tokens with trim"
-	
-	if (trim):
-		token = token.strip(" \t")
-		if (token != ""):
-			tokens.append(token)
-	else:
-		tokens.append(token)
-	
-	return tokens
-
-def split_tokens(string, delimiters, trim = False):
-	"Split string to tokens by delimiters, keep the delimiters"
-	
-	tokens = []
-	last = 0
-	i = 0
-	
-	while (i < len(string)):
-		for delim in delimiters:
-			if (len(delim) > 0):
-				
-				if ((string[i:(i + len(delim))] == delim) and (i > 0)):
-					tokens = cond_append(tokens, string[last:i], trim)
-					last = i
-					i += len(delim) - 1
-					break
-		
-		i += 1
-	
-	tokens = cond_append(tokens, string[last:len(string)], trim)
-	
-	return tokens
-
-def parse(fname, outf):
-	"Parse particular protocol"
-	
-	inf = file(fname, "r")
-	outf.write("### %s\n\n" % fname)
-	
-	tokens = split_tokens(inf.read(), ["\n", " ", "\t", "(", ")", "{", "}", "[", "/*", "*/", "#", "*", ";", "+", "||", "|", "!", "?"], True)
-	
-	empty = True
-	comment = False
-	lcomment = False
-	indent = 0
-	
-	for token in tokens:
-		if (comment):
-			if (token == "*/"):
-				comment = False
-			continue
-		
-		if ((not comment) and (token == "/*")):
-			comment = True
-			continue
-		
-		if (lcomment):
-			if (token == "\n"):
-				lcomment = False
-			continue
-		
-		if ((not lcomment) and (token == "#")):
-			lcomment = True
-			continue
-		
-		if (token == "\n"):
-			continue
-		
-		if (empty):
-			empty = False
-		
-		if ((token == ";") or (token == "+") or (token == "||") or (token == "|")):
-			outf.write(" %s\n" % token)
-		elif (token == "("):
-			outf.write("%s%s\n" % (tabs(indent), token))
-			indent += 1
-		elif (token == ")"):
-			indent -= 1
-			outf.write("\n%s%s" % (tabs(indent), token))
-		elif (token == "{"):
-			outf.write(" %s\n" % token)
-			indent += 1
-		elif (token == "}"):
-			indent -= 1
-			outf.write("\n%s%s" % (tabs(indent), token))
-		elif (token == "*"):
-			outf.write("%s" % token)
-		else:
-			outf.write("%s%s" % (tabs(indent), token))
-	
-	if (empty):
-		outf.write("NULL")
-	
-	outf.write("\n\n\n")
-	inf.close()
-
-def recursion(root, outf, level):
-	"Recursive directory walk"
-	
-	for name in os.listdir(root):
-		canon = os.path.join(root, name)
-		
-		if ((os.path.isfile(canon)) and (level > 0)):
-			fcomp = split_tokens(canon, ["."])
-			if (fcomp[-1] == ".bp"):
-				parse(canon, outf)
-		
-		if (os.path.isdir(canon)):
-			recursion(canon, outf, level + 1)
-
-def main():
-	if (len(sys.argv) < 2):
-		usage(sys.argv[0])
-		return
-	
-	path = os.path.abspath(sys.argv[1])
-	if (os.path.isdir(path)):
-		print "<OUTPUT> is an existing directory"
-		return
-	
-	outf = file(path, "w")
-	recursion(".", outf, 0)
-	outf.close()
-	
-if __name__ == '__main__':
-	main()
Index: ntrib/bp/srv/bd/rd/rd.bp
===================================================================
--- contrib/bp/srv/bd/rd/rd.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,11 +1,0 @@
-[devmap_driver_register] ;
-[devmap_device_register] ;
-(
-	?bd.IPC_M_CONNECT_ME_TO ;
-	?bd.IPC_SHARE_IN ;
-	(
-		?bd.BD_READ_BLOCK +
-		?bd.BD_WRITE_BLOCK
-	)* ;
-	?bd.IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/console/cell_mark_changed
===================================================================
--- contrib/bp/srv/console/cell_mark_changed	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,4 +1,0 @@
-(
-	[fb_pending_flush] +
-	NULL
-)
Index: ntrib/bp/srv/console/clear
===================================================================
--- contrib/bp/srv/console/clear	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CLEAR
Index: ntrib/bp/srv/console/cons_read
===================================================================
--- contrib/bp/srv/console/cons_read	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?console.IPC_M_DATA_READ
Index: ntrib/bp/srv/console/cons_write
===================================================================
--- contrib/bp/srv/console/cons_write	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,3 +1,0 @@
-?console.IPC_M_DATA_WRITE ;
-[write_char]* ;
-[gcons_notify_char]
Index: ntrib/bp/srv/console/console.bp
===================================================================
--- contrib/bp/srv/console/console.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,101 +1,0 @@
-!ns.IPC_CONNECT_ME_TO /* kbd */ ;
-!kbd.IPC_CONNECT_TO_ME ;
-!ns.IPC_CONNECT_ME_TO /* fb */ ;
-[devmap_driver_register] ;
-!fb.FB_GET_RESOLUTION ;
-(
-	[vp_create] +
-	[vp_switch]
-)* ;
-[make_pixmap]* ;
-[make_anim] ;
-[vp_switch] ;
-!fb.FB_FLUSH ;
-!fb.FB_GET_CSIZE ;
-!fb.FB_GET_COLOR_CAP ;
-!fb.IPC_M_SHARE_OUT ;
-[devmap_device_register]* ;
-[gcons_redraw_console] ;
-[set_rgb_color] ;
-[screen_clear] ;
-[curs_goto] ;
-[curs_visibility] ;
-(
-	?console.IPC_M_CONNECT_ME_TO ;
-	[gcons_notify_connect] ;
-	(
-		?console.VFS_OUT_READ {
-			[cons_read]
-		} +
-		
-		?console.VFS_OUT_WRITE {
-			[cons_write]
-		} +
-		
-		?console.VFS_OUT_SYNC {
-			[fb_pending_flush] ;
-			(
-				(
-					!fb.FB_FLUSH ;
-					[curs_goto]
-				) +
-				NULL
-			) ;
-		} +
-		
-		?console.CONSOLE_CLEAR {
-			!fb.FB_FLUSH +
-			NULL
-		} +
-		
-		?console.CONSOLE_GOTO {
-			!fb.CURS_GOTO +
-			NULL
-		} +
-		
-		?console.CONSOLE_GET_SIZE +
-		
-		?console.CONSOLE_GET_COLOR_CAP +
-		
-		?console.CONSOLE_SET_STYLE {
-			[fb_pending_flush] ;
-			(
-				[set_style] +
-				NULL
-			)
-		} +
-		
-		?console.CONSOLE_SET_COLOR {
-			[fb_pending_flush] ;
-			(
-				[set_color] +
-				NULL
-			)
-		} +
-		
-		?console.CONSOLE_SET_RGB_COLOR {
-			[fb_pending_flush] ;
-			(
-				[set_rgb_color] +
-				NULL
-			)
-		} +
-		
-		?console.CONSOLE_CURSOR_VISIBILITY {
-			[fb_pending_flush] ;
-			(
-				[curs_visibility] +
-				NULL
-			)
-		} +
-		
-		?console.CONSOLE_GET_EVENT +
-		
-		?console.CONSOLE_KCON_ENABLE
-		
-	)* ;
-	
-	?console.IPC_M_PHONE_HUNGUP {
-		[gcons_notify_disconnect]
-	}
-)*
Index: ntrib/bp/srv/console/curs_goto
===================================================================
--- contrib/bp/srv/console/curs_goto	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CURSOR_GOTO
Index: ntrib/bp/srv/console/curs_visibility
===================================================================
--- contrib/bp/srv/console/curs_visibility	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CURSOR_VISIBILITY
Index: ntrib/bp/srv/console/draw_pixmap
===================================================================
--- contrib/bp/srv/console/draw_pixmap	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_PREPARE_SHM ;
-!fb.IPC_M_SHARE_OUT ;
-!fb.FB_DRAW_PPM ;
-!fb.FB_DROP_SHM
Index: ntrib/bp/srv/console/fb_pending_flush
===================================================================
--- contrib/bp/srv/console/fb_pending_flush	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_DRAW_TEXT_DATA
Index: ntrib/bp/srv/console/gcons_notify_connect
===================================================================
--- contrib/bp/srv/console/gcons_notify_connect	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(
-	[redraw_state] ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/bp/srv/console/gcons_notify_disconnect
===================================================================
--- contrib/bp/srv/console/gcons_notify_disconnect	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(
-	[redraw_state] ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/bp/srv/console/gcons_redraw_console
===================================================================
--- contrib/bp/srv/console/gcons_redraw_console	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,10 +1,0 @@
-(
-	[vp_switch] ;
-	[set_rgb_color] ;
-	[clear] ;
-	[draw_pixmap] ;
-	[draw_pixmap] ;
-	[redraw_state]* ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/bp/srv/console/make_anim
===================================================================
--- contrib/bp/srv/console/make_anim	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_ANIM_CREATE ;
-[make_pixmap]* ;
-!fb.FB_ANIM_ADDPIXMAP ;
-!fb.FB_ANIM_START
Index: ntrib/bp/srv/console/make_pixmap
===================================================================
--- contrib/bp/srv/console/make_pixmap	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_PREPARE_SHM ;
-!fb.IPC_M_SHARE_OUT ;
-!fb.FB_SHM2PIXMAP ;
-!fb.FB_DROP_SHM
Index: ntrib/bp/srv/console/redraw_state
===================================================================
--- contrib/bp/srv/console/redraw_state	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,11 +1,0 @@
-[vp_switch] ;
-(
-	!fb.FB_VP_DRAW_PIXMAP +
-	NULL
-) ;
-(
-	(
-		!fb.FB_PUTCHAR*
-	) +
-	NULL
-)
Index: ntrib/bp/srv/console/screen_clear
===================================================================
--- contrib/bp/srv/console/screen_clear	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CLEAR
Index: ntrib/bp/srv/console/set_color
===================================================================
--- contrib/bp/srv/console/set_color	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_COLOR
Index: ntrib/bp/srv/console/set_rgb_color
===================================================================
--- contrib/bp/srv/console/set_rgb_color	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_RGB_COLOR
Index: ntrib/bp/srv/console/set_style
===================================================================
--- contrib/bp/srv/console/set_style	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_STYLE
Index: ntrib/bp/srv/console/vp_create
===================================================================
--- contrib/bp/srv/console/vp_create	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_VIEWPORT_CREATE
Index: ntrib/bp/srv/console/vp_switch
===================================================================
--- contrib/bp/srv/console/vp_switch	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_VIEWPORT_SWITCH
Index: ntrib/bp/srv/console/write_char
===================================================================
--- contrib/bp/srv/console/write_char	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,18 +1,0 @@
-(
-	[fb_pending_flush] +
-	[cell_mark_changed]
-) ;
-(
-	(
-		[fb_pending_flush] ;
-		(
-			!fb.FB_SCROLL +
-			NULL
-		)
-	) +
-	NULL
-) ;
-(
-	[curs_goto] +
-	NULL
-)
Index: ntrib/bp/srv/devmap/devmap.bp
===================================================================
--- contrib/bp/srv/devmap/devmap.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,42 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?devmap.IPC_M_CONNECT_ME_TO ;
-	(
-		( /* driver interface */
-			?devmap.DEVMAP_DEVICE_REGISTER {
-				?devmap.IPC_M_DATA_WRITE /* name */
-			} +
-			
-			?devmap.DEVMAP_DEVICE_GET_HANDLE {
-				?devmap.IPC_M_DATA_WRITE /* name */
-			} +
-			
-			?devmap.DEVMAP_DEVICE_GET_NAME +
-			
-			?devmap.DEVMAP_DEVICE_UNREGISTER +
-			
-			?devmap.DEVMAP_DRIVER_UNREGISTER
-		) +
-		
-		( /* client interface */
-			?devmap.DEVMAP_DEVICE_GET_HANDLE {
-				?devmap.IPC_M_DATA_WRITE /* name */
-			} +
-			
-			?devmap.DEVMAP_DEVICE_GET_NAME +
-			
-			?devmap.DEVMAP_DEVICE_NULL_CREATE +
-			
-			?devmap.DEVMAP_DEVICE_NULL_DESTROY +
-			
-			?devmap.DEVMAP_DEVICE_GET_COUNT +
-			
-			?devmap.DEVMAP_DEVICE_GET_DEVICES {
-				?devmap.IPC_M_DATA_READ /* buffer */
-			}
-		) +
-		
-		!dev.IPC_M_CONNECT_ME_TO /* forwarded */
-	)* ;
-	?devmap.IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/fb/fb.bp
===================================================================
--- contrib/bp/srv/fb/fb.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,74 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?fb.IPC_M_CONNECT_ME_TO ;
-	(
-		?fb.IPC_M_SHARE_OUT +
-		
-		(
-			?fb.FB_PREPARE_SHM ;
-			?fb.IPC_M_AS_AREA_SEND ;
-			?fb.FB_DRAW_PPM ;
-			?fb.FB_DROP_SHM
-		) +
-		
-		(
-			?fb.IPC_M_AS_AREA_SEND ;
-			?fb.FB_DRAW_TEXT_DATA
-		) +
-		
-		?fb.FB_SHM2PIXMAP +
-		
-		?fb.FB_VP_DRAW_PIXMAP +
-		
-		?fb.FB_VP2PIXMAP +
-		
-		?fb.FB_DROP_PIXMAP +
-		
-		?fb.FB_ANIM_CREATE +
-		
-		?fb.FB_ANIM_DROP +
-		
-		?fb.FB_ANIM_ADDPIXMAP +
-		
-		?fb.FB_ANIM_CHGVP +
-		
-		?fb.FB_ANIM_START +
-		
-		?fb.FB_ANIM_STOP +
-		
-		?fb.FB_PUTCHAR +
-		
-		?fb.FB_CLEAR +
-		
-		?fb.FB_CURSOR_GOTO +
-		
-		?fb.FB_CURSOR_VISIBILITY +
-		
-		?fb.FB_GET_CSIZE +
-		
-		?fb.FB_GET_COLOR_CAP +
-		
-		?fb.FB_SCROLL +
-		
-		?fb.FB_VIEWPORT_SWITCH +
-		
-		?fb.FB_VIEWPORT_CREATE +
-		
-		?fb.FB_VIEWPORT_DELETE +
-		
-		?fb.FB_SET_STYLE +
-		
-		?fb.FB_SET_COLOR +
-		
-		?fb.FB_SET_RGB_COLOR +
-		
-		?fb.FB_GET_RESOLUTION +
-		
-		?fb.FB_POINTER_MOVE +
-		
-		?fb.FB_SCREEN_YIELD +
-		
-		?fb.FB_SCREEN_RECLAIM
-	)* ;
-	?fb.IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/fs/devfs/devfs.bp
===================================================================
--- contrib/bp/srv/fs/devfs/devfs.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,66 +1,0 @@
-[../../../lib/libc/devmap_get_phone] ;
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?fs.IPC_M_CONNECT_ME_TO ;
-	(
-		?fs.VFS_OUT_MOUNTED {
-			?fs.IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?fs.VFS_OUT_MOUNT +
-		
-		?fs.VFS_OUT_LOOKUP {
-			(
-				[../../../lib/libc/devmap_device_get_handle] ;
-				[../../../lib/libc/devmap_device_connect]
-			) +
-			NULL
-		} +
-		
-		?fs.VFS_OUT_READ {
-			?fs.IPC_M_DATA_READ /* payload */ {
-				(
-					!dev.VFS_OUT_READ ;
-					!dev.IPC_M_DATA_READ /* forwarded */
-				) +
-				(
-					[../../../lib/libc/devmap_device_get_count] ;
-					[../../../lib/libc/devmap_device_get_devices]
-				)
-			}
-		} +
-		
-		?fs.VFS_OUT_WRITE {
-			?fs.IPC_M_DATA_WRITE /* payload */ {
-				(
-					!dev.VFS_OUT_WRITE ;
-					!dev.IPC_M_DATA_WRITE /* forwarded */
-				)
-			} +
-			NULL
-		} +
-		
-		?fs.VFS_OUT_TRUNCATE +
-		
-		?fs.VFS_OUT_CLOSE {
-			!dev.IPC_M_PHONE_HUNGUP
-		} +
-		
-		?fs.VFS_OUT_DESTROY +
-		
-		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libc/devmap_device_connect] +
-			NULL
-		} +
-		
-		?fs.VFS_OUT_STAT {
-			?IPC_M_DATA_READ /* struct stat */
-		} +
-		
-		?fs.VFS_OUT_SYNC
-		
-	)* ;
-	?fs.IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: ntrib/bp/srv/fs/fat/fat.bp
===================================================================
--- contrib/bp/srv/fs/fat/fat.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,45 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?fs.IPC_M_CONNECT_ME_TO ;
-	(
-		?fs.VFS_OUT_MOUNTED {
-			?fs.IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?fs.VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
-		} +
-		
-		?fs.VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
-		} +
-		
-		?fs.VFS_OUT_READ {
-			?fs.IPC_M_DATA_READ /* payload */
-		} +
-		
-		?fs.VFS_OUT_WRITE {
-			?fs.IPC_M_DATA_WRITE /* payload */
-		} +
-		
-		?fs.VFS_OUT_TRUNCATE +
-		
-		?fs.VFS_OUT_CLOSE +
-		
-		?fs.VFS_OUT_DESTROY +
-		
-		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
-		} +
-		
-		?fs.VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
-		} +
-		
-		?fs.VFS_OUT_SYNC
-		
-	)* ;
-	?fs.IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: ntrib/bp/srv/fs/tmpfs/tmpfs.bp
===================================================================
--- contrib/bp/srv/fs/tmpfs/tmpfs.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,45 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?fs.IPC_M_CONNECT_ME_TO ;
-	(
-		?fs.VFS_OUT_MOUNTED {
-			?fs.IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?fs.VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
-		} +
-		
-		?fs.VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
-		} +
-		
-		?fs.VFS_OUT_READ {
-			?fs.IPC_M_DATA_READ /* payload */
-		} +
-		
-		?fs.VFS_OUT_WRITE {
-			?fs.IPC_M_DATA_WRITE /* payload */
-		} +
-		
-		?fs.VFS_OUT_TRUNCATE +
-		
-		?fs.VFS_OUT_CLOSE +
-		
-		?fs.VFS_OUT_DESTROY +
-		
-		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
-		} +
-		
-		?fs.VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
-		} +
-		
-		?fs.VFS_OUT_SYNC
-		
-	)* ;
-	?fs.IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: ntrib/bp/srv/kbd/kbd.bp
===================================================================
--- contrib/bp/srv/kbd/kbd.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,20 +1,0 @@
-(
-	!ns.IPC_M_CONNECT_ME_TO /* cir */ +
-	NULL
-) ;
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?kbd.IPC_M_CONNECT_ME_TO ;
-	(
-		(
-			?kbd.KBD_YIELD +
-			?kbd.KBD_RECLAIM +
-		) |
-		!console.KBD_EVENT
-	)* ;
-	?kbd.IPC_M_PHONE_HUNGUP
-)* ;
-(
-	!cir.IPC_M_PHONE_HUNGUP +
-	NULL
-)
Index: ntrib/bp/srv/loader/loader.bp
===================================================================
--- contrib/bp/srv/loader/loader.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,25 +1,0 @@
-!ns.NS_ID_INTRO ;
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?loader.LOADER_GET_TASKID {
-		?loader.IPC_M_DATA_READ /* task id */
-	} +
-	
-	?loader.LOADER_SET_PATHNAME {
-		?loader.IPC_M_DATA_WRITE /* path */
-	} +
-	
-	?loader.LOADER_SET_ARGS {
-		?loader.IPC_M_DATA_WRITE /* arguments */
-	} +
-	
-	?loader.LOADER_SET_FILES {
-		?loader.IPC_M_DATA_WRITE /* files */
-	} +
-	
-	?loader.LOADER_LOAD
-)* ;
-(
-	?loader.LOADER_RUN +
-	?loader.IPC_M_PHONE_HUNGUP
-)
Index: ntrib/bp/srv/ns/ns.bp
===================================================================
--- contrib/bp/srv/ns/ns.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,18 +1,0 @@
-(
-	(
-		?ns.IPC_M_SHARE_IN /* SERVICE_MEM_REALTIME || SERVICE_MEM_KLOG */ +
-		?ns.IPC_M_CONNECT_TO_ME {
-			!clonable.IPC_M_CONNECT_TO_ME /* forwarded */ +
-			NULL
-		} +
-		?ns.IPC_M_CONNECT_ME_TO {
-			!service.IPC_M_CONNECT_ME_TO /* forwarded */ +
-			NULL
-		} +
-		?ns.NS_PING +
-		?ns.NS_TASK_WAIT +
-		?ns.NS_ID_INTRO +
-		?ns.NS_RETVAL
-	)* ;
-	?ns.IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/pci/pci.bp
===================================================================
--- contrib/bp/srv/pci/pci.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,5 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?pci.IPC_M_CONNECT_ME_TO ;
-	?pci.IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/vfs/vfs.bp
===================================================================
--- contrib/bp/srv/vfs/vfs.bp	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,131 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?vfs.IPC_M_CONNECT_ME_TO ;
-	(
-		?vfs.VFS_IN_REGISTER {
-			?vfs.IPC_M_DATA_WRITE ;
-			?vfs.IPC_M_CONNECT_TO_ME ;
-			?vfs.IPC_M_SHARE_IN
-		} +
-		
-		?vfs.VFS_IN_MOUNT {
-			?vfs.IPC_M_DATA_WRITE /* mount point */ ;
-			?vfs.IPC_M_DATA_WRITE /* mount options */ ;
-			?vfs.IPC_M_DATA_WRITE /* fs name */ ;
-			?vfs.IPC_M_PING ;
-			(
-				
-				!fs.VFS_OUT_MOUNTED ;
-				!fs.IPC_M_DATA_WRITE /* mount options */
-			) /* root fs */ +
-			(
-				!fs.VFS_OUT_MOUNT ;
-				!fs.IPC_M_CONNECTION_CLONE ;
-				!fs.VFS_M_DATA_WRITE /* mount options */
-			) /* non-root fs */
-		} +
-		
-		?vfs.VFS_IN_OPEN {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?vfs.VFS_IN_OPEN_NODE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_OPEN_NODE ;
-			[vfs_release_phone] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?vfs.VFS_IN_CLOSE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_CLOSE ;
-			[vfs_release_phone]
-		} +
-		
-		?vfs.VFS_IN_READ {
-			?vfs.IPC_M_DATA_READ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_READ /* payload */ ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?vfs.VFS_IN_WRITE {
-			?vfs.IPC_M_DATA_WRITE {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_WRITE /* payload */ ;
-				!fs.IPC_M_DATA_WRITE /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?vfs.VFS_IN_SEEK +
-		
-		?vfs.VFS_IN_TRUNCATE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_TRUNCATE ;
-			[vfs_release_phone]
-		} +
-		
-		?vfs.VFS_IN_FSTAT {
-			?vfs.IPC_M_DATA_READ /* struct stat */ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?vfs.VFS_IN_STAT {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			?vfs.IPC_M_DATA_READ /* struct stat */ {
-				[vfs_lookup_internal] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */
-			}
-		} +
-		
-		?vfs.VFS_IN_MKDIR {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?vfs.VFS_IN_UNLINK {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?vfs.VFS_IN_RENAME {
-			?vfs.IPC_M_DATA_WRITE /* old path */ ;
-			?vfs.IPC_M_DATE_WRITE /* new path */ ;
-			[vfs_lookup_internal] /* lookup old path */ ;
-			[vfs_lookup_internal] /* lookup parent of new path */ ;
-			[vfs_lookup_internal] /* destroy old link for the new path */ ;
-			[vfs_lookup_internal] /* create new link for the new path */ ;
-			[vfs_lookup_internal] /* destroy link for the old path */
-		} +
-		
-		?vfs.VFS_IN_SYNC {
-			!fs.VFS_OUT_SYNC
-		}
-		
-	)* ;
-	?vfs.IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/vfs/vfs_grab_phone
===================================================================
--- contrib/bp/srv/vfs/vfs_grab_phone	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_CONNECT_ME_TO
Index: ntrib/bp/srv/vfs/vfs_lookup_internal
===================================================================
--- contrib/bp/srv/vfs/vfs_lookup_internal	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,3 +1,0 @@
-[vfs_grab_phone] ;
-!fs.VFS_OUT_LOOKUP ;
-[vfs_release_phone]
Index: ntrib/bp/srv/vfs/vfs_release_phone
===================================================================
--- contrib/bp/srv/vfs/vfs_release_phone	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_PHONE_HUNGUP
Index: contrib/highlight/adl.syntax
===================================================================
--- contrib/highlight/adl.syntax	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ contrib/highlight/adl.syntax	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -5,4 +5,15 @@
 	keyword whole interface yellow
 	keyword whole frame yellow
+	keyword whole architecture yellow
+	
+	keyword whole system yellow
+	keyword whole extends yellow
+	keyword whole version yellow
+	
+	keyword whole inst yellow
+	keyword whole bind yellow
+	keyword whole to yellow
+	keyword whole subsume yellow
+	keyword whole delegate yellow
 	
 	keyword whole ipcarg_t yellow
@@ -33,4 +44,7 @@
 	keyword ] brightblue black
 
+context exclusive [ ] brightblue black
+	keyword % brightcyan black
+
 context exclusive /\* \*/ brown
 	spellcheck
Index: contrib/highlight/bp.syntax
===================================================================
--- contrib/highlight/bp.syntax	(revision ac2c2ea7f78ea355e9cdeb4aaac8767c8d48cbe5)
+++ contrib/highlight/bp.syntax	(revision 07fdf2039be8c557cff859a000458feabc41d241)
@@ -4,4 +4,7 @@
 context default
 	keyword whole NULL yellow
+	keyword whole try yellow
+	keyword whole catch yellow
+	keyword whole tentative yellow
 	
 	keyword /\* brown
@@ -29,4 +32,5 @@
 
 context exclusive [ ] brightblue black
+	keyword % brightcyan black
 
 context exclusive /\* \*/ brown
