Index: contrib/arch/HelenOS.adl
===================================================================
--- contrib/arch/HelenOS.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/HelenOS.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,22 @@
+system architecture HelenOS version 0.4.1 {
+	/* SPARTAN kernel */
+	inst kernel kernel;
+	
+	/* Naming Service */
+	inst ns ns;
+	
+	/* RAM disk */
+	inst rd rd;
+	
+	/* Klog */
+	inst klog klog;
+	
+	[/uspace/lib/libc/bind%ns]
+	
+	[/usrpace/lib/libc/bind%rd]
+	bind rd:ns to ns:ns;
+	bind rd:dm_driver to devmap:dm_driver;
+	
+	[/usrpace/lib/libc/bind%klog]
+	bind klog:ns to ns:ns;
+};
Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/hadlbppp.py	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/kernel/kernel.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,272 @@
+/*****************************
+ * 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_futex to kernel_synch:kernel_futex;
+	delegate kernel_smc to kernel_synch:kernel_smc;
+	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.adl
===================================================================
--- contrib/arch/uspace/app/klog/klog.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/app/klog/klog.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,8 @@
+frame klog {
+	requires:
+		naming_service ns;
+		[/uspace/lib/libc/requires]
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[klog.bp]
+};
Index: contrib/arch/uspace/app/klog/klog.bp
===================================================================
--- contrib/arch/uspace/app/klog/klog.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/app/klog/klog.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!ns.ipc_m_share_in /* SERVICE_MEM_KLOG */
Index: contrib/arch/uspace/lib/libc/bind
===================================================================
--- contrib/arch/uspace/lib/libc/bind	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/bind	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,16 @@
+/* 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_futex to kernel:kernel_futex;
+bind %%:kernel_smc to kernel:kernel_smc;
+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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/devmap_device_connect	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/devmap_device_get_count	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/devmap_device_get_devices	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/devmap_device_get_handle	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/devmap_get_phone	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_connect	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!ns.ipc_m_connect_me_to /* device via devmap */
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,2 @@
+[fnc.devmap_get_phone] ;
+!dm_client.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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,4 @@
+[fnc.devmap_get_phone] ;
+!dm_client.device_get_devices {
+	!dm_client.ipc_m_data_read /* buffer */
+}
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,4 @@
+[fnc.devmap_get_phone] ;
+!dm_client.device_get_handle {
+	!dm_client.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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_get_phone	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,3 @@
+tentative {
+	!ns.ipc_m_connect_me_to /* devmap */
+}
Index: contrib/arch/uspace/lib/libc/protocol
===================================================================
--- contrib/arch/uspace/lib/libc/protocol	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/protocol	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,41 @@
+/* Protocol according to which libc uses kernel syscalls */
+(
+	!kernel_klog.sys_klog +
+	!kernel_tls.sys_tls_set +
+	!kernel_thread.sys_thread_create +
+	!kernel_thread.sys_thread_get_id +
+	!kernel_thread.sys_thread_exit +
+	!kernel_task.sys_task_set_name +
+	!kernel_task.sys_task_get_id +
+	!kernel_program.sys_program_spawn_loader +
+	!kernel_futex.sys_futex_sleep_timeout +
+	!kernel_futex.sys_futex_wakeup +
+	!kernel_smc.sys_smc_coherence +
+	!kernel_as.sys_as_area_create +
+	!kernel_as.sys_as_area_resize +
+	!kernel_as.sys_as_area_change_flags +
+	!kernel_as.sys_as_area_destroy +
+	!kernel_ipc.sys_ipc_call_sync_fast +
+	!kernel_ipc.sys_ipc_call_sync_slow +
+	!kernel_ipc.sys_ipc_call_async_fast +
+	!kernel_ipc.sys_ipc_call_async_slow +
+	!kernel_ipc.sys_ipc_forward_fast +
+	!kernel_ipc.sys_ipc_forward_slow +
+	!kernel_ipc.sys_ipc_answer_fast +
+	!kernel_ipc.sys_ipc_answer_slow +
+	!kernel_ipc.sys_ipc_hangup +
+	!kernel_ipc.sys_ipc_wait_for_call +
+	!kernel_ipc.sys_ipc_poke +
+	!kernel_event.sys_event_subscribe +
+	!kernel_cap.sys_cap_grant +
+	!kernel_cap.sys_cap_rewoke +
+	!kernel_ddi.sys_enable_iospace +
+	!kernel_ddi.sys_physmem_map +
+	!kernel_ddi.sys_device_assign_devno +
+	!kernel_ddi.sys_preempt_control +
+	!kernel_ddi.sys_ipc_register_irq +
+	!kernel_ddi.sys_ipc_unregister_irq +
+	!kernel_sysinfo.sys_sysinfo_valid +
+	!kernel_sysinfo.sys_sysinfo_value +
+	!kernel_debug.sys_ipc_connect_kbox
+)*
Index: contrib/arch/uspace/lib/libc/requires
===================================================================
--- contrib/arch/uspace/lib/libc/requires	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libc/requires	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,16 @@
+/* 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_futex kernel_futex;
+kernel_smc kernel_smc;
+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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libfs/fs_register	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libfs/libfs_lookup	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fs.VFS_OUT_LOOKUP*
Index: contrib/arch/uspace/lib/libfs/libfs_mount
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_mount	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libfs/libfs_mount	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/lib/libfs/libfs_stat	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/bd/block_device.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/bd/block_device.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/bd/rd/rd.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,11 @@
+frame rd {
+	provides:
+		block_device bd;
+	requires:
+		naming_service ns;
+		device_mapper_driver dm_driver;
+		[/uspace/lib/libc/requires]
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[rd.bp]
+};
Index: contrib/arch/uspace/srv/bd/rd/rd.bp
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/bd/rd/rd.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,2 @@
+[/lib/libc/fnc.devmap_driver_register] ;
+[/lib/libc/fnc.devmap_device_register]
Index: contrib/arch/uspace/srv/console/cell_mark_changed
===================================================================
--- contrib/arch/uspace/srv/console/cell_mark_changed	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/cell_mark_changed	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,4 @@
+(
+	[fb_pending_flush] +
+	NULL
+)
Index: contrib/arch/uspace/srv/console/clear
===================================================================
--- contrib/arch/uspace/srv/console/clear	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/clear	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_CLEAR
Index: contrib/arch/uspace/srv/console/cons_read
===================================================================
--- contrib/arch/uspace/srv/console/cons_read	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/cons_read	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/cons_write	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/console.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/curs_goto	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_CURSOR_GOTO
Index: contrib/arch/uspace/srv/console/curs_visibility
===================================================================
--- contrib/arch/uspace/srv/console/curs_visibility	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/curs_visibility	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_CURSOR_VISIBILITY
Index: contrib/arch/uspace/srv/console/draw_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/draw_pixmap	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/draw_pixmap	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/fb_pending_flush	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/gcons_notify_connect	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/gcons_notify_disconnect	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/gcons_redraw_console	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/make_anim	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/make_pixmap	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/redraw_state	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/screen_clear	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_CLEAR
Index: contrib/arch/uspace/srv/console/set_color
===================================================================
--- contrib/arch/uspace/srv/console/set_color	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/set_color	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/set_rgb_color	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/set_style	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_SET_STYLE
Index: contrib/arch/uspace/srv/console/vp_create
===================================================================
--- contrib/arch/uspace/srv/console/vp_create	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/vp_create	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_VIEWPORT_CREATE
Index: contrib/arch/uspace/srv/console/vp_switch
===================================================================
--- contrib/arch/uspace/srv/console/vp_switch	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/vp_switch	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fb.FB_VIEWPORT_SWITCH
Index: contrib/arch/uspace/srv/console/write_char
===================================================================
--- contrib/arch/uspace/srv/console/write_char	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/console/write_char	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/devmap/device_mapper_client.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/devmap/device_mapper_driver.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/devmap/devmap.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/devmap/devmap.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/fb/fb.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/fs/devfs/devfs.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/fs/fat/fat.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/kbd/kbd.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/loader/loader.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/ns/naming_service.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/ns/ns.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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]
+	protocol:
+		[/uspace/lib/libc/protocol]
+};
Index: contrib/arch/uspace/srv/ns/service.adl
===================================================================
--- contrib/arch/uspace/srv/ns/service.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/ns/service.adl	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/pci/pci.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/vfs/vfs.bp	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/vfs/vfs_grab_phone	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/vfs/vfs_lookup_internal	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -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 b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/arch/uspace/srv/vfs/vfs_release_phone	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,1 @@
+!fs.IPC_M_PHONE_HUNGUP
Index: ntrib/bp/app/klog/klog.bp
===================================================================
--- contrib/bp/app/klog/klog.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!ns.IPC_SHARE_IN /* SERVICE_MEM_KLOG */
Index: ntrib/bp/lib/libc/devmap_device_connect
===================================================================
--- contrib/bp/lib/libc/devmap_device_connect	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.VFS_OUT_LOOKUP*
Index: ntrib/bp/lib/libfs/libfs_mount
===================================================================
--- contrib/bp/lib/libfs/libfs_mount	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,6 +1,0 @@
-?IPC_M_CONNECTION_CLONE ;
-?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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?IPC_M_DATA_READ
Index: ntrib/bp/srv/bd/rd/rd.bp
===================================================================
--- contrib/bp/srv/bd/rd/rd.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,11 +1,0 @@
-[devmap_driver_register] ;
-[devmap_device_register] ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	?IPC_SHARE_IN ;
-	(
-		?BD_READ_BLOCK +
-		?BD_WRITE_BLOCK
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/devmap/devmap.bp
===================================================================
--- contrib/bp/srv/devmap/devmap.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,42 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		( /* driver interface */
-			?DEVMAP_DEVICE_REGISTER {
-				?IPC_M_DATA_WRITE /* name */
-			} +
-			
-			?DEVMAP_DEVICE_GET_HANDLE {
-				?IPC_M_DATA_WRITE /* name */
-			} +
-			
-			?DEVMAP_DEVICE_GET_NAME +
-			
-			?DEVMAP_DEVICE_UNREGISTER +
-			
-			?DEVMAP_DRIVER_UNREGISTER
-		) +
-		
-		( /* client interface */
-			?DEVMAP_DEVICE_GET_HANDLE {
-				?IPC_M_DATA_WRITE /* name */
-			} +
-			
-			?DEVMAP_DEVICE_GET_NAME +
-			
-			?DEVMAP_DEVICE_NULL_CREATE +
-			
-			?DEVMAP_DEVICE_NULL_DESTROY +
-			
-			?DEVMAP_DEVICE_GET_COUNT +
-			
-			?DEVMAP_DEVICE_GET_DEVICES {
-				?IPC_M_DATA_READ /* buffer */
-			}
-		) +
-		
-		!dev.IPC_M_CONNECT_ME_TO /* forwarded */
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/fb/fb.bp
===================================================================
--- contrib/bp/srv/fb/fb.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,74 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		?IPC_M_SHARE_OUT +
-		
-		(
-			?FB_PREPARE_SHM ;
-			?IPC_M_AS_AREA_SEND ;
-			?FB_DRAW_PPM ;
-			?FB_DROP_SHM
-		) +
-		
-		(
-			?IPC_M_AS_AREA_SEND ;
-			?FB_DRAW_TEXT_DATA
-		) +
-		
-		?FB_SHM2PIXMAP +
-		
-		?FB_VP_DRAW_PIXMAP +
-		
-		?FB_VP2PIXMAP +
-		
-		?FB_DROP_PIXMAP +
-		
-		?FB_ANIM_CREATE +
-		
-		?FB_ANIM_DROP +
-		
-		?FB_ANIM_ADDPIXMAP +
-		
-		?FB_ANIM_CHGVP +
-		
-		?FB_ANIM_START +
-		
-		?FB_ANIM_STOP +
-		
-		?FB_PUTCHAR +
-		
-		?FB_CLEAR +
-		
-		?FB_CURSOR_GOTO +
-		
-		?FB_CURSOR_VISIBILITY +
-		
-		?FB_GET_CSIZE +
-		
-		?FB_GET_COLOR_CAP +
-		
-		?FB_SCROLL +
-		
-		?FB_VIEWPORT_SWITCH +
-		
-		?FB_VIEWPORT_CREATE +
-		
-		?FB_VIEWPORT_DELETE +
-		
-		?FB_SET_STYLE +
-		
-		?FB_SET_COLOR +
-		
-		?FB_SET_RGB_COLOR +
-		
-		?FB_GET_RESOLUTION +
-		
-		?FB_POINTER_MOVE +
-		
-		?FB_SCREEN_YIELD +
-		
-		?FB_SCREEN_RECLAIM
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/fs/devfs/devfs.bp
===================================================================
--- contrib/bp/srv/fs/devfs/devfs.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,66 +1,0 @@
-[../../../lib/libc/devmap_get_phone] ;
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		?VFS_OUT_MOUNTED {
-			?IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?VFS_OUT_MOUNT +
-		
-		?VFS_OUT_LOOKUP {
-			(
-				[../../../lib/libc/devmap_device_get_handle] ;
-				[../../../lib/libc/devmap_device_connect]
-			) +
-			NULL
-		} +
-		
-		?VFS_OUT_READ {
-			?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]
-				)
-			}
-		} +
-		
-		?VFS_OUT_WRITE {
-			?IPC_M_DATA_WRITE /* payload */ {
-				(
-					!dev.VFS_OUT_WRITE ;
-					!dev.IPC_M_DATA_WRITE /* forwarded */
-				)
-			} +
-			NULL
-		} +
-		
-		?VFS_OUT_TRUNCATE +
-		
-		?VFS_OUT_CLOSE {
-			!dev.IPC_M_PHONE_HUNGUP
-		} +
-		
-		?VFS_OUT_DESTROY +
-		
-		?VFS_OUT_OPEN_NODE {
-			[../../../lib/libc/devmap_device_connect] +
-			NULL
-		} +
-		
-		?VFS_OUT_STAT {
-			?IPC_M_DATA_READ /* struct stat */
-		} +
-		
-		?VFS_OUT_SYNC
-		
-	)* ;
-	?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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,45 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		?VFS_OUT_MOUNTED {
-			?IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
-		} +
-		
-		?VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
-		} +
-		
-		?VFS_OUT_READ {
-			?IPC_M_DATA_READ /* payload */
-		} +
-		
-		?VFS_OUT_WRITE {
-			?IPC_M_DATA_WRITE /* payload */
-		} +
-		
-		?VFS_OUT_TRUNCATE +
-		
-		?VFS_OUT_CLOSE +
-		
-		?VFS_OUT_DESTROY +
-		
-		?VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
-		} +
-		
-		?VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
-		} +
-		
-		?VFS_OUT_SYNC
-		
-	)* ;
-	?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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,45 +1,0 @@
-!ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		?VFS_OUT_MOUNTED {
-			?IPC_M_DATA_WRITE /* mount options */
-		} +
-		
-		?VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
-		} +
-		
-		?VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
-		} +
-		
-		?VFS_OUT_READ {
-			?IPC_M_DATA_READ /* payload */
-		} +
-		
-		?VFS_OUT_WRITE {
-			?IPC_M_DATA_WRITE /* payload */
-		} +
-		
-		?VFS_OUT_TRUNCATE +
-		
-		?VFS_OUT_CLOSE +
-		
-		?VFS_OUT_DESTROY +
-		
-		?VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
-		} +
-		
-		?VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
-		} +
-		
-		?VFS_OUT_SYNC
-		
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)* ;
-!vfs.IPC_M_PHONE_HUNGUP
Index: ntrib/bp/srv/kbd/kbd.bp
===================================================================
--- contrib/bp/srv/kbd/kbd.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,20 +1,0 @@
-(
-	!ns.IPC_M_CONNECT_ME_TO /* cir */ +
-	NULL
-) ;
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		(
-			?KBD_YIELD +
-			?KBD_RECLAIM +
-		) |
-		!console.KBD_EVENT
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)* ;
-(
-	!cir.IPC_M_PHONE_HUNGUP +
-	NULL
-)
Index: ntrib/bp/srv/loader/loader.bp
===================================================================
--- contrib/bp/srv/loader/loader.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,25 +1,0 @@
-!ns.NS_ID_INTRO ;
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?LOADER_GET_TASKID {
-		?IPC_M_DATA_READ /* task id */
-	} +
-	
-	?LOADER_SET_PATHNAME {
-		?IPC_M_DATA_WRITE /* path */
-	} +
-	
-	?LOADER_SET_ARGS {
-		?IPC_M_DATA_WRITE /* arguments */
-	} +
-	
-	?LOADER_SET_FILES {
-		?IPC_M_DATA_WRITE /* files */
-	} +
-	
-	?LOADER_LOAD
-)* ;
-(
-	?LOADER_RUN +
-	?IPC_M_PHONE_HUNGUP
-)
Index: ntrib/bp/srv/ns/ns.bp
===================================================================
--- contrib/bp/srv/ns/ns.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,18 +1,0 @@
-(
-	(
-		?IPC_M_SHARE_IN /* SERVICE_MEM_REALTIME || SERVICE_MEM_KLOG */ +
-		?IPC_M_CONNECT_TO_ME {
-			!clonable.IPC_M_CONNECT_TO_ME /* forwarded */ +
-			NULL
-		} +
-		?IPC_M_CONNECT_ME_TO {
-			!service.IPC_M_CONNECT_ME_TO /* forwarded */ +
-			NULL
-		} +
-		?NS_PING +
-		?NS_TASK_WAIT +
-		?NS_ID_INTRO +
-		?NS_RETVAL
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/pci/pci.bp
===================================================================
--- contrib/bp/srv/pci/pci.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,5 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	?IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/vfs/vfs.bp
===================================================================
--- contrib/bp/srv/vfs/vfs.bp	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,132 +1,0 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?IPC_M_CONNECT_ME_TO ;
-	(
-		?VFS_IN_REGISTER {
-			?IPC_M_DATA_WRITE ;
-			?IPC_M_CONNECT_TO_ME ;
-			?IPC_M_SHARE_IN
-		} +
-		
-		?VFS_IN_MOUNT {
-			?IPC_M_DATA_WRITE /* mount point */ ;
-			?IPC_M_DATA_WRITE /* mount options */ ;
-			?IPC_M_DATA_WRITE /* fs name */ ;
-			?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_IN_OPEN {
-			?IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?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
-				NULL
-			)
-		} +
-		
-		?VFS_IN_CLOSE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_CLOSE ;
-			[vfs_release_phone]
-		} +
-		
-		?VFS_IN_READ {
-			?IPC_M_DATA_READ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_READ /* payload */ ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?VFS_IN_WRITE {
-			?IPC_M_DATA_WRITE {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_WRITE /* payload */ ;
-				!fs.IPC_M_DATA_WRITE /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?VFS_IN_SEEK +
-		
-		?VFS_IN_TRUNCATE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_TRUNCATE ;
-			[vfs_release_phone]
-		} +
-		
-		?VFS_IN_FSTAT {
-			?IPC_M_DATA_READ /* struct stat */ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?VFS_IN_STAT {
-			?IPC_M_DATA_WRITE /* path */ ;
-			?IPC_M_DATA_READ /* struct stat */ {
-				[vfs_lookup_internal] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */
-			}
-		} +
-		
-		?VFS_IN_MKDIR {
-			?IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?VFS_IN_UNLINK {
-			?IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?VFS_IN_RENAME {
-			?IPC_M_DATA_WRITE /* old path */ ;
-			?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_IN_SYNC {
-			!fs.VFS_OUT_SYNC
-		}
-		
-	)* ;
-	?IPC_M_PHONE_HUNGUP
-)*
Index: ntrib/bp/srv/vfs/vfs_grab_phone
===================================================================
--- contrib/bp/srv/vfs/vfs_grab_phone	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(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 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_PHONE_HUNGUP
Index: contrib/highlight/Syntax
===================================================================
--- contrib/highlight/Syntax	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/highlight/Syntax	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,5 @@
+file ..\*\\.(bp|BP)$ Behavior\sProtocol 
+include bp.syntax
+
+file ..\*\\.(adl|ADP)$ Architecture\sDescription\sLanguage
+include adl.syntax
Index: contrib/highlight/adl.syntax
===================================================================
--- contrib/highlight/adl.syntax	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/highlight/adl.syntax	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,53 @@
+# Architecture Description Language syntax highlighting rules
+#  by Martin Decky <martin@decky.cz>
+
+context default
+	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
+	keyword whole void yellow
+	
+	keyword whole in yellow
+	keyword whole out yellow
+	
+	keyword whole protocol yellow
+	keyword whole provides yellow
+	keyword whole requires yellow
+	
+	keyword /\* brown
+	keyword \*/ brown
+	keyword // brown
+	
+	keyword { brightcyan
+	keyword } brightcyan
+	
+	keyword ( brightcyan
+	keyword ) brightcyan
+	
+	keyword , brightcyan
+	keyword : brightcyan
+	keyword ; brightmagenta
+	
+	keyword [ brightblue black
+	keyword ] brightblue black
+
+context exclusive [ ] brightblue black
+	keyword % brightcyan black
+
+context exclusive /\* \*/ brown
+	spellcheck
+
+context exclusive // \n brown
+	spellcheck
Index: contrib/highlight/bp.syntax
===================================================================
--- contrib/highlight/bp.syntax	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
+++ contrib/highlight/bp.syntax	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -0,0 +1,40 @@
+# Behavior Protocols syntax highlighting rules
+#  by Martin Decky <martin@decky.cz>
+
+context default
+	keyword whole NULL yellow
+	keyword whole try yellow
+	keyword whole catch yellow
+	keyword whole tentative yellow
+	
+	keyword /\* brown
+	keyword \*/ brown
+	keyword # brown
+	
+	keyword ! brightred
+	keyword ? brightgreen
+	
+	keyword ( brightcyan
+	keyword ) brightcyan
+	
+	keyword { brightcyan
+	keyword } brightcyan
+	
+	keyword \+ brightmagenta
+	keyword ; brightmagenta
+	keyword \* brightmagenta
+	keyword | brightmagenta
+	
+	keyword \. brightcyan
+	
+	keyword [ brightblue black
+	keyword ] brightblue black
+
+context exclusive [ ] brightblue black
+	keyword % brightcyan black
+
+context exclusive /\* \*/ brown
+	spellcheck
+
+context exclusive # \n brown
+	spellcheck
Index: kernel/arch/ia64/include/asm.h
===================================================================
--- kernel/arch/ia64/include/asm.h	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ kernel/arch/ia64/include/asm.h	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -422,4 +422,6 @@
 	asm volatile (
 		"rsm %[mask]\n"
+		";;\n"
+		"srlz.d\n"
 		:: [mask] "i" (PSR_PK_MASK)
 	);
Index: kernel/arch/ia64/src/mm/as.c
===================================================================
--- kernel/arch/ia64/src/mm/as.c	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ kernel/arch/ia64/src/mm/as.c	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -73,7 +73,7 @@
 		rr.map.ps = PAGE_WIDTH;
 		rr_write(i, rr.word);
+		srlz_d();
+		srlz_i();
 	}
-	srlz_d();
-	srlz_i();
 }
 
Index: uspace/app/edit/edit.c
===================================================================
--- uspace/app/edit/edit.c	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ uspace/app/edit/edit.c	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -88,5 +88,5 @@
 static pane_t pane;
 
-static ipcarg_t scr_rows, scr_columns;
+static int scr_rows, scr_columns;
 
 #define ROW_BUF_SIZE 4096
@@ -362,6 +362,5 @@
 {
 	int sh_rows, rows;
-	int i;
-	unsigned j;
+	int i, j;
 
 	sheet_get_num_rows(&doc.sh, &sh_rows);
@@ -452,5 +451,5 @@
 		/* Fill until the end of display area. */
 
-		if (str_length(row_buf) < scr_columns)
+		if (str_length(row_buf) < (unsigned) scr_columns)
 			fill = scr_columns - str_length(row_buf);
 		else
Index: uspace/app/tetris/screen.h
===================================================================
--- uspace/app/tetris/screen.h	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ uspace/app/tetris/screen.h	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -51,6 +51,6 @@
 
 typedef struct {
-	ipcarg_t ws_row;
-	ipcarg_t ws_col;
+	int ws_row;
+	int ws_col;
 } winsize_t;
 
Index: uspace/lib/libc/generic/io/console.c
===================================================================
--- uspace/lib/libc/generic/io/console.c	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ uspace/lib/libc/generic/io/console.c	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -45,7 +45,15 @@
 }
 
-int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols)
+int console_get_size(int phone, int *cols, int *rows)
 {
-	return async_req_0_2(phone, CONSOLE_GET_SIZE, rows, cols);
+	ipcarg_t cols_v;
+	ipcarg_t rows_v;
+	int rc;
+
+	rc = async_req_0_2(phone, CONSOLE_GET_SIZE, &cols_v, &rows_v);
+
+	*cols = (int) cols_v;
+	*rows = (int) rows_v;
+	return rc;
 }
 
@@ -86,7 +94,7 @@
 }
 
-void console_goto(int phone, ipcarg_t row, ipcarg_t col)
+void console_goto(int phone, int col, int row)
 {
-	async_msg_2(phone, CONSOLE_GOTO, row, col);
+	async_msg_2(phone, CONSOLE_GOTO, col, row);
 }
 
Index: uspace/lib/libc/include/io/console.h
===================================================================
--- uspace/lib/libc/include/io/console.h	(revision 3052ff4d8cfe91bfe73946c0e1785fe4cfe44b07)
+++ uspace/lib/libc/include/io/console.h	(revision b077886e362778a610e96a41c1a0f66665d0e89c)
@@ -68,6 +68,6 @@
 extern void console_clear(int phone);
 
-extern int console_get_size(int phone, ipcarg_t *rows, ipcarg_t *cols);
-extern void console_goto(int phone, ipcarg_t row, ipcarg_t col);
+extern int console_get_size(int phone, int *cols, int *rows);
+extern void console_goto(int phone, int col, int row);
 
 extern void console_set_style(int phone, int style);
